Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func PrettyPrint(v any) string
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AggregateBy
- type AggregateByCount
- type AggregateBySum
- type AggregationGroup
- type AttributeSchemaConfig
- type AttributeSchemaConfigAnn
- type AttributeSchemaConfigAnnParam
- type AttributeSchemaConfigParam
- type AttributeType
- type Bm25ClauseParams
- type BranchFromNamespaceParams
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Namespace(namespace string) Namespace
- func (r *Client) Namespaces(ctx context.Context, query NamespacesParams, opts ...option.RequestOption) (res *pagination.NamespacePage[NamespaceSummary], err error)
- func (r *Client) NamespacesAutoPaging(ctx context.Context, query NamespacesParams, opts ...option.RequestOption) *pagination.NamespacePageAutoPager[NamespaceSummary]
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type ColumnsParam
- type ContainsAllTokensFilterParams
- type ContainsAnyTokenFilterParams
- type CopyFromNamespaceParams
- type DecayParams
- type DistanceMetric
- type Error
- type Expr
- type ExprRefNew
- type Filter
- type FilterAnd
- type FilterAnyGt
- type FilterAnyGte
- type FilterAnyLt
- type FilterAnyLte
- type FilterContains
- type FilterContainsAllTokens
- type FilterContainsAllTokensArray
- type FilterContainsAllTokensArrayWithParams
- type FilterContainsAllTokensWithParams
- type FilterContainsAny
- type FilterContainsAnyToken
- type FilterContainsAnyTokenArray
- type FilterContainsAnyTokenArrayWithParams
- type FilterContainsAnyTokenWithParams
- type FilterContainsTokenSequence
- type FilterContainsTokenSequenceArray
- type FilterEq
- type FilterGlob
- type FilterGt
- type FilterGte
- type FilterIGlob
- type FilterIn
- type FilterLt
- type FilterLte
- type FilterNot
- type FilterNotContains
- type FilterNotContainsAny
- type FilterNotEq
- type FilterNotGlob
- type FilterNotIGlob
- type FilterNotIn
- type FilterOr
- type FilterRegex
- type FullTextSearchConfig
- type FullTextSearchConfigParam
- type ID
- type IDParam
- type IncludeAttributesParam
- type Language
- type LimitParam
- type LimitPerParam
- type Namespace
- type NamespaceDeleteAllParams
- type NamespaceDeleteAllResponse
- type NamespaceExplainQueryParams
- type NamespaceExplainQueryParamsConsistency
- type NamespaceExplainQueryParamsConsistencyLevel
- type NamespaceExplainQueryResponse
- type NamespaceHintCacheWarmParams
- type NamespaceHintCacheWarmResponse
- type NamespaceMetadata
- type NamespaceMetadataEncryption
- func (u NamespaceMetadataEncryption) AsNamespaceMetadataEncryptionCmek() (v NamespaceMetadataEncryptionCmek)
- func (u NamespaceMetadataEncryption) AsNamespaceMetadataEncryptionSse() (v NamespaceMetadataEncryptionSse)
- func (u NamespaceMetadataEncryption) RawJSON() string
- func (r *NamespaceMetadataEncryption) UnmarshalJSON(data []byte) error
- type NamespaceMetadataEncryptionCmek
- type NamespaceMetadataEncryptionCmekCmek
- type NamespaceMetadataEncryptionSse
- type NamespaceMetadataIndex
- type NamespaceMetadataIndexIndexUpToDate
- type NamespaceMetadataIndexIndexUpdating
- type NamespaceMetadataParams
- type NamespaceMetadataPatchParam
- type NamespaceMetadataPinning
- type NamespaceMetadataPinningStatus
- type NamespaceMultiQueryParams
- type NamespaceMultiQueryParamsConsistency
- type NamespaceMultiQueryParamsConsistencyLevel
- type NamespaceMultiQueryResponse
- type NamespaceMultiQueryResponseResult
- type NamespaceQueryParams
- type NamespaceQueryParamsConsistency
- type NamespaceQueryParamsConsistencyLevel
- type NamespaceQueryResponse
- type NamespaceRecallParams
- type NamespaceRecallResponse
- type NamespaceRecallResponseGroundTruth
- type NamespaceSchemaParams
- type NamespaceSchemaResponse
- type NamespaceService
- func (r *NamespaceService) DeleteAll(ctx context.Context, body NamespaceDeleteAllParams, ...) (res *NamespaceDeleteAllResponse, err error)
- func (r *NamespaceService) ExplainQuery(ctx context.Context, params NamespaceExplainQueryParams, ...) (res *NamespaceExplainQueryResponse, err error)
- func (r *NamespaceService) HintCacheWarm(ctx context.Context, query NamespaceHintCacheWarmParams, ...) (res *NamespaceHintCacheWarmResponse, err error)
- func (r *NamespaceService) ID() string
- func (r *NamespaceService) Metadata(ctx context.Context, query NamespaceMetadataParams, ...) (res *NamespaceMetadata, err error)
- func (r *NamespaceService) MultiQuery(ctx context.Context, params NamespaceMultiQueryParams, ...) (res *NamespaceMultiQueryResponse, err error)
- func (r *NamespaceService) Query(ctx context.Context, params NamespaceQueryParams, opts ...option.RequestOption) (res *NamespaceQueryResponse, err error)
- func (r *NamespaceService) Recall(ctx context.Context, params NamespaceRecallParams, ...) (res *NamespaceRecallResponse, err error)
- func (r *NamespaceService) Schema(ctx context.Context, query NamespaceSchemaParams, opts ...option.RequestOption) (res *NamespaceSchemaResponse, err error)
- func (r *NamespaceService) UpdateMetadata(ctx context.Context, params NamespaceUpdateMetadataParams, ...) (res *NamespaceMetadata, err error)
- func (r *NamespaceService) UpdateSchema(ctx context.Context, params NamespaceUpdateSchemaParams, ...) (res *NamespaceUpdateSchemaResponse, err error)
- func (r *NamespaceService) Write(ctx context.Context, params NamespaceWriteParams, opts ...option.RequestOption) (res *NamespaceWriteResponse, err error)
- type NamespaceSummary
- type NamespaceUpdateMetadataParams
- type NamespaceUpdateSchemaParams
- type NamespaceUpdateSchemaResponse
- type NamespaceWriteParams
- type NamespaceWriteParamsEncryption
- type NamespaceWriteParamsEncryptionCmek
- type NamespaceWriteParamsPatchByFilter
- type NamespaceWriteResponse
- type NamespacesParams
- type PinningConfig
- type PinningConfigParam
- type QueryBilling
- type QueryParam
- type QueryPerformance
- type RankBy
- type RankByAttribute
- type RankByAttributeOrder
- type RankByAttributes
- type RankByKnn
- type RankByText
- type RankByTextAttribute
- type RankByTextBM25
- type RankByTextBM25Array
- type RankByTextBM25ArrayWithParams
- type RankByTextBM25WithParams
- type RankByTextDecay
- type RankByTextDist
- type RankByTextMax
- type RankByTextProduct
- type RankByTextSaturate
- type RankByTextSum
- type RankByVector
- type Row
- type RowParam
- type SaturateParams
- type Tokenizer
- type Vector
- type VectorEncoding
- type VectorParam
- type WriteBilling
- type WritePerformance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (TURBOPUFFER_API_KEY, TURBOPUFFER_REGION, TURBOPUFFER_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
func PrettyPrint ¶
PrettyPrint pretty prints a JSON-encodable value to a string.
Types ¶
type AggregateBy ¶
type AggregateBy interface {
// contains filtered or unexported methods
}
type AggregateByCount ¶
type AggregateByCount struct {
}
func NewAggregateByCount ¶
func NewAggregateByCount() AggregateByCount
func (AggregateByCount) MarshalJSON ¶
func (v AggregateByCount) MarshalJSON() ([]byte, error)
type AggregateBySum ¶ added in v1.7.0
type AggregateBySum struct {
// contains filtered or unexported fields
}
func NewAggregateBySum ¶ added in v1.7.0
func NewAggregateBySum( attr string, ) AggregateBySum
func (AggregateBySum) MarshalJSON ¶ added in v1.7.0
func (v AggregateBySum) MarshalJSON() ([]byte, error)
type AggregationGroup ¶ added in v1.1.0
type AttributeSchemaConfig ¶
type AttributeSchemaConfig struct {
// The data type of the attribute. Valid values: string, int, uint, float, uuid,
// datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool,
// [DIMS]f16, [DIMS]f32.
Type AttributeType `json:"type" api:"required"`
// Whether to create an approximate nearest neighbor index for the attribute. Can
// be a boolean or a detailed configuration object.
Ann AttributeSchemaConfigAnn `json:"ann"`
// Whether or not the attributes can be used in filters.
Filterable bool `json:"filterable"`
// Whether this attribute can be used as part of a BM25 full-text search. Requires
// the `string` or `[]string` type, and by default, BM25-enabled attributes are not
// filterable. You can override this by setting `filterable: true`.
FullTextSearch FullTextSearchConfig `json:"full_text_search"`
// Whether to enable Glob filters on this attribute.
Glob bool `json:"glob"`
// Whether to enable Regex filters on this attribute.
Regex bool `json:"regex"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Ann respjson.Field
Filterable respjson.Field
FullTextSearch respjson.Field
Glob respjson.Field
Regex respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Detailed configuration for an attribute attached to a document.
func (AttributeSchemaConfig) RawJSON ¶
func (r AttributeSchemaConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (AttributeSchemaConfig) ToParam ¶
func (r AttributeSchemaConfig) ToParam() AttributeSchemaConfigParam
ToParam converts this AttributeSchemaConfig to a AttributeSchemaConfigParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with AttributeSchemaConfigParam.Overrides()
func (*AttributeSchemaConfig) UnmarshalJSON ¶
func (r *AttributeSchemaConfig) UnmarshalJSON(data []byte) error
type AttributeSchemaConfigAnn ¶ added in v1.6.0
type AttributeSchemaConfigAnn struct {
// A function used to calculate vector similarity.
//
// Any of "cosine_distance", "euclidean_squared".
DistanceMetric DistanceMetric `json:"distance_metric"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DistanceMetric respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Configuration options for ANN (Approximate Nearest Neighbor) indexing.
func (AttributeSchemaConfigAnn) RawJSON ¶ added in v1.6.0
func (r AttributeSchemaConfigAnn) RawJSON() string
Returns the unmodified JSON received from the API
func (*AttributeSchemaConfigAnn) UnmarshalJSON ¶ added in v1.6.0
func (r *AttributeSchemaConfigAnn) UnmarshalJSON(data []byte) error
type AttributeSchemaConfigAnnParam ¶ added in v1.6.0
type AttributeSchemaConfigAnnParam struct {
// A function used to calculate vector similarity.
//
// Any of "cosine_distance", "euclidean_squared".
DistanceMetric DistanceMetric `json:"distance_metric,omitzero"`
// contains filtered or unexported fields
}
Configuration options for ANN (Approximate Nearest Neighbor) indexing.
func (AttributeSchemaConfigAnnParam) MarshalJSON ¶ added in v1.6.0
func (r AttributeSchemaConfigAnnParam) MarshalJSON() (data []byte, err error)
func (*AttributeSchemaConfigAnnParam) UnmarshalJSON ¶ added in v1.6.0
func (r *AttributeSchemaConfigAnnParam) UnmarshalJSON(data []byte) error
type AttributeSchemaConfigParam ¶
type AttributeSchemaConfigParam struct {
// The data type of the attribute. Valid values: string, int, uint, float, uuid,
// datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool,
// [DIMS]f16, [DIMS]f32.
Type AttributeType `json:"type" api:"required"`
// Whether or not the attributes can be used in filters.
Filterable param.Opt[bool] `json:"filterable,omitzero"`
// Whether to enable Glob filters on this attribute.
Glob param.Opt[bool] `json:"glob,omitzero"`
// Whether to enable Regex filters on this attribute.
Regex param.Opt[bool] `json:"regex,omitzero"`
// Whether to create an approximate nearest neighbor index for the attribute. Can
// be a boolean or a detailed configuration object.
Ann AttributeSchemaConfigAnnParam `json:"ann,omitzero"`
// Whether this attribute can be used as part of a BM25 full-text search. Requires
// the `string` or `[]string` type, and by default, BM25-enabled attributes are not
// filterable. You can override this by setting `filterable: true`.
FullTextSearch *FullTextSearchConfigParam `json:"full_text_search,omitzero"`
// contains filtered or unexported fields
}
Detailed configuration for an attribute attached to a document.
The property Type is required.
func (AttributeSchemaConfigParam) MarshalJSON ¶
func (r AttributeSchemaConfigParam) MarshalJSON() (data []byte, err error)
func (*AttributeSchemaConfigParam) UnmarshalJSON ¶
func (r *AttributeSchemaConfigParam) UnmarshalJSON(data []byte) error
type AttributeType ¶
type AttributeType = string
type Bm25ClauseParams ¶ added in v1.2.0
type Bm25ClauseParams struct {
// Whether to treat the last token in the query input as a literal prefix.
LastAsPrefix param.Opt[bool] `json:"last_as_prefix,omitzero"`
// contains filtered or unexported fields
}
Additional (optional) parameters for a single BM25 query clause.
func (Bm25ClauseParams) MarshalJSON ¶ added in v1.2.0
func (r Bm25ClauseParams) MarshalJSON() (data []byte, err error)
func (*Bm25ClauseParams) UnmarshalJSON ¶ added in v1.2.0
func (r *Bm25ClauseParams) UnmarshalJSON(data []byte) error
type BranchFromNamespaceParams ¶ added in v1.19.0
type BranchFromNamespaceParams struct {
// The namespace to create an instant, copy-on-write clone of.
SourceNamespace string `json:"source_namespace" api:"required"`
// contains filtered or unexported fields
}
The property SourceNamespace is required.
func (BranchFromNamespaceParams) MarshalJSON ¶ added in v1.19.0
func (r BranchFromNamespaceParams) MarshalJSON() (data []byte, err error)
func (*BranchFromNamespaceParams) UnmarshalJSON ¶ added in v1.19.0
func (r *BranchFromNamespaceParams) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Options []option.RequestOption
// contains filtered or unexported fields
}
Client creates a struct with services and top level methods that help with interacting with the turbopuffer API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (TURBOPUFFER_API_KEY, TURBOPUFFER_REGION, TURBOPUFFER_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Namespaces ¶
func (r *Client) Namespaces(ctx context.Context, query NamespacesParams, opts ...option.RequestOption) (res *pagination.NamespacePage[NamespaceSummary], err error)
List namespaces.
func (*Client) NamespacesAutoPaging ¶
func (r *Client) NamespacesAutoPaging(ctx context.Context, query NamespacesParams, opts ...option.RequestOption) *pagination.NamespacePageAutoPager[NamespaceSummary]
List namespaces.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type ColumnsParam ¶
A list of documents in columnar format. Each key is a column name, mapped to an array of values for that column.
type ContainsAllTokensFilterParams ¶ added in v1.2.0
type ContainsAllTokensFilterParams struct {
// Whether to treat the last token in the query input as a literal prefix.
LastAsPrefix param.Opt[bool] `json:"last_as_prefix,omitzero"`
// contains filtered or unexported fields
}
Additional (optional) parameters for the ContainsAllTokens filter.
func (ContainsAllTokensFilterParams) MarshalJSON ¶ added in v1.2.0
func (r ContainsAllTokensFilterParams) MarshalJSON() (data []byte, err error)
func (*ContainsAllTokensFilterParams) UnmarshalJSON ¶ added in v1.2.0
func (r *ContainsAllTokensFilterParams) UnmarshalJSON(data []byte) error
type ContainsAnyTokenFilterParams ¶ added in v1.11.0
type ContainsAnyTokenFilterParams struct {
// Whether to treat the last token in the query input as a literal prefix.
LastAsPrefix param.Opt[bool] `json:"last_as_prefix,omitzero"`
// contains filtered or unexported fields
}
Additional (optional) parameters for the ContainsAnyToken filter.
func (ContainsAnyTokenFilterParams) MarshalJSON ¶ added in v1.11.0
func (r ContainsAnyTokenFilterParams) MarshalJSON() (data []byte, err error)
func (*ContainsAnyTokenFilterParams) UnmarshalJSON ¶ added in v1.11.0
func (r *ContainsAnyTokenFilterParams) UnmarshalJSON(data []byte) error
type CopyFromNamespaceParams ¶ added in v1.20.0
type CopyFromNamespaceParams struct {
// The namespace to copy documents from.
SourceNamespace string `json:"source_namespace" api:"required"`
// (Optional) An API key for the organization containing the source namespace
SourceAPIKey param.Opt[string] `json:"source_api_key,omitzero"`
// (Optional) The region of the source namespace.
SourceRegion param.Opt[string] `json:"source_region,omitzero"`
// contains filtered or unexported fields
}
The property SourceNamespace is required.
func (CopyFromNamespaceParams) MarshalJSON ¶ added in v1.20.0
func (r CopyFromNamespaceParams) MarshalJSON() (data []byte, err error)
func (*CopyFromNamespaceParams) UnmarshalJSON ¶ added in v1.20.0
func (r *CopyFromNamespaceParams) UnmarshalJSON(data []byte) error
type DecayParams ¶ added in v1.14.0
type DecayParams struct {
// An exponent that helps further control the shape of the Decay function.
Exponent param.Opt[float64] `json:"exponent,omitzero"`
// The midpoint of the Decay operator.
Midpoint any `json:"midpoint,omitzero"`
// contains filtered or unexported fields
}
Additional parameters for the Decay operator.
func (DecayParams) MarshalJSON ¶ added in v1.14.0
func (r DecayParams) MarshalJSON() (data []byte, err error)
func (*DecayParams) UnmarshalJSON ¶ added in v1.14.0
func (r *DecayParams) UnmarshalJSON(data []byte) error
type DistanceMetric ¶
type DistanceMetric string
A function used to calculate vector similarity.
const ( DistanceMetricCosineDistance DistanceMetric = "cosine_distance" DistanceMetricEuclideanSquared DistanceMetric = "euclidean_squared" )
type ExprRefNew ¶ added in v0.1.4
type ExprRefNew struct {
// contains filtered or unexported fields
}
func NewExprRefNew ¶ added in v0.1.4
func NewExprRefNew( refNew string, ) ExprRefNew
func (ExprRefNew) MarshalJSON ¶ added in v0.1.4
func (v ExprRefNew) MarshalJSON() ([]byte, error)
type FilterAnd ¶
type FilterAnd struct {
// contains filtered or unexported fields
}
func NewFilterAnd ¶
func (FilterAnd) MarshalJSON ¶
type FilterAnyGt ¶ added in v1.1.0
type FilterAnyGt struct {
// contains filtered or unexported fields
}
func NewFilterAnyGt ¶ added in v1.1.0
func NewFilterAnyGt( attr string, value any, ) FilterAnyGt
func (FilterAnyGt) MarshalJSON ¶ added in v1.1.0
func (v FilterAnyGt) MarshalJSON() ([]byte, error)
type FilterAnyGte ¶ added in v1.1.0
type FilterAnyGte struct {
// contains filtered or unexported fields
}
func NewFilterAnyGte ¶ added in v1.1.0
func NewFilterAnyGte( attr string, value any, ) FilterAnyGte
func (FilterAnyGte) MarshalJSON ¶ added in v1.1.0
func (v FilterAnyGte) MarshalJSON() ([]byte, error)
type FilterAnyLt ¶ added in v1.1.0
type FilterAnyLt struct {
// contains filtered or unexported fields
}
func NewFilterAnyLt ¶ added in v1.1.0
func NewFilterAnyLt( attr string, value any, ) FilterAnyLt
func (FilterAnyLt) MarshalJSON ¶ added in v1.1.0
func (v FilterAnyLt) MarshalJSON() ([]byte, error)
type FilterAnyLte ¶ added in v1.1.0
type FilterAnyLte struct {
// contains filtered or unexported fields
}
func NewFilterAnyLte ¶ added in v1.1.0
func NewFilterAnyLte( attr string, value any, ) FilterAnyLte
func (FilterAnyLte) MarshalJSON ¶ added in v1.1.0
func (v FilterAnyLte) MarshalJSON() ([]byte, error)
type FilterContains ¶ added in v0.1.5
type FilterContains struct {
// contains filtered or unexported fields
}
func NewFilterContains ¶ added in v0.1.5
func NewFilterContains( attr string, value any, ) FilterContains
func (FilterContains) MarshalJSON ¶ added in v0.1.5
func (v FilterContains) MarshalJSON() ([]byte, error)
type FilterContainsAllTokens ¶
type FilterContainsAllTokens struct {
// contains filtered or unexported fields
}
func NewFilterContainsAllTokens ¶
func NewFilterContainsAllTokens( attr string, value string, ) FilterContainsAllTokens
func (FilterContainsAllTokens) MarshalJSON ¶
func (v FilterContainsAllTokens) MarshalJSON() ([]byte, error)
type FilterContainsAllTokensArray ¶ added in v0.1.4
type FilterContainsAllTokensArray struct {
// contains filtered or unexported fields
}
func NewFilterContainsAllTokensArray ¶ added in v0.1.4
func NewFilterContainsAllTokensArray( attr string, value []string, ) FilterContainsAllTokensArray
func (FilterContainsAllTokensArray) MarshalJSON ¶ added in v0.1.4
func (v FilterContainsAllTokensArray) MarshalJSON() ([]byte, error)
type FilterContainsAllTokensArrayWithParams ¶ added in v1.2.0
type FilterContainsAllTokensArrayWithParams struct {
// contains filtered or unexported fields
}
func NewFilterContainsAllTokensArrayWithParams ¶ added in v1.2.0
func NewFilterContainsAllTokensArrayWithParams( attr string, value []string, params ContainsAllTokensFilterParams, ) FilterContainsAllTokensArrayWithParams
func (FilterContainsAllTokensArrayWithParams) MarshalJSON ¶ added in v1.2.0
func (v FilterContainsAllTokensArrayWithParams) MarshalJSON() ([]byte, error)
type FilterContainsAllTokensWithParams ¶ added in v1.2.0
type FilterContainsAllTokensWithParams struct {
// contains filtered or unexported fields
}
func NewFilterContainsAllTokensWithParams ¶ added in v1.2.0
func NewFilterContainsAllTokensWithParams( attr string, value string, params ContainsAllTokensFilterParams, ) FilterContainsAllTokensWithParams
func (FilterContainsAllTokensWithParams) MarshalJSON ¶ added in v1.2.0
func (v FilterContainsAllTokensWithParams) MarshalJSON() ([]byte, error)
type FilterContainsAny ¶ added in v0.1.5
type FilterContainsAny[T any] struct { // contains filtered or unexported fields }
func NewFilterContainsAny ¶ added in v0.1.5
func NewFilterContainsAny[T any]( attr string, value []T, ) FilterContainsAny[T]
func (FilterContainsAny[T]) MarshalJSON ¶ added in v0.1.5
func (v FilterContainsAny[T]) MarshalJSON() ([]byte, error)
type FilterContainsAnyToken ¶ added in v1.10.0
type FilterContainsAnyToken struct {
// contains filtered or unexported fields
}
func NewFilterContainsAnyToken ¶ added in v1.10.0
func NewFilterContainsAnyToken( attr string, value string, ) FilterContainsAnyToken
func (FilterContainsAnyToken) MarshalJSON ¶ added in v1.10.0
func (v FilterContainsAnyToken) MarshalJSON() ([]byte, error)
type FilterContainsAnyTokenArray ¶ added in v1.10.0
type FilterContainsAnyTokenArray struct {
// contains filtered or unexported fields
}
func NewFilterContainsAnyTokenArray ¶ added in v1.10.0
func NewFilterContainsAnyTokenArray( attr string, value []string, ) FilterContainsAnyTokenArray
func (FilterContainsAnyTokenArray) MarshalJSON ¶ added in v1.10.0
func (v FilterContainsAnyTokenArray) MarshalJSON() ([]byte, error)
type FilterContainsAnyTokenArrayWithParams ¶ added in v1.11.0
type FilterContainsAnyTokenArrayWithParams struct {
// contains filtered or unexported fields
}
func NewFilterContainsAnyTokenArrayWithParams ¶ added in v1.11.0
func NewFilterContainsAnyTokenArrayWithParams( attr string, value []string, params ContainsAnyTokenFilterParams, ) FilterContainsAnyTokenArrayWithParams
func (FilterContainsAnyTokenArrayWithParams) MarshalJSON ¶ added in v1.11.0
func (v FilterContainsAnyTokenArrayWithParams) MarshalJSON() ([]byte, error)
type FilterContainsAnyTokenWithParams ¶ added in v1.11.0
type FilterContainsAnyTokenWithParams struct {
// contains filtered or unexported fields
}
func NewFilterContainsAnyTokenWithParams ¶ added in v1.11.0
func NewFilterContainsAnyTokenWithParams( attr string, value string, params ContainsAnyTokenFilterParams, ) FilterContainsAnyTokenWithParams
func (FilterContainsAnyTokenWithParams) MarshalJSON ¶ added in v1.11.0
func (v FilterContainsAnyTokenWithParams) MarshalJSON() ([]byte, error)
type FilterContainsTokenSequence ¶ added in v1.7.0
type FilterContainsTokenSequence struct {
// contains filtered or unexported fields
}
func NewFilterContainsTokenSequence ¶ added in v1.7.0
func NewFilterContainsTokenSequence( attr string, value string, ) FilterContainsTokenSequence
func (FilterContainsTokenSequence) MarshalJSON ¶ added in v1.7.0
func (v FilterContainsTokenSequence) MarshalJSON() ([]byte, error)
type FilterContainsTokenSequenceArray ¶ added in v1.7.0
type FilterContainsTokenSequenceArray struct {
// contains filtered or unexported fields
}
func NewFilterContainsTokenSequenceArray ¶ added in v1.7.0
func NewFilterContainsTokenSequenceArray( attr string, value []string, ) FilterContainsTokenSequenceArray
func (FilterContainsTokenSequenceArray) MarshalJSON ¶ added in v1.7.0
func (v FilterContainsTokenSequenceArray) MarshalJSON() ([]byte, error)
type FilterEq ¶
type FilterEq struct {
// contains filtered or unexported fields
}
func NewFilterEq ¶
func (FilterEq) MarshalJSON ¶
type FilterGlob ¶
type FilterGlob struct {
// contains filtered or unexported fields
}
func NewFilterGlob ¶
func NewFilterGlob( attr string, value string, ) FilterGlob
func (FilterGlob) MarshalJSON ¶
func (v FilterGlob) MarshalJSON() ([]byte, error)
type FilterGt ¶
type FilterGt struct {
// contains filtered or unexported fields
}
func NewFilterGt ¶
func (FilterGt) MarshalJSON ¶
type FilterGte ¶
type FilterGte struct {
// contains filtered or unexported fields
}
func NewFilterGte ¶
func (FilterGte) MarshalJSON ¶
type FilterIGlob ¶
type FilterIGlob struct {
// contains filtered or unexported fields
}
func NewFilterIGlob ¶
func NewFilterIGlob( attr string, value string, ) FilterIGlob
func (FilterIGlob) MarshalJSON ¶
func (v FilterIGlob) MarshalJSON() ([]byte, error)
type FilterIn ¶
type FilterIn[T any] struct { // contains filtered or unexported fields }
func NewFilterIn ¶
func (FilterIn[T]) MarshalJSON ¶
type FilterLt ¶
type FilterLt struct {
// contains filtered or unexported fields
}
func NewFilterLt ¶
func (FilterLt) MarshalJSON ¶
type FilterLte ¶
type FilterLte struct {
// contains filtered or unexported fields
}
func NewFilterLte ¶
func (FilterLte) MarshalJSON ¶
type FilterNot ¶
type FilterNot struct {
// contains filtered or unexported fields
}
func NewFilterNot ¶
func (FilterNot) MarshalJSON ¶
type FilterNotContains ¶ added in v0.1.5
type FilterNotContains struct {
// contains filtered or unexported fields
}
func NewFilterNotContains ¶ added in v0.1.5
func NewFilterNotContains( attr string, value any, ) FilterNotContains
func (FilterNotContains) MarshalJSON ¶ added in v0.1.5
func (v FilterNotContains) MarshalJSON() ([]byte, error)
type FilterNotContainsAny ¶ added in v0.1.5
type FilterNotContainsAny[T any] struct { // contains filtered or unexported fields }
func NewFilterNotContainsAny ¶ added in v0.1.5
func NewFilterNotContainsAny[T any]( attr string, value []T, ) FilterNotContainsAny[T]
func (FilterNotContainsAny[T]) MarshalJSON ¶ added in v0.1.5
func (v FilterNotContainsAny[T]) MarshalJSON() ([]byte, error)
type FilterNotEq ¶
type FilterNotEq struct {
// contains filtered or unexported fields
}
func NewFilterNotEq ¶
func NewFilterNotEq( attr string, value any, ) FilterNotEq
func (FilterNotEq) MarshalJSON ¶
func (v FilterNotEq) MarshalJSON() ([]byte, error)
type FilterNotGlob ¶
type FilterNotGlob struct {
// contains filtered or unexported fields
}
func NewFilterNotGlob ¶
func NewFilterNotGlob( attr string, value string, ) FilterNotGlob
func (FilterNotGlob) MarshalJSON ¶
func (v FilterNotGlob) MarshalJSON() ([]byte, error)
type FilterNotIGlob ¶
type FilterNotIGlob struct {
// contains filtered or unexported fields
}
func NewFilterNotIGlob ¶
func NewFilterNotIGlob( attr string, value string, ) FilterNotIGlob
func (FilterNotIGlob) MarshalJSON ¶
func (v FilterNotIGlob) MarshalJSON() ([]byte, error)
type FilterNotIn ¶
type FilterNotIn[T any] struct { // contains filtered or unexported fields }
func NewFilterNotIn ¶
func NewFilterNotIn[T any]( attr string, value []T, ) FilterNotIn[T]
func (FilterNotIn[T]) MarshalJSON ¶
func (v FilterNotIn[T]) MarshalJSON() ([]byte, error)
type FilterOr ¶
type FilterOr struct {
// contains filtered or unexported fields
}
func NewFilterOr ¶
func (FilterOr) MarshalJSON ¶
type FilterRegex ¶ added in v0.1.12
type FilterRegex struct {
// contains filtered or unexported fields
}
func NewFilterRegex ¶ added in v0.1.12
func NewFilterRegex( attr string, value string, ) FilterRegex
func (FilterRegex) MarshalJSON ¶ added in v0.1.12
func (v FilterRegex) MarshalJSON() ([]byte, error)
type FullTextSearchConfig ¶
type FullTextSearchConfig struct {
// Whether to convert each non-ASCII character in a token to its ASCII equivalent,
// if one exists (e.g., à -> a). Defaults to `false` (i.e., no folding).
AsciiFolding bool `json:"ascii_folding"`
// The `b` document length normalization parameter for BM25. Defaults to `0.75`.
B float64 `json:"b"`
// Whether searching is case-sensitive. Defaults to `false` (i.e.
// case-insensitive).
CaseSensitive bool `json:"case_sensitive"`
// The `k1` term saturation parameter for BM25. Defaults to `1.2`.
K1 float64 `json:"k1"`
// Describes the language of a text attribute. Defaults to `english`.
//
// Any of "arabic", "danish", "dutch", "english", "finnish", "french", "german",
// "greek", "hungarian", "italian", "norwegian", "portuguese", "romanian",
// "russian", "spanish", "swedish", "tamil", "turkish".
Language Language `json:"language"`
// Maximum length of a token in bytes. Tokens larger than this value during
// tokenization will be filtered out. Has to be between `1` and `254` (inclusive).
// Defaults to `39`.
MaxTokenLength int64 `json:"max_token_length"`
// Removes common words from the text based on language. Defaults to `true` (i.e.
// remove common words).
RemoveStopwords bool `json:"remove_stopwords"`
// Language-specific stemming for the text. Defaults to `false` (i.e., do not
// stem).
Stemming bool `json:"stemming"`
// The tokenizer to use for full-text search on an attribute. Defaults to
// `word_v3`.
//
// Any of "pre_tokenized_array", "word_v0", "word_v1", "word_v2", "word_v3".
Tokenizer Tokenizer `json:"tokenizer"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AsciiFolding respjson.Field
B respjson.Field
CaseSensitive respjson.Field
K1 respjson.Field
Language respjson.Field
MaxTokenLength respjson.Field
RemoveStopwords respjson.Field
Stemming respjson.Field
Tokenizer respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Configuration options for full-text search.
func (FullTextSearchConfig) RawJSON ¶
func (r FullTextSearchConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (FullTextSearchConfig) ToParam ¶
func (r FullTextSearchConfig) ToParam() FullTextSearchConfigParam
ToParam converts this FullTextSearchConfig to a FullTextSearchConfigParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with FullTextSearchConfigParam.Overrides()
func (*FullTextSearchConfig) UnmarshalJSON ¶
func (r *FullTextSearchConfig) UnmarshalJSON(data []byte) error
type FullTextSearchConfigParam ¶
type FullTextSearchConfigParam struct {
// Whether to convert each non-ASCII character in a token to its ASCII equivalent,
// if one exists (e.g., à -> a). Defaults to `false` (i.e., no folding).
AsciiFolding param.Opt[bool] `json:"ascii_folding,omitzero"`
// The `b` document length normalization parameter for BM25. Defaults to `0.75`.
B param.Opt[float64] `json:"b,omitzero"`
// Whether searching is case-sensitive. Defaults to `false` (i.e.
// case-insensitive).
CaseSensitive param.Opt[bool] `json:"case_sensitive,omitzero"`
// The `k1` term saturation parameter for BM25. Defaults to `1.2`.
K1 param.Opt[float64] `json:"k1,omitzero"`
// Removes common words from the text based on language. Defaults to `true` (i.e.
// remove common words).
RemoveStopwords param.Opt[bool] `json:"remove_stopwords,omitzero"`
// Language-specific stemming for the text. Defaults to `false` (i.e., do not
// stem).
Stemming param.Opt[bool] `json:"stemming,omitzero"`
// Describes the language of a text attribute. Defaults to `english`.
//
// Any of "arabic", "danish", "dutch", "english", "finnish", "french", "german",
// "greek", "hungarian", "italian", "norwegian", "portuguese", "romanian",
// "russian", "spanish", "swedish", "tamil", "turkish".
Language Language `json:"language,omitzero"`
// Maximum length of a token in bytes. Tokens larger than this value during
// tokenization will be filtered out. Has to be between `1` and `254` (inclusive).
// Defaults to `39`.
MaxTokenLength param.Opt[int64] `json:"max_token_length,omitzero"`
// The tokenizer to use for full-text search on an attribute. Defaults to
// `word_v3`.
//
// Any of "pre_tokenized_array", "word_v0", "word_v1", "word_v2", "word_v3".
Tokenizer Tokenizer `json:"tokenizer,omitzero"`
// contains filtered or unexported fields
}
Configuration options for full-text search.
func (FullTextSearchConfigParam) MarshalJSON ¶
func (r FullTextSearchConfigParam) MarshalJSON() (data []byte, err error)
func (*FullTextSearchConfigParam) UnmarshalJSON ¶
func (r *FullTextSearchConfigParam) UnmarshalJSON(data []byte) error
type ID ¶
type ID struct {
// This field will be present if the value is a [string] instead of an object.
String string `json:",inline"`
// This field will be present if the value is a [int64] instead of an object.
Int int64 `json:",inline"`
JSON struct {
String respjson.Field
Int respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ID contains all possible properties and values from [string], [int64].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: String Int]
func (ID) ToParam ¶
ToParam converts this ID to a IDParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with IDParam.Overrides()
func (*ID) UnmarshalJSON ¶
type IDParam ¶
type IDParam struct {
String param.Opt[string] `json:",omitzero,inline"`
Int param.Opt[int64] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (IDParam) MarshalJSON ¶
func (*IDParam) UnmarshalJSON ¶
type IncludeAttributesParam ¶
type IncludeAttributesParam struct {
Bool param.Opt[bool] `json:",omitzero,inline"`
StringArray []string `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (IncludeAttributesParam) MarshalJSON ¶
func (u IncludeAttributesParam) MarshalJSON() ([]byte, error)
func (*IncludeAttributesParam) UnmarshalJSON ¶
func (u *IncludeAttributesParam) UnmarshalJSON(data []byte) error
type Language ¶
type Language string
Describes the language of a text attribute. Defaults to `english`.
const ( LanguageArabic Language = "arabic" LanguageDanish Language = "danish" LanguageDutch Language = "dutch" LanguageEnglish Language = "english" LanguageFinnish Language = "finnish" LanguageFrench Language = "french" LanguageGerman Language = "german" LanguageGreek Language = "greek" LanguageHungarian Language = "hungarian" LanguageItalian Language = "italian" LanguageNorwegian Language = "norwegian" LanguagePortuguese Language = "portuguese" LanguageRomanian Language = "romanian" LanguageRussian Language = "russian" LanguageSpanish Language = "spanish" LanguageSwedish Language = "swedish" LanguageTamil Language = "tamil" LanguageTurkish Language = "turkish" )
type LimitParam ¶ added in v1.12.0
type LimitParam struct {
// Limits the total number of documents returned.
Total int64 `json:"total" api:"required"`
// Limits the number of documents with the same value for a set of attributes (the
// "limit key") that can appear in the results.
Per LimitPerParam `json:"per,omitzero"`
// contains filtered or unexported fields
}
Limits the documents returned by a query.
The property Total is required.
func (LimitParam) MarshalJSON ¶ added in v1.12.0
func (r LimitParam) MarshalJSON() (data []byte, err error)
func (*LimitParam) UnmarshalJSON ¶ added in v1.12.0
func (r *LimitParam) UnmarshalJSON(data []byte) error
type LimitPerParam ¶ added in v1.12.0
type LimitPerParam struct {
// The attributes to include in the limit key.
Attributes []string `json:"attributes,omitzero" api:"required"`
// The maximum number of documents to return for each value of the limit key.
Limit int64 `json:"limit" api:"required"`
// contains filtered or unexported fields
}
Limits the number of documents with the same value for a set of attributes (the "limit key") that can appear in the results.
The properties Attributes, Limit are required.
func (LimitPerParam) MarshalJSON ¶ added in v1.12.0
func (r LimitPerParam) MarshalJSON() (data []byte, err error)
func (*LimitPerParam) UnmarshalJSON ¶ added in v1.12.0
func (r *LimitPerParam) UnmarshalJSON(data []byte) error
type NamespaceDeleteAllResponse ¶
type NamespaceDeleteAllResponse struct {
// The status of the request.
Status constant.Ok `json:"status" default:"OK"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The response to a successful namespace deletion request.
func (NamespaceDeleteAllResponse) RawJSON ¶
func (r NamespaceDeleteAllResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceDeleteAllResponse) UnmarshalJSON ¶
func (r *NamespaceDeleteAllResponse) UnmarshalJSON(data []byte) error
type NamespaceExplainQueryParams ¶ added in v0.1.14
type NamespaceExplainQueryParams struct {
Namespace param.Opt[string] `path:"namespace,omitzero" api:"required" json:"-"`
// The number of results to return.
TopK param.Opt[int64] `json:"top_k,omitzero"`
// Aggregations to compute over all documents in the namespace that match the
// filters.
AggregateBy map[string]AggregateBy `json:"aggregate_by,omitzero"`
// The consistency level for a query.
Consistency NamespaceExplainQueryParamsConsistency `json:"consistency,omitzero"`
// A function used to calculate vector similarity.
//
// Any of "cosine_distance", "euclidean_squared".
DistanceMetric DistanceMetric `json:"distance_metric,omitzero"`
// List of attribute names to exclude from the response. All other attributes will
// be included in the response.
ExcludeAttributes []string `json:"exclude_attributes,omitzero"`
// Exact filters for attributes to refine search results for. Think of it as a SQL
// WHERE clause.
Filters Filter `json:"filters,omitzero"`
// Groups documents by the specified attributes (the "group key") before computing
// aggregates. Aggregates are computed separately for each group.
GroupBy []string `json:"group_by,omitzero"`
// Whether to include attributes in the response.
IncludeAttributes IncludeAttributesParam `json:"include_attributes,omitzero"`
// Limits the documents returned by a query.
Limit LimitParam `json:"limit,omitzero"`
// How to rank the documents in the namespace.
RankBy RankBy `json:"rank_by,omitzero"`
// The encoding to use for vectors in the response.
//
// Any of "float", "base64".
VectorEncoding VectorEncoding `json:"vector_encoding,omitzero"`
// contains filtered or unexported fields
}
func (NamespaceExplainQueryParams) MarshalJSON ¶ added in v0.1.14
func (r NamespaceExplainQueryParams) MarshalJSON() (data []byte, err error)
func (*NamespaceExplainQueryParams) UnmarshalJSON ¶ added in v0.1.14
func (r *NamespaceExplainQueryParams) UnmarshalJSON(data []byte) error
type NamespaceExplainQueryParamsConsistency ¶ added in v0.1.14
type NamespaceExplainQueryParamsConsistency struct {
// The query's consistency level.
//
// Any of "strong", "eventual".
Level NamespaceExplainQueryParamsConsistencyLevel `json:"level,omitzero"`
// contains filtered or unexported fields
}
The consistency level for a query.
func (NamespaceExplainQueryParamsConsistency) MarshalJSON ¶ added in v0.1.14
func (r NamespaceExplainQueryParamsConsistency) MarshalJSON() (data []byte, err error)
func (*NamespaceExplainQueryParamsConsistency) UnmarshalJSON ¶ added in v0.1.14
func (r *NamespaceExplainQueryParamsConsistency) UnmarshalJSON(data []byte) error
type NamespaceExplainQueryParamsConsistencyLevel ¶ added in v0.1.14
type NamespaceExplainQueryParamsConsistencyLevel string
The query's consistency level.
const ( NamespaceExplainQueryParamsConsistencyLevelStrong NamespaceExplainQueryParamsConsistencyLevel = "strong" NamespaceExplainQueryParamsConsistencyLevelEventual NamespaceExplainQueryParamsConsistencyLevel = "eventual" )
type NamespaceExplainQueryResponse ¶ added in v0.1.14
type NamespaceExplainQueryResponse struct {
// The textual representation of the query plan.
PlanText string `json:"plan_text"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PlanText respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The response to a successful query explain.
func (NamespaceExplainQueryResponse) RawJSON ¶ added in v0.1.14
func (r NamespaceExplainQueryResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceExplainQueryResponse) UnmarshalJSON ¶ added in v0.1.14
func (r *NamespaceExplainQueryResponse) UnmarshalJSON(data []byte) error
type NamespaceHintCacheWarmResponse ¶
type NamespaceHintCacheWarmResponse struct {
// The status of the request.
Status constant.Accepted `json:"status" default:"ACCEPTED"`
Message string `json:"message"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The response to a successful cache warm request.
func (NamespaceHintCacheWarmResponse) RawJSON ¶
func (r NamespaceHintCacheWarmResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceHintCacheWarmResponse) UnmarshalJSON ¶
func (r *NamespaceHintCacheWarmResponse) UnmarshalJSON(data []byte) error
type NamespaceMetadata ¶ added in v0.1.7
type NamespaceMetadata struct {
// The approximate number of logical bytes in the namespace.
ApproxLogicalBytes int64 `json:"approx_logical_bytes" api:"required"`
// The approximate number of rows in the namespace.
ApproxRowCount int64 `json:"approx_row_count" api:"required"`
// The timestamp when the namespace was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Indicates that the namespace is encrypted with a customer-managed encryption key
// (CMEK).
Encryption NamespaceMetadataEncryption `json:"encryption" api:"required"`
Index NamespaceMetadataIndex `json:"index" api:"required"`
// The schema of the namespace.
Schema map[string]AttributeSchemaConfig `json:"schema" api:"required"`
// The timestamp when the namespace was last modified by a write operation.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Configuration for namespace pinning, along with the current status of the pinned
// namespace.
Pinning NamespaceMetadataPinning `json:"pinning"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ApproxLogicalBytes respjson.Field
ApproxRowCount respjson.Field
CreatedAt respjson.Field
Encryption respjson.Field
Index respjson.Field
Schema respjson.Field
UpdatedAt respjson.Field
Pinning respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Metadata about a namespace.
func (NamespaceMetadata) RawJSON ¶ added in v0.1.7
func (r NamespaceMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMetadata) UnmarshalJSON ¶ added in v0.1.7
func (r *NamespaceMetadata) UnmarshalJSON(data []byte) error
type NamespaceMetadataEncryption ¶ added in v1.5.0
type NamespaceMetadataEncryption struct {
// This field is from variant [NamespaceMetadataEncryptionSse].
Sse bool `json:"sse"`
// This field is from variant [NamespaceMetadataEncryptionCmek].
Cmek NamespaceMetadataEncryptionCmekCmek `json:"cmek"`
JSON struct {
Sse respjson.Field
Cmek respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
NamespaceMetadataEncryption contains all possible properties and values from NamespaceMetadataEncryptionSse, NamespaceMetadataEncryptionCmek.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (NamespaceMetadataEncryption) AsNamespaceMetadataEncryptionCmek ¶ added in v1.5.0
func (u NamespaceMetadataEncryption) AsNamespaceMetadataEncryptionCmek() (v NamespaceMetadataEncryptionCmek)
func (NamespaceMetadataEncryption) AsNamespaceMetadataEncryptionSse ¶ added in v1.6.0
func (u NamespaceMetadataEncryption) AsNamespaceMetadataEncryptionSse() (v NamespaceMetadataEncryptionSse)
func (NamespaceMetadataEncryption) RawJSON ¶ added in v1.5.0
func (u NamespaceMetadataEncryption) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMetadataEncryption) UnmarshalJSON ¶ added in v1.5.0
func (r *NamespaceMetadataEncryption) UnmarshalJSON(data []byte) error
type NamespaceMetadataEncryptionCmek ¶ added in v1.5.0
type NamespaceMetadataEncryptionCmek struct {
Cmek NamespaceMetadataEncryptionCmekCmek `json:"cmek" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Cmek respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Indicates that the namespace is encrypted with a customer-managed encryption key (CMEK).
func (NamespaceMetadataEncryptionCmek) RawJSON ¶ added in v1.5.0
func (r NamespaceMetadataEncryptionCmek) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMetadataEncryptionCmek) UnmarshalJSON ¶ added in v1.5.0
func (r *NamespaceMetadataEncryptionCmek) UnmarshalJSON(data []byte) error
type NamespaceMetadataEncryptionCmekCmek ¶ added in v1.5.0
type NamespaceMetadataEncryptionCmekCmek struct {
// The name of the CMEK key in use.
KeyName string `json:"key_name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
KeyName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NamespaceMetadataEncryptionCmekCmek) RawJSON ¶ added in v1.5.0
func (r NamespaceMetadataEncryptionCmekCmek) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMetadataEncryptionCmekCmek) UnmarshalJSON ¶ added in v1.5.0
func (r *NamespaceMetadataEncryptionCmekCmek) UnmarshalJSON(data []byte) error
type NamespaceMetadataEncryptionSse ¶ added in v1.6.0
type NamespaceMetadataEncryptionSse struct {
// Always true. Indicates that the namespace is encrypted with SSE.
Sse bool `json:"sse" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Sse respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NamespaceMetadataEncryptionSse) RawJSON ¶ added in v1.6.0
func (r NamespaceMetadataEncryptionSse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMetadataEncryptionSse) UnmarshalJSON ¶ added in v1.6.0
func (r *NamespaceMetadataEncryptionSse) UnmarshalJSON(data []byte) error
type NamespaceMetadataIndex ¶ added in v1.5.0
type NamespaceMetadataIndex struct {
Status string `json:"status"`
// This field is from variant [NamespaceMetadataIndexIndexUpdating].
UnindexedBytes int64 `json:"unindexed_bytes"`
JSON struct {
Status respjson.Field
UnindexedBytes respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
NamespaceMetadataIndex contains all possible properties and values from NamespaceMetadataIndexIndexUpToDate, NamespaceMetadataIndexIndexUpdating.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (NamespaceMetadataIndex) AsIndexUpToDate ¶ added in v1.6.0
func (u NamespaceMetadataIndex) AsIndexUpToDate() (v NamespaceMetadataIndexIndexUpToDate)
func (NamespaceMetadataIndex) AsIndexUpdating ¶ added in v1.6.0
func (u NamespaceMetadataIndex) AsIndexUpdating() (v NamespaceMetadataIndexIndexUpdating)
func (NamespaceMetadataIndex) RawJSON ¶ added in v1.5.0
func (u NamespaceMetadataIndex) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMetadataIndex) UnmarshalJSON ¶ added in v1.5.0
func (r *NamespaceMetadataIndex) UnmarshalJSON(data []byte) error
type NamespaceMetadataIndexIndexUpToDate ¶ added in v1.6.0
type NamespaceMetadataIndexIndexUpToDate struct {
Status constant.UpToDate `json:"status" default:"up-to-date"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NamespaceMetadataIndexIndexUpToDate) RawJSON ¶ added in v1.6.0
func (r NamespaceMetadataIndexIndexUpToDate) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMetadataIndexIndexUpToDate) UnmarshalJSON ¶ added in v1.6.0
func (r *NamespaceMetadataIndexIndexUpToDate) UnmarshalJSON(data []byte) error
type NamespaceMetadataIndexIndexUpdating ¶ added in v1.6.0
type NamespaceMetadataIndexIndexUpdating struct {
Status constant.Updating `json:"status" default:"updating"`
// The number of bytes in the namespace that are in the write-ahead log but have
// not yet been indexed.
UnindexedBytes int64 `json:"unindexed_bytes" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
UnindexedBytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NamespaceMetadataIndexIndexUpdating) RawJSON ¶ added in v1.6.0
func (r NamespaceMetadataIndexIndexUpdating) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMetadataIndexIndexUpdating) UnmarshalJSON ¶ added in v1.6.0
func (r *NamespaceMetadataIndexIndexUpdating) UnmarshalJSON(data []byte) error
type NamespaceMetadataParams ¶ added in v0.1.7
type NamespaceMetadataPatchParam ¶ added in v1.21.0
type NamespaceMetadataPatchParam struct {
// Configuration for namespace pinning.
//
// - Missing field: no change to pinning configuration
// - `null` or `false`: explicitly remove pinning
// - `true`: enable pinning with default configuration
// - Object: set pinning configuration
Pinning PinningConfigParam `json:"pinning,omitzero"`
// contains filtered or unexported fields
}
Request to update namespace metadata configuration.
func (NamespaceMetadataPatchParam) MarshalJSON ¶ added in v1.21.0
func (r NamespaceMetadataPatchParam) MarshalJSON() (data []byte, err error)
func (*NamespaceMetadataPatchParam) UnmarshalJSON ¶ added in v1.21.0
func (r *NamespaceMetadataPatchParam) UnmarshalJSON(data []byte) error
type NamespaceMetadataPinning ¶ added in v1.21.0
type NamespaceMetadataPinning struct {
// Operational status for a pinned namespace.
Status NamespaceMetadataPinningStatus `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
PinningConfig
}
Configuration for namespace pinning, along with the current status of the pinned namespace.
func (NamespaceMetadataPinning) RawJSON ¶ added in v1.21.0
func (r NamespaceMetadataPinning) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMetadataPinning) UnmarshalJSON ¶ added in v1.21.0
func (r *NamespaceMetadataPinning) UnmarshalJSON(data []byte) error
type NamespaceMetadataPinningStatus ¶ added in v1.21.0
type NamespaceMetadataPinningStatus struct {
// The number of replicas that are warm and serving traffic.
ReadyReplicas int64 `json:"ready_replicas" api:"required"`
// The timestamp of the latest pinning status snapshot.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Aggregate utilization for the pinned namespace, reported as a value between 0.0
// and 1.0.
Utilization float64 `json:"utilization" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ReadyReplicas respjson.Field
UpdatedAt respjson.Field
Utilization respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Operational status for a pinned namespace.
func (NamespaceMetadataPinningStatus) RawJSON ¶ added in v1.21.0
func (r NamespaceMetadataPinningStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMetadataPinningStatus) UnmarshalJSON ¶ added in v1.21.0
func (r *NamespaceMetadataPinningStatus) UnmarshalJSON(data []byte) error
type NamespaceMultiQueryParams ¶ added in v0.1.1
type NamespaceMultiQueryParams struct {
Namespace param.Opt[string] `path:"namespace,omitzero" api:"required" json:"-"`
Queries []QueryParam `json:"queries,omitzero" api:"required"`
// The consistency level for a query.
Consistency NamespaceMultiQueryParamsConsistency `json:"consistency,omitzero"`
// The encoding to use for vectors in the response.
//
// Any of "float", "base64".
VectorEncoding VectorEncoding `json:"vector_encoding,omitzero"`
// contains filtered or unexported fields
}
func (NamespaceMultiQueryParams) MarshalJSON ¶ added in v0.1.1
func (r NamespaceMultiQueryParams) MarshalJSON() (data []byte, err error)
func (*NamespaceMultiQueryParams) UnmarshalJSON ¶ added in v0.1.1
func (r *NamespaceMultiQueryParams) UnmarshalJSON(data []byte) error
type NamespaceMultiQueryParamsConsistency ¶ added in v0.1.1
type NamespaceMultiQueryParamsConsistency struct {
// The query's consistency level.
//
// Any of "strong", "eventual".
Level NamespaceMultiQueryParamsConsistencyLevel `json:"level,omitzero"`
// contains filtered or unexported fields
}
The consistency level for a query.
func (NamespaceMultiQueryParamsConsistency) MarshalJSON ¶ added in v0.1.1
func (r NamespaceMultiQueryParamsConsistency) MarshalJSON() (data []byte, err error)
func (*NamespaceMultiQueryParamsConsistency) UnmarshalJSON ¶ added in v0.1.1
func (r *NamespaceMultiQueryParamsConsistency) UnmarshalJSON(data []byte) error
type NamespaceMultiQueryParamsConsistencyLevel ¶ added in v0.1.1
type NamespaceMultiQueryParamsConsistencyLevel string
The query's consistency level.
const ( NamespaceMultiQueryParamsConsistencyLevelStrong NamespaceMultiQueryParamsConsistencyLevel = "strong" NamespaceMultiQueryParamsConsistencyLevelEventual NamespaceMultiQueryParamsConsistencyLevel = "eventual" )
type NamespaceMultiQueryResponse ¶ added in v0.1.1
type NamespaceMultiQueryResponse struct {
// The billing information for a query.
Billing QueryBilling `json:"billing" api:"required"`
// The performance information for a query.
Performance QueryPerformance `json:"performance" api:"required"`
Results []NamespaceMultiQueryResponseResult `json:"results" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Billing respjson.Field
Performance respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The result of a multi-query.
func (NamespaceMultiQueryResponse) RawJSON ¶ added in v0.1.1
func (r NamespaceMultiQueryResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMultiQueryResponse) UnmarshalJSON ¶ added in v0.1.1
func (r *NamespaceMultiQueryResponse) UnmarshalJSON(data []byte) error
type NamespaceMultiQueryResponseResult ¶ added in v0.1.1
type NamespaceMultiQueryResponseResult struct {
AggregationGroups []AggregationGroup `json:"aggregation_groups"`
Aggregations map[string]any `json:"aggregations"`
Rows []Row `json:"rows"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AggregationGroups respjson.Field
Aggregations respjson.Field
Rows respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NamespaceMultiQueryResponseResult) RawJSON ¶ added in v0.1.1
func (r NamespaceMultiQueryResponseResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMultiQueryResponseResult) UnmarshalJSON ¶ added in v0.1.1
func (r *NamespaceMultiQueryResponseResult) UnmarshalJSON(data []byte) error
type NamespaceQueryParams ¶
type NamespaceQueryParams struct {
Namespace param.Opt[string] `path:"namespace,omitzero" api:"required" json:"-"`
// The number of results to return.
TopK param.Opt[int64] `json:"top_k,omitzero"`
// Aggregations to compute over all documents in the namespace that match the
// filters.
AggregateBy map[string]AggregateBy `json:"aggregate_by,omitzero"`
// The consistency level for a query.
Consistency NamespaceQueryParamsConsistency `json:"consistency,omitzero"`
// A function used to calculate vector similarity.
//
// Any of "cosine_distance", "euclidean_squared".
DistanceMetric DistanceMetric `json:"distance_metric,omitzero"`
// List of attribute names to exclude from the response. All other attributes will
// be included in the response.
ExcludeAttributes []string `json:"exclude_attributes,omitzero"`
// Exact filters for attributes to refine search results for. Think of it as a SQL
// WHERE clause.
Filters Filter `json:"filters,omitzero"`
// Groups documents by the specified attributes (the "group key") before computing
// aggregates. Aggregates are computed separately for each group.
GroupBy []string `json:"group_by,omitzero"`
// Whether to include attributes in the response.
IncludeAttributes IncludeAttributesParam `json:"include_attributes,omitzero"`
// Limits the documents returned by a query.
Limit LimitParam `json:"limit,omitzero"`
// How to rank the documents in the namespace.
RankBy RankBy `json:"rank_by,omitzero"`
// The encoding to use for vectors in the response.
//
// Any of "float", "base64".
VectorEncoding VectorEncoding `json:"vector_encoding,omitzero"`
// contains filtered or unexported fields
}
func (NamespaceQueryParams) MarshalJSON ¶
func (r NamespaceQueryParams) MarshalJSON() (data []byte, err error)
func (*NamespaceQueryParams) UnmarshalJSON ¶
func (r *NamespaceQueryParams) UnmarshalJSON(data []byte) error
type NamespaceQueryParamsConsistency ¶
type NamespaceQueryParamsConsistency struct {
// The query's consistency level.
//
// Any of "strong", "eventual".
Level NamespaceQueryParamsConsistencyLevel `json:"level,omitzero"`
// contains filtered or unexported fields
}
The consistency level for a query.
func (NamespaceQueryParamsConsistency) MarshalJSON ¶
func (r NamespaceQueryParamsConsistency) MarshalJSON() (data []byte, err error)
func (*NamespaceQueryParamsConsistency) UnmarshalJSON ¶
func (r *NamespaceQueryParamsConsistency) UnmarshalJSON(data []byte) error
type NamespaceQueryParamsConsistencyLevel ¶
type NamespaceQueryParamsConsistencyLevel string
The query's consistency level.
const ( NamespaceQueryParamsConsistencyLevelStrong NamespaceQueryParamsConsistencyLevel = "strong" NamespaceQueryParamsConsistencyLevelEventual NamespaceQueryParamsConsistencyLevel = "eventual" )
type NamespaceQueryResponse ¶
type NamespaceQueryResponse struct {
// The billing information for a query.
Billing QueryBilling `json:"billing" api:"required"`
// The performance information for a query.
Performance QueryPerformance `json:"performance" api:"required"`
AggregationGroups []AggregationGroup `json:"aggregation_groups"`
Aggregations map[string]any `json:"aggregations"`
Rows []Row `json:"rows"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Billing respjson.Field
Performance respjson.Field
AggregationGroups respjson.Field
Aggregations respjson.Field
Rows respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The result of a query.
func (NamespaceQueryResponse) RawJSON ¶
func (r NamespaceQueryResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceQueryResponse) UnmarshalJSON ¶
func (r *NamespaceQueryResponse) UnmarshalJSON(data []byte) error
type NamespaceRecallParams ¶
type NamespaceRecallParams struct {
Namespace param.Opt[string] `path:"namespace,omitzero" api:"required" json:"-"`
// Include ground truth data (query vectors and true nearest neighbors) in the
// response.
IncludeGroundTruth param.Opt[bool] `json:"include_ground_truth,omitzero"`
// The number of searches to run.
Num param.Opt[int64] `json:"num,omitzero"`
// Search for `top_k` nearest neighbors.
TopK param.Opt[int64] `json:"top_k,omitzero"`
// Filter by attributes. Same syntax as the query endpoint.
Filters any `json:"filters,omitzero"`
// The ranking function to evaluate recall for. If provided, `num` must be either
// null or 1.
RankBy any `json:"rank_by,omitzero"`
// contains filtered or unexported fields
}
func (NamespaceRecallParams) MarshalJSON ¶
func (r NamespaceRecallParams) MarshalJSON() (data []byte, err error)
func (*NamespaceRecallParams) UnmarshalJSON ¶
func (r *NamespaceRecallParams) UnmarshalJSON(data []byte) error
type NamespaceRecallResponse ¶
type NamespaceRecallResponse struct {
// The average number of documents retrieved by the approximate nearest neighbor
// searches.
AvgAnnCount float64 `json:"avg_ann_count" api:"required"`
// The average number of documents retrieved by the exhaustive searches.
AvgExhaustiveCount float64 `json:"avg_exhaustive_count" api:"required"`
// The average recall of the queries.
AvgRecall float64 `json:"avg_recall" api:"required"`
// Ground truth data including query vectors and true nearest neighbors. Only
// included when include_ground_truth is true.
GroundTruth []NamespaceRecallResponseGroundTruth `json:"ground_truth"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AvgAnnCount respjson.Field
AvgExhaustiveCount respjson.Field
AvgRecall respjson.Field
GroundTruth respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The response to a successful cache warm request.
func (NamespaceRecallResponse) RawJSON ¶
func (r NamespaceRecallResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceRecallResponse) UnmarshalJSON ¶
func (r *NamespaceRecallResponse) UnmarshalJSON(data []byte) error
type NamespaceRecallResponseGroundTruth ¶ added in v1.1.0
type NamespaceRecallResponseGroundTruth struct {
// The true nearest neighbors with their distances and vectors.
NearestNeighbors []Row `json:"nearest_neighbors" api:"required"`
// The query vector used for this search.
QueryVector []float64 `json:"query_vector" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
NearestNeighbors respjson.Field
QueryVector respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NamespaceRecallResponseGroundTruth) RawJSON ¶ added in v1.1.0
func (r NamespaceRecallResponseGroundTruth) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceRecallResponseGroundTruth) UnmarshalJSON ¶ added in v1.1.0
func (r *NamespaceRecallResponseGroundTruth) UnmarshalJSON(data []byte) error
type NamespaceSchemaParams ¶
type NamespaceSchemaResponse ¶
type NamespaceSchemaResponse map[string]AttributeSchemaConfig
type NamespaceService ¶
type NamespaceService struct {
Options []option.RequestOption
}
NamespaceService contains methods and other services that help with interacting with the turbopuffer API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the [NewNamespaceService] method instead.
func (*NamespaceService) DeleteAll ¶
func (r *NamespaceService) DeleteAll(ctx context.Context, body NamespaceDeleteAllParams, opts ...option.RequestOption) (res *NamespaceDeleteAllResponse, err error)
Delete namespace.
func (*NamespaceService) ExplainQuery ¶ added in v0.1.14
func (r *NamespaceService) ExplainQuery(ctx context.Context, params NamespaceExplainQueryParams, opts ...option.RequestOption) (res *NamespaceExplainQueryResponse, err error)
Explain a query plan.
func (*NamespaceService) HintCacheWarm ¶
func (r *NamespaceService) HintCacheWarm(ctx context.Context, query NamespaceHintCacheWarmParams, opts ...option.RequestOption) (res *NamespaceHintCacheWarmResponse, err error)
Signal turbopuffer to prepare for low-latency requests.
func (*NamespaceService) ID ¶
func (r *NamespaceService) ID() string
func (*NamespaceService) Metadata ¶ added in v0.1.7
func (r *NamespaceService) Metadata(ctx context.Context, query NamespaceMetadataParams, opts ...option.RequestOption) (res *NamespaceMetadata, err error)
Get metadata about a namespace.
func (*NamespaceService) MultiQuery ¶ added in v0.1.1
func (r *NamespaceService) MultiQuery(ctx context.Context, params NamespaceMultiQueryParams, opts ...option.RequestOption) (res *NamespaceMultiQueryResponse, err error)
Issue multiple concurrent queries filter or search documents.
func (*NamespaceService) Query ¶
func (r *NamespaceService) Query(ctx context.Context, params NamespaceQueryParams, opts ...option.RequestOption) (res *NamespaceQueryResponse, err error)
Query, filter, full-text search and vector search documents.
func (*NamespaceService) Recall ¶
func (r *NamespaceService) Recall(ctx context.Context, params NamespaceRecallParams, opts ...option.RequestOption) (res *NamespaceRecallResponse, err error)
Evaluate recall.
func (*NamespaceService) Schema ¶
func (r *NamespaceService) Schema(ctx context.Context, query NamespaceSchemaParams, opts ...option.RequestOption) (res *NamespaceSchemaResponse, err error)
Get namespace schema.
func (*NamespaceService) UpdateMetadata ¶ added in v1.21.0
func (r *NamespaceService) UpdateMetadata(ctx context.Context, params NamespaceUpdateMetadataParams, opts ...option.RequestOption) (res *NamespaceMetadata, err error)
Update metadata configuration for a namespace.
func (*NamespaceService) UpdateSchema ¶
func (r *NamespaceService) UpdateSchema(ctx context.Context, params NamespaceUpdateSchemaParams, opts ...option.RequestOption) (res *NamespaceUpdateSchemaResponse, err error)
Update namespace schema.
func (*NamespaceService) Write ¶
func (r *NamespaceService) Write(ctx context.Context, params NamespaceWriteParams, opts ...option.RequestOption) (res *NamespaceWriteResponse, err error)
Create, update, or delete documents.
type NamespaceSummary ¶
type NamespaceSummary struct {
// The namespace ID.
ID string `json:"id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A summary of a namespace.
func (NamespaceSummary) RawJSON ¶
func (r NamespaceSummary) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceSummary) UnmarshalJSON ¶
func (r *NamespaceSummary) UnmarshalJSON(data []byte) error
type NamespaceUpdateMetadataParams ¶ added in v1.21.0
type NamespaceUpdateMetadataParams struct {
Namespace param.Opt[string] `path:"namespace,omitzero" api:"required" json:"-"`
// Request to update namespace metadata configuration.
NamespaceMetadataPatch NamespaceMetadataPatchParam
// contains filtered or unexported fields
}
func (NamespaceUpdateMetadataParams) MarshalJSON ¶ added in v1.21.0
func (r NamespaceUpdateMetadataParams) MarshalJSON() (data []byte, err error)
func (*NamespaceUpdateMetadataParams) UnmarshalJSON ¶ added in v1.21.0
func (r *NamespaceUpdateMetadataParams) UnmarshalJSON(data []byte) error
type NamespaceUpdateSchemaParams ¶
type NamespaceUpdateSchemaParams struct {
Namespace param.Opt[string] `path:"namespace,omitzero" api:"required" json:"-"`
// The desired schema for the namespace.
Schema map[string]AttributeSchemaConfigParam
// contains filtered or unexported fields
}
func (NamespaceUpdateSchemaParams) MarshalJSON ¶
func (r NamespaceUpdateSchemaParams) MarshalJSON() (data []byte, err error)
func (*NamespaceUpdateSchemaParams) UnmarshalJSON ¶
func (r *NamespaceUpdateSchemaParams) UnmarshalJSON(data []byte) error
type NamespaceUpdateSchemaResponse ¶
type NamespaceUpdateSchemaResponse map[string]AttributeSchemaConfig
type NamespaceWriteParams ¶
type NamespaceWriteParams struct {
Namespace param.Opt[string] `path:"namespace,omitzero" api:"required" json:"-"`
// Allow partial completion when filter matches too many documents.
DeleteByFilterAllowPartial param.Opt[bool] `json:"delete_by_filter_allow_partial,omitzero"`
// Disables write throttling (HTTP 429 responses) during high-volume ingestion.
DisableBackpressure param.Opt[bool] `json:"disable_backpressure,omitzero"`
// Allow partial completion when filter matches too many documents.
PatchByFilterAllowPartial param.Opt[bool] `json:"patch_by_filter_allow_partial,omitzero"`
// If true, return the IDs of affected rows (deleted, patched, upserted) in the
// response. For filtered and conditional writes, only IDs for writes that
// succeeded will be included.
ReturnAffectedIDs param.Opt[bool] `json:"return_affected_ids,omitzero"`
BranchFromNamespace BranchFromNamespaceParams `json:"branch_from_namespace,omitzero"`
CopyFromNamespace CopyFromNamespaceParams `json:"copy_from_namespace,omitzero"`
// The filter specifying which documents to delete.
DeleteByFilter Filter `json:"delete_by_filter,omitzero"`
// A condition evaluated against the current value of each document targeted by a
// delete write. Only documents that pass the condition are deleted.
DeleteCondition Filter `json:"delete_condition,omitzero"`
Deletes []any `json:"deletes,omitzero"`
// A function used to calculate vector similarity.
//
// Any of "cosine_distance", "euclidean_squared".
DistanceMetric DistanceMetric `json:"distance_metric,omitzero"`
// The encryption configuration for a namespace.
Encryption NamespaceWriteParamsEncryption `json:"encryption,omitzero"`
// The patch and filter specifying which documents to patch.
PatchByFilter NamespaceWriteParamsPatchByFilter `json:"patch_by_filter,omitzero"`
// A list of documents in columnar format. Each key is a column name, mapped to an
// array of values for that column.
PatchColumns ColumnsParam `json:"patch_columns,omitzero"`
// A condition evaluated against the current value of each document targeted by a
// patch write. Only documents that pass the condition are patched.
PatchCondition Filter `json:"patch_condition,omitzero"`
PatchRows []RowParam `json:"patch_rows,omitzero"`
// The schema of the attributes attached to the documents.
Schema map[string]AttributeSchemaConfigParam `json:"schema,omitzero"`
// A list of documents in columnar format. Each key is a column name, mapped to an
// array of values for that column.
UpsertColumns ColumnsParam `json:"upsert_columns,omitzero"`
// A condition evaluated against the current value of each document targeted by an
// upsert write. Only documents that pass the condition are upserted.
UpsertCondition Filter `json:"upsert_condition,omitzero"`
UpsertRows []RowParam `json:"upsert_rows,omitzero"`
// contains filtered or unexported fields
}
func (NamespaceWriteParams) MarshalJSON ¶
func (r NamespaceWriteParams) MarshalJSON() (data []byte, err error)
func (*NamespaceWriteParams) UnmarshalJSON ¶
func (r *NamespaceWriteParams) UnmarshalJSON(data []byte) error
type NamespaceWriteParamsEncryption ¶
type NamespaceWriteParamsEncryption struct {
Cmek NamespaceWriteParamsEncryptionCmek `json:"cmek,omitzero"`
// contains filtered or unexported fields
}
The encryption configuration for a namespace.
func (NamespaceWriteParamsEncryption) MarshalJSON ¶
func (r NamespaceWriteParamsEncryption) MarshalJSON() (data []byte, err error)
func (*NamespaceWriteParamsEncryption) UnmarshalJSON ¶
func (r *NamespaceWriteParamsEncryption) UnmarshalJSON(data []byte) error
type NamespaceWriteParamsEncryptionCmek ¶
type NamespaceWriteParamsEncryptionCmek struct {
// The identifier of the CMEK key to use for encryption. For GCP, the
// fully-qualified resource name of the key. For AWS, the ARN of the key.
KeyName string `json:"key_name" api:"required"`
// contains filtered or unexported fields
}
The property KeyName is required.
func (NamespaceWriteParamsEncryptionCmek) MarshalJSON ¶
func (r NamespaceWriteParamsEncryptionCmek) MarshalJSON() (data []byte, err error)
func (*NamespaceWriteParamsEncryptionCmek) UnmarshalJSON ¶
func (r *NamespaceWriteParamsEncryptionCmek) UnmarshalJSON(data []byte) error
type NamespaceWriteParamsPatchByFilter ¶ added in v1.5.0
type NamespaceWriteParamsPatchByFilter struct {
// Filter by attributes. Same syntax as the query endpoint.
Filters Filter `json:"filters,omitzero" api:"required"`
Patch map[string]any `json:"patch,omitzero" api:"required"`
// contains filtered or unexported fields
}
The patch and filter specifying which documents to patch.
The properties Filters, Patch are required.
func (NamespaceWriteParamsPatchByFilter) MarshalJSON ¶ added in v1.5.0
func (r NamespaceWriteParamsPatchByFilter) MarshalJSON() (data []byte, err error)
func (*NamespaceWriteParamsPatchByFilter) UnmarshalJSON ¶ added in v1.5.0
func (r *NamespaceWriteParamsPatchByFilter) UnmarshalJSON(data []byte) error
type NamespaceWriteResponse ¶
type NamespaceWriteResponse struct {
// The billing information for a write request.
Billing WriteBilling `json:"billing" api:"required"`
// A message describing the result of the write request.
Message string `json:"message" api:"required"`
// The number of rows affected by the write request.
RowsAffected int64 `json:"rows_affected" api:"required"`
// The status of the request.
Status constant.Ok `json:"status" default:"OK"`
// The IDs of documents that were deleted. Only included when `return_affected_ids`
// is true and at least one document was deleted.
DeletedIDs []ID `json:"deleted_ids" format:"uuid"`
// The IDs of documents that were patched. Only included when `return_affected_ids`
// is true and at least one document was patched.
PatchedIDs []ID `json:"patched_ids" format:"uuid"`
// The performance information for a write request.
Performance WritePerformance `json:"performance"`
// The number of rows deleted by the write request.
RowsDeleted int64 `json:"rows_deleted"`
// The number of rows patched by the write request.
RowsPatched int64 `json:"rows_patched"`
// Whether more documents match the filter for partial operations.
RowsRemaining bool `json:"rows_remaining"`
// The number of rows upserted by the write request.
RowsUpserted int64 `json:"rows_upserted"`
// The IDs of documents that were upserted. Only included when
// `return_affected_ids` is true and at least one document was upserted.
UpsertedIDs []ID `json:"upserted_ids" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Billing respjson.Field
Message respjson.Field
RowsAffected respjson.Field
Status respjson.Field
DeletedIDs respjson.Field
PatchedIDs respjson.Field
Performance respjson.Field
RowsDeleted respjson.Field
RowsPatched respjson.Field
RowsRemaining respjson.Field
RowsUpserted respjson.Field
UpsertedIDs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The response to a successful write request.
func (NamespaceWriteResponse) RawJSON ¶
func (r NamespaceWriteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceWriteResponse) UnmarshalJSON ¶
func (r *NamespaceWriteResponse) UnmarshalJSON(data []byte) error
type NamespacesParams ¶
type NamespacesParams struct {
// Retrieve the next page of results.
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Limit the number of results per page.
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// Retrieve only the namespaces that match the prefix.
Prefix param.Opt[string] `query:"prefix,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (NamespacesParams) URLQuery ¶
func (r NamespacesParams) URLQuery() (v url.Values, err error)
URLQuery serializes NamespacesParams's query parameters as `url.Values`.
type PinningConfig ¶ added in v1.21.0
type PinningConfig struct {
// The number of read replicas to provision. Defaults to 1 if not specified.
Replicas int64 `json:"replicas"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Replicas respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Configuration for namespace pinning.
func (PinningConfig) RawJSON ¶ added in v1.21.0
func (r PinningConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (PinningConfig) ToParam ¶ added in v1.21.0
func (r PinningConfig) ToParam() PinningConfigParam
ToParam converts this PinningConfig to a PinningConfigParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with PinningConfigParam.Overrides()
func (*PinningConfig) UnmarshalJSON ¶ added in v1.21.0
func (r *PinningConfig) UnmarshalJSON(data []byte) error
type PinningConfigParam ¶ added in v1.21.0
type PinningConfigParam struct {
// The number of read replicas to provision. Defaults to 1 if not specified.
Replicas param.Opt[int64] `json:"replicas,omitzero"`
// contains filtered or unexported fields
}
Configuration for namespace pinning.
func (PinningConfigParam) MarshalJSON ¶ added in v1.21.0
func (r PinningConfigParam) MarshalJSON() (data []byte, err error)
func (*PinningConfigParam) UnmarshalJSON ¶ added in v1.21.0
func (r *PinningConfigParam) UnmarshalJSON(data []byte) error
type QueryBilling ¶
type QueryBilling struct {
// The number of billable logical bytes queried from the namespace.
BillableLogicalBytesQueried int64 `json:"billable_logical_bytes_queried" api:"required"`
// The number of billable logical bytes returned from the query.
BillableLogicalBytesReturned int64 `json:"billable_logical_bytes_returned" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BillableLogicalBytesQueried respjson.Field
BillableLogicalBytesReturned respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The billing information for a query.
func (QueryBilling) RawJSON ¶
func (r QueryBilling) RawJSON() string
Returns the unmodified JSON received from the API
func (*QueryBilling) UnmarshalJSON ¶
func (r *QueryBilling) UnmarshalJSON(data []byte) error
type QueryParam ¶ added in v0.1.3
type QueryParam struct {
// The number of results to return.
TopK param.Opt[int64] `json:"top_k,omitzero"`
// Aggregations to compute over all documents in the namespace that match the
// filters.
AggregateBy map[string]AggregateBy `json:"aggregate_by,omitzero"`
// A function used to calculate vector similarity.
//
// Any of "cosine_distance", "euclidean_squared".
DistanceMetric DistanceMetric `json:"distance_metric,omitzero"`
// List of attribute names to exclude from the response. All other attributes will
// be included in the response.
ExcludeAttributes []string `json:"exclude_attributes,omitzero"`
// Exact filters for attributes to refine search results for. Think of it as a SQL
// WHERE clause.
Filters Filter `json:"filters,omitzero"`
// Groups documents by the specified attributes (the "group key") before computing
// aggregates. Aggregates are computed separately for each group.
GroupBy []string `json:"group_by,omitzero"`
// Whether to include attributes in the response.
IncludeAttributes IncludeAttributesParam `json:"include_attributes,omitzero"`
// Limits the documents returned by a query.
Limit LimitParam `json:"limit,omitzero"`
// How to rank the documents in the namespace.
RankBy RankBy `json:"rank_by,omitzero"`
// contains filtered or unexported fields
}
Query, filter, full-text search and vector search documents.
func (QueryParam) MarshalJSON ¶ added in v0.1.3
func (r QueryParam) MarshalJSON() (data []byte, err error)
func (*QueryParam) UnmarshalJSON ¶ added in v0.1.3
func (r *QueryParam) UnmarshalJSON(data []byte) error
type QueryPerformance ¶
type QueryPerformance struct {
// the approximate number of documents in the namespace.
ApproxNamespaceSize int64 `json:"approx_namespace_size" api:"required"`
// The ratio of cache hits to total cache lookups.
CacheHitRatio float64 `json:"cache_hit_ratio" api:"required"`
// A qualitative description of the cache hit ratio (`hot`, `warm`, or `cold`).
CacheTemperature string `json:"cache_temperature" api:"required"`
// The number of unindexed documents processed by the query.
ExhaustiveSearchCount int64 `json:"exhaustive_search_count" api:"required"`
// Request time measured on the server, excluding time spent waiting due to the
// namespace concurrency limit.
QueryExecutionMs int64 `json:"query_execution_ms" api:"required"`
// Request time measured on the server, including time spent waiting for other
// queries to complete if the namespace was at its concurrency limit.
ServerTotalMs int64 `json:"server_total_ms" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ApproxNamespaceSize respjson.Field
CacheHitRatio respjson.Field
CacheTemperature respjson.Field
ExhaustiveSearchCount respjson.Field
QueryExecutionMs respjson.Field
ServerTotalMs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The performance information for a query.
func (QueryPerformance) RawJSON ¶
func (r QueryPerformance) RawJSON() string
Returns the unmodified JSON received from the API
func (*QueryPerformance) UnmarshalJSON ¶
func (r *QueryPerformance) UnmarshalJSON(data []byte) error
type RankByAttribute ¶
type RankByAttribute struct {
// contains filtered or unexported fields
}
func NewRankByAttribute ¶
func NewRankByAttribute( attr string, order RankByAttributeOrder, ) RankByAttribute
func (RankByAttribute) MarshalJSON ¶
func (v RankByAttribute) MarshalJSON() ([]byte, error)
type RankByAttributeOrder ¶
type RankByAttributeOrder string
const ( RankByAttributeOrderAsc RankByAttributeOrder = "asc" RankByAttributeOrderDesc RankByAttributeOrder = "desc" )
type RankByAttributes ¶ added in v1.9.2
type RankByAttributes []RankByAttribute
type RankByKnn ¶ added in v1.10.0
type RankByKnn struct {
// contains filtered or unexported fields
}
func NewRankByKnn ¶ added in v1.10.0
func (RankByKnn) MarshalJSON ¶ added in v1.10.0
type RankByText ¶
type RankByText interface {
// contains filtered or unexported methods
}
type RankByTextAttribute ¶ added in v1.14.0
type RankByTextAttribute struct {
// contains filtered or unexported fields
}
func NewRankByTextAttribute ¶ added in v1.14.0
func NewRankByTextAttribute( attr string, ) RankByTextAttribute
func (RankByTextAttribute) MarshalJSON ¶ added in v1.14.0
func (v RankByTextAttribute) MarshalJSON() ([]byte, error)
type RankByTextBM25 ¶
type RankByTextBM25 struct {
// contains filtered or unexported fields
}
func NewRankByTextBM25 ¶
func NewRankByTextBM25( attr string, value string, ) RankByTextBM25
func (RankByTextBM25) MarshalJSON ¶
func (v RankByTextBM25) MarshalJSON() ([]byte, error)
type RankByTextBM25Array ¶
type RankByTextBM25Array struct {
// contains filtered or unexported fields
}
func NewRankByTextBM25Array ¶
func NewRankByTextBM25Array( attr string, value []string, ) RankByTextBM25Array
func (RankByTextBM25Array) MarshalJSON ¶
func (v RankByTextBM25Array) MarshalJSON() ([]byte, error)
type RankByTextBM25ArrayWithParams ¶ added in v1.2.0
type RankByTextBM25ArrayWithParams struct {
// contains filtered or unexported fields
}
func NewRankByTextBM25ArrayWithParams ¶ added in v1.2.0
func NewRankByTextBM25ArrayWithParams( attr string, value []string, params Bm25ClauseParams, ) RankByTextBM25ArrayWithParams
func (RankByTextBM25ArrayWithParams) MarshalJSON ¶ added in v1.2.0
func (v RankByTextBM25ArrayWithParams) MarshalJSON() ([]byte, error)
type RankByTextBM25WithParams ¶ added in v1.2.0
type RankByTextBM25WithParams struct {
// contains filtered or unexported fields
}
func NewRankByTextBM25WithParams ¶ added in v1.2.0
func NewRankByTextBM25WithParams( attr string, value string, params Bm25ClauseParams, ) RankByTextBM25WithParams
func (RankByTextBM25WithParams) MarshalJSON ¶ added in v1.2.0
func (v RankByTextBM25WithParams) MarshalJSON() ([]byte, error)
type RankByTextDecay ¶ added in v1.14.0
type RankByTextDecay struct {
// contains filtered or unexported fields
}
func NewRankByTextDecay ¶ added in v1.14.0
func NewRankByTextDecay( subquery RankByText, params DecayParams, ) RankByTextDecay
func (RankByTextDecay) MarshalJSON ¶ added in v1.14.0
func (v RankByTextDecay) MarshalJSON() ([]byte, error)
type RankByTextDist ¶ added in v1.14.0
type RankByTextDist struct {
// contains filtered or unexported fields
}
func NewRankByTextDist ¶ added in v1.14.0
func NewRankByTextDist( subquery RankByText, origin any, ) RankByTextDist
func (RankByTextDist) MarshalJSON ¶ added in v1.14.0
func (v RankByTextDist) MarshalJSON() ([]byte, error)
type RankByTextMax ¶
type RankByTextMax struct {
// contains filtered or unexported fields
}
func NewRankByTextMax ¶
func NewRankByTextMax( subqueries []RankByText, ) RankByTextMax
func (RankByTextMax) MarshalJSON ¶
func (v RankByTextMax) MarshalJSON() ([]byte, error)
type RankByTextProduct ¶
type RankByTextProduct struct {
// contains filtered or unexported fields
}
func NewRankByTextProduct ¶
func NewRankByTextProduct( weight float64, subquery RankByText, ) RankByTextProduct
func (RankByTextProduct) MarshalJSON ¶
func (v RankByTextProduct) MarshalJSON() ([]byte, error)
type RankByTextSaturate ¶ added in v1.14.0
type RankByTextSaturate struct {
// contains filtered or unexported fields
}
func NewRankByTextSaturate ¶ added in v1.14.0
func NewRankByTextSaturate( subquery RankByText, params SaturateParams, ) RankByTextSaturate
func (RankByTextSaturate) MarshalJSON ¶ added in v1.14.0
func (v RankByTextSaturate) MarshalJSON() ([]byte, error)
type RankByTextSum ¶
type RankByTextSum struct {
// contains filtered or unexported fields
}
func NewRankByTextSum ¶
func NewRankByTextSum( subqueries []RankByText, ) RankByTextSum
func (RankByTextSum) MarshalJSON ¶
func (v RankByTextSum) MarshalJSON() ([]byte, error)
type RankByVector ¶
type RankByVector struct {
// contains filtered or unexported fields
}
func NewRankByVector ¶
func NewRankByVector( attr string, value []float32, ) RankByVector
func (RankByVector) MarshalJSON ¶
func (v RankByVector) MarshalJSON() ([]byte, error)
type SaturateParams ¶ added in v1.14.0
type SaturateParams struct {
// An exponent that helps further control the shape of the Saturate function.
Exponent param.Opt[float64] `json:"exponent,omitzero"`
// The midpoint of the Saturate operator.
Midpoint any `json:"midpoint,omitzero"`
// contains filtered or unexported fields
}
Additional parameters for the Saturate operator.
func (SaturateParams) MarshalJSON ¶ added in v1.14.0
func (r SaturateParams) MarshalJSON() (data []byte, err error)
func (*SaturateParams) UnmarshalJSON ¶ added in v1.14.0
func (r *SaturateParams) UnmarshalJSON(data []byte) error
type Tokenizer ¶
type Tokenizer string
The tokenizer to use for full-text search on an attribute. Defaults to `word_v3`.
type Vector ¶
type Vector struct {
// This field will be present if the value is a [[]float32] instead of an object.
FloatArray []float32 `json:",inline"`
// This field will be present if the value is a [string] instead of an object.
String string `json:",inline"`
JSON struct {
FloatArray respjson.Field
String respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Vector contains all possible properties and values from [[]float32], [string].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: FloatArray String]
func (Vector) AsFloatArray ¶
func (Vector) ToParam ¶
func (r Vector) ToParam() VectorParam
ToParam converts this Vector to a VectorParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with VectorParam.Overrides()
func (*Vector) UnmarshalJSON ¶
type VectorEncoding ¶
type VectorEncoding string
The encoding to use for vectors in the response.
const ( VectorEncodingFloat VectorEncoding = "float" VectorEncodingBase64 VectorEncoding = "base64" )
type VectorParam ¶
type VectorParam struct {
FloatArray []float32 `json:",omitzero,inline"`
String param.Opt[string] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (VectorParam) MarshalJSON ¶
func (u VectorParam) MarshalJSON() ([]byte, error)
func (*VectorParam) UnmarshalJSON ¶
func (u *VectorParam) UnmarshalJSON(data []byte) error
type WriteBilling ¶
type WriteBilling struct {
// The number of billable logical bytes written to the namespace.
BillableLogicalBytesWritten int64 `json:"billable_logical_bytes_written" api:"required"`
// The billing information for a query.
Query QueryBilling `json:"query"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BillableLogicalBytesWritten respjson.Field
Query respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The billing information for a write request.
func (WriteBilling) RawJSON ¶
func (r WriteBilling) RawJSON() string
Returns the unmodified JSON received from the API
func (*WriteBilling) UnmarshalJSON ¶
func (r *WriteBilling) UnmarshalJSON(data []byte) error
type WritePerformance ¶ added in v1.19.0
type WritePerformance struct {
// Request time measured on the server, in milliseconds.
ServerTotalMs int64 `json:"server_total_ms" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ServerTotalMs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The performance information for a write request.
func (WritePerformance) RawJSON ¶ added in v1.19.0
func (r WritePerformance) RawJSON() string
Returns the unmodified JSON received from the API
func (*WritePerformance) UnmarshalJSON ¶ added in v1.19.0
func (r *WritePerformance) UnmarshalJSON(data []byte) error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
bulk_write
command
|
|
|
list_namespaces
command
|
|
|
write_and_query
command
|
|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|