| 1321 | } |
| 1322 | |
| 1323 | func (h *httpAPI) TSDB(ctx context.Context, opts ...Option) (TSDBResult, error) { |
| 1324 | u := h.client.URL(epTSDB, nil) |
| 1325 | q := addOptionalURLParams(u.Query(), opts) |
| 1326 | u.RawQuery = q.Encode() |
| 1327 | |
| 1328 | req, err := http.NewRequest(http.MethodGet, u.String(), nil) |
| 1329 | if err != nil { |
| 1330 | return TSDBResult{}, err |
| 1331 | } |
| 1332 | |
| 1333 | _, body, _, err := h.client.Do(ctx, req) |
| 1334 | if err != nil { |
| 1335 | return TSDBResult{}, err |
| 1336 | } |
| 1337 | |
| 1338 | var res TSDBResult |
| 1339 | err = json.Unmarshal(body, &res) |
| 1340 | return res, err |
| 1341 | } |
| 1342 | |
| 1343 | func (h *httpAPI) WalReplay(ctx context.Context) (WalReplayStatus, error) { |
| 1344 | u := h.client.URL(epWalReplay, nil) |