textsearchcfg

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ElasticsearchProvider represents the elasticsearch search index provider.
	ElasticsearchProvider = "elasticsearch"
	// AlgoliaProvider represents the algolia search index provider.
	AlgoliaProvider = "algolia"
)

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,
	indexName string,
) (textsearch.Index[T], error)

ProvideIndex validates a Config struct.

Types

type Config

type Config struct {
	Algolia        *algolia.Config        `env:"init"     envPrefix:"ALGOLIA_"         json:"algolia"`
	Elasticsearch  *elasticsearch.Config  `env:"init"     envPrefix:"ELASTICSEARCH_"   json:"elasticsearch"`
	Provider       string                 `env:"PROVIDER" json:"provider"`
	CircuitBreaker circuitbreaking.Config `env:"init"     envPrefix:"CIRCUIT_BREAKER_" json:"circuitBreakerConfig"`
	// contains filtered or unexported fields
}

Config contains settings regarding search indices.

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