mirror of
https://github.com/hanzoai/search-go.git
synced 2026-10-30 18:22:58 +00:00
Modules declare go 1.27.1 and the build images follow. go fix applied the modernizers, and the test and example pointer helpers went once new(expr) could say them; omitzero is not applied, since it changes what the JSON says. Co-authored-by: Hanzo Dev <[email protected]>
27 lines
764 B
Go
27 lines
764 B
Go
package meilisearch
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
"strconv"
|
|
)
|
|
|
|
func (m *meilisearch) GetTaskDocuments(taskUID int64, dst any) error {
|
|
return m.GetTaskDocumentsWithContext(context.Background(), taskUID, dst)
|
|
}
|
|
|
|
func (m *meilisearch) GetTaskDocumentsWithContext(ctx context.Context, taskUID int64, dst any) error {
|
|
req := &internalRequest{
|
|
endpoint: "/tasks/" + strconv.FormatInt(taskUID, 10) + "/documents",
|
|
method: http.MethodGet,
|
|
withRequest: nil,
|
|
withResponse: dst,
|
|
withQueryParams: nil,
|
|
withResponseEncoding: true,
|
|
acceptedStatusCodes: []int{http.StatusOK},
|
|
acceptedContentType: contentTypeNDJSON,
|
|
functionName: "GetTaskDocuments",
|
|
}
|
|
return m.client.executeRequest(ctx, req)
|
|
}
|