embedder

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finder

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

Finder caches embedder client instances and lazily instantiates them using the generic provider.Factory.

func New

func New(options ...Option) *Finder

New creates Finder instance.

func (*Finder) AddConfig

func (d *Finder) AddConfig(name string, cfg *provider.Config)

AddConfig registers or overwrites an embedder configuration and bumps the internal version.

func (*Finder) Find

func (d *Finder) Find(ctx context.Context, id string) (baseembed.Embedder, error)

Find returns a ready-to-use embedder client by ID, creating and caching it on first request.

func (*Finder) Ids

func (d *Finder) Ids() []string

func (*Finder) Remove

func (d *Finder) Remove(name string)

Remove deletes an embedder entry and its config.

func (*Finder) Version

func (d *Finder) Version() int64

Version returns counter changed on Add/Remove.

type Option

type Option func(*Finder)

Option mutates Finder during construction.

func WithConfigLoader

func WithConfigLoader(loader provider.ConfigLoader) Option

func WithInitial

func WithInitial(config ...*provider.Config) Option

WithInitial registers a list of configuration objects available for lookup by ID.

Jump to

Keyboard shortcuts

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