onyx

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

package onyx exposes the public SDK surface for the Go client. It re-exports the stable contract types and functions while wiring the runtime implementation under the hood.

Index

Constants

View Source
const (
	WireFormatJSON        = contract.WireFormatJSON
	WireFormatMessagePack = contract.WireFormatMessagePack

	HNSWQueryFormatVersion            = contract.HNSWQueryFormatVersion
	DefaultHNSWCandidates             = contract.DefaultHNSWCandidates
	DefaultHNSWEFSearch               = contract.DefaultHNSWEFSearch
	MaxHNSWCandidates                 = contract.MaxHNSWCandidates
	MaxHNSWEFSearch                   = contract.MaxHNSWEFSearch
	MaxHNSWVectorDimension            = contract.MaxHNSWVectorDimension
	DefaultApproximateIndexCandidates = contract.DefaultApproximateIndexCandidates
	MaxApproximateIndexCandidates     = contract.MaxApproximateIndexCandidates
	MaxApproximateIndexRouteValues    = contract.MaxApproximateIndexRouteValues
	DefaultVectorSearchCandidates     = contract.DefaultVectorSearchCandidates
	MaxVectorSearchCandidates         = contract.MaxVectorSearchCandidates
	IndexTypeDefault                  = contract.IndexTypeDefault
	IndexTypeVector                   = contract.IndexTypeVector
	TableTypeDefault                  = contract.TableTypeDefault
	TableTypeSearchable               = contract.TableTypeSearchable
	SearchSupportLexical              = contract.SearchSupportLexical
	SearchSupportSemantic             = contract.SearchSupportSemantic
	SearchSupportBoth                 = contract.SearchSupportBoth
	SearchModeLexical                 = contract.SearchModeLexical
	SearchModeSemantic                = contract.SearchModeSemantic
	SearchModeHybrid                  = contract.SearchModeHybrid
	SearchMatchAny                    = contract.SearchMatchAny
	SearchMatchAll                    = contract.SearchMatchAll
)

Variables

This section is empty.

Functions

func Avg added in v0.3.0

func Avg(expr string) string

func ClearConfigCache

func ClearConfigCache()

ClearConfigCache clears any cached configuration state.

func Count added in v0.3.0

func Count(expr string) string

func Format added in v0.3.0

func Format(expr, pattern string) string

func ListInto

func ListInto(ctx context.Context, q Query, dest any) error

ListInto executes the query and decodes the results into dest. Dest should be a pointer to a slice or struct; Decode uses JSON tags on generated models.

func Lower added in v0.3.0

func Lower(expr string) string

func Max added in v0.3.0

func Max(expr string) string

func Median added in v0.3.0

func Median(expr string) string

func Min added in v0.3.0

func Min(expr string) string

func Percentile added in v0.3.0

func Percentile(expr string, percentile float64) string

func Replace added in v0.3.0

func Replace(expr, pattern, replacement string) string

func Std added in v0.3.0

func Std(expr string) string

func Substring added in v0.3.0

func Substring(expr string, from, length int) string

func Sum added in v0.3.0

func Sum(expr string) string

func Upper added in v0.3.0

func Upper(expr string) string

func Variance added in v0.3.0

func Variance(expr string) string

Types

type AIChatCompletionChoice added in v0.2.0

type AIChatCompletionChoice = contract.AIChatCompletionChoice

type AIChatCompletionChunk added in v0.2.0

type AIChatCompletionChunk = contract.AIChatCompletionChunk

type AIChatCompletionChunkChoice added in v0.2.0

type AIChatCompletionChunkChoice = contract.AIChatCompletionChunkChoice

type AIChatCompletionChunkDelta added in v0.2.0

type AIChatCompletionChunkDelta = contract.AIChatCompletionChunkDelta

type AIChatCompletionRequest added in v0.2.0

type AIChatCompletionRequest = contract.AIChatCompletionRequest

type AIChatCompletionResponse added in v0.2.0

type AIChatCompletionResponse = contract.AIChatCompletionResponse

type AIChatCompletionUsage added in v0.2.0

type AIChatCompletionUsage = contract.AIChatCompletionUsage

type AIChatMessage added in v0.2.0

type AIChatMessage = contract.AIChatMessage

type AIChatStream added in v0.2.0

type AIChatStream = contract.AIChatStream

type AIModel added in v0.2.0

type AIModel = contract.AIModel

type AIModelsResponse added in v0.2.0

type AIModelsResponse = contract.AIModelsResponse

type AIScriptApprovalRequest added in v0.2.0

type AIScriptApprovalRequest = contract.AIScriptApprovalRequest

type AIScriptApprovalResponse added in v0.2.0

type AIScriptApprovalResponse = contract.AIScriptApprovalResponse

type AITool added in v0.2.0

type AITool = contract.AITool

type AIToolCall added in v0.2.0

type AIToolCall = contract.AIToolCall

type AIToolCallFunction added in v0.2.0

type AIToolCallFunction = contract.AIToolCallFunction

type AIToolFunction added in v0.2.0

type AIToolFunction = contract.AIToolFunction

type ApproximateIndexCandidateQuery added in v0.4.0

type ApproximateIndexCandidateQuery = contract.ApproximateIndexCandidateQuery

func NewApproximateIndexCandidateQuery added in v0.4.0

func NewApproximateIndexCandidateQuery(
	valueOrValues any,
	maxCandidates ...int,
) (ApproximateIndexCandidateQuery, error)

type CascadeBuilder

type CascadeBuilder = contract.CascadeBuilder

func NewCascadeBuilder

func NewCascadeBuilder() CascadeBuilder

type CascadeClient

type CascadeClient = contract.CascadeClient

type CascadeSpec

type CascadeSpec = contract.CascadeSpec

func Cascade

func Cascade(spec string) CascadeSpec

type Client

type Client = contract.Client

func Init

func Init(ctx context.Context, cfg Config) (Client, error)

Init constructs a client using the provided configuration.

func InitWithDatabaseID

func InitWithDatabaseID(ctx context.Context, databaseID string) (Client, error)

InitWithDatabaseID initializes a client using only the database ID and environment/file configuration.

type Condition

type Condition = contract.Condition

func ApproximateCandidates added in v0.4.0

func ApproximateCandidates(field string, valueOrValues any, maxCandidates ...int) Condition

func ApproximateSearch added in v0.4.0

func ApproximateSearch(searchQuery VectorSearchQuery) Condition

func Between

func Between(field string, from, to any) Condition

func Contains

func Contains(field string, value any) Condition

func Eq

func Eq(field string, value any) Condition

func Gt

func Gt(field string, value any) Condition

func Gte

func Gte(field string, value any) Condition

func HNSWCandidates added in v0.4.0

func HNSWCandidates(searchQuery HNSWSearchQuery) Condition

func In

func In(field string, values []any) Condition

func IsNull

func IsNull(field string) Condition

func Like

func Like(field string, pattern any) Condition

func Lt

func Lt(field string, value any) Condition

func Lte

func Lte(field string, value any) Condition

func Neq

func Neq(field string, value any) Condition

func NotIn

func NotIn(field string, values []any) Condition

func NotNull

func NotNull(field string) Condition

func NotWithin

func NotWithin(field string, query Query) Condition
func Search(queryText string, minScore ...float64) Condition

func SearchWithOptions added in v0.5.0

func SearchWithOptions(queryText string, options SearchOptions) Condition

func StartsWith

func StartsWith(field string, value any) Condition

func VectorSearch added in v0.4.0

func VectorSearch(searchQuery VectorSearchQuery) Condition

func Within

func Within(field string, query Query) Condition

type Config

type Config = contract.Config

type Document

type Document = contract.Document

type DocumentClient

type DocumentClient = contract.DocumentClient

type Error

type Error = contract.Error

func NewError

func NewError(code, message string, meta map[string]any) *Error

type Field

type Field = contract.Field

type HNSWSearchQuery added in v0.4.0

type HNSWSearchQuery = contract.HNSWSearchQuery

func NewHNSWSearchQuery added in v0.4.0

func NewHNSWSearchQuery(input HNSWSearchQueryInput) (HNSWSearchQuery, error)

type HNSWSearchQueryInput added in v0.4.0

type HNSWSearchQueryInput = contract.HNSWSearchQueryInput

type Index added in v0.4.0

type Index = contract.Index

type IndexType added in v0.4.0

type IndexType = contract.IndexType

type Iterator

type Iterator = contract.Iterator

type ListResult

type ListResult struct {
	// contains filtered or unexported fields
}

ListResult is a fluent wrapper around query results for decoding.

func List

func List(ctx context.Context, q Query) ListResult

List executes the query and returns a fluent result that can be decoded.

func (ListResult) Decode

func (lr ListResult) Decode(dest any) error

Decode populates dest (pointer to slice/struct) with the query results.

type OnyxDocument

type OnyxDocument = contract.OnyxDocument

type OnyxDocumentsClient

type OnyxDocumentsClient = contract.OnyxDocumentsClient

type OnyxSecret

type OnyxSecret = contract.OnyxSecret

type OnyxSecretsClient

type OnyxSecretsClient = contract.OnyxSecretsClient

type PageResult

type PageResult = contract.PageResult

type Query

type Query = contract.Query

type QueryResults

type QueryResults = contract.QueryResults

type Resolver

type Resolver = contract.Resolver

type Schema

type Schema = contract.Schema

func NormalizeSchema

func NormalizeSchema(s Schema) Schema

func ParseSchemaJSON

func ParseSchemaJSON(data []byte) (Schema, error)

type SearchMatch added in v0.5.0

type SearchMatch = contract.SearchMatch

type SearchMode added in v0.5.0

type SearchMode = contract.SearchMode

type SearchOptions added in v0.5.0

type SearchOptions = contract.SearchOptions

type SearchSupport added in v0.6.0

type SearchSupport = contract.SearchSupport

type Secret

type Secret = contract.Secret

type SecretClient

type SecretClient = contract.SecretClient

type SemanticVectorSignature added in v0.4.0

type SemanticVectorSignature = contract.SemanticVectorSignature

func NewSemanticVectorSignature added in v0.4.0

func NewSemanticVectorSignature(
	calibrationID int64,
	bucketID int,
	cells []int,
	cellCounts []int,
	fingerprint []int64,
	boundaryConfidence ...float64,
) (SemanticVectorSignature, error)

type Sort

type Sort = contract.Sort

func Asc

func Asc(field string) Sort

Re-export contract helpers to keep the public surface stable.

func Desc

func Desc(field string) Sort

type Table

type Table = contract.Table

type TableType added in v0.4.0

type TableType = contract.TableType

type VectorSearchQuery added in v0.4.0

type VectorSearchQuery = contract.VectorSearchQuery

func NewVectorSearchQuery added in v0.4.0

func NewVectorSearchQuery(input VectorSearchQueryInput) (VectorSearchQuery, error)

type VectorSearchQueryInput added in v0.4.0

type VectorSearchQueryInput = contract.VectorSearchQueryInput

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL