vectorsearchcfg

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PGvectorProvider selects the pgvector-backed vectorsearch.Index implementation.
	PGvectorProvider = "pgvector"
	// QdrantProvider selects the Qdrant-backed vectorsearch.Index implementation.
	QdrantProvider = "qdrant"
)

Variables

This section is empty.

Functions

func ProvideIndex

func ProvideIndex[T any](
	ctx context.Context,
	logger logging.Logger,
	tracerProvider tracing.TracerProvider,
	metricsProvider metrics.Provider,
	cfg *Config,
	db database.Client,
	indexName string,
) (vectorsearch.Index[T], error)

ProvideIndex builds a vectorsearch.Index for the configured provider. The db argument is required only when Provider is PGvectorProvider; pass nil otherwise. Unknown or empty providers fall back to a noop index, matching the search/text dispatch convention.

Types

type Config

type Config struct {
	Pgvector       *pgvector.Config          `env:"init"     envPrefix:"PGVECTOR_"        json:"pgvector"`
	Qdrant         *qdrant.Config            `env:"init"     envPrefix:"QDRANT_"          json:"qdrant"`
	Provider       string                    `env:"PROVIDER" json:"provider"`
	CircuitBreaker circuitbreakingcfg.Config `env:"init"     envPrefix:"CIRCUIT_BREAKER_" json:"circuitBreakerConfig"`
	// contains filtered or unexported fields
}

Config dispatches to a vectorsearch provider implementation.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates a Config struct.

Jump to

Keyboard shortcuts

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