Documentation
¶
Overview ¶
Package registry manages LLM provider connectors
Index ¶
- Variables
- type Candidate
- type Lease
- func (l *Lease) AnonymousMaterial(provider string) (credentials.Material, bool)
- func (l *Lease) BindEndpoint(provider string, endpoint starmapcatalogs.ProviderOfferingEndpoint, ...) (starmapcatalogs.ProviderOfferingEndpoint, error)
- func (l *Lease) Get(provider string) connectors.Connector
- func (l *Lease) Release()
- func (l *Lease) RequiresAuthentication(provider string) bool
- func (l *Lease) ResolveMaterial(ctx context.Context, provider string) (credentials.Material, error)
- func (l *Lease) Snapshot() *runtimecatalog.RoutableSnapshot
- type Registration
- type Registry
- func (r *Registry) AcquireRuntime() (connectors.RuntimeLease, error)
- func (r *Registry) Catalog() *runtimecatalog.ControlPlane
- func (r *Registry) Close() error
- func (r *Registry) Get(provider string) (connectors.Connector, error)
- func (r *Registry) GetAll() map[string]connectors.Connector
- func (r *Registry) HasProvider(provider string) bool
- func (r *Registry) ListProviders() []string
- func (r *Registry) Prepare(registrations []Registration) (*Candidate, error)
- func (r *Registry) Publish(candidate *Candidate, snapshot *runtimecatalog.RoutableSnapshot) error
- func (r *Registry) Register(provider string, connector connectors.Connector) error
- func (r *Registry) ResolveMaterial(ctx context.Context, provider string) (credentials.Material, error)
- func (r *Registry) Snapshot() *runtimecatalog.RoutableSnapshot
- func (r *Registry) Start(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCatalogRequired reports an absent Starmap control plane. ErrCatalogRequired = errors.New("registry catalog is required") // ErrProviderRequired reports a registration without a provider ID. ErrProviderRequired = errors.New("provider registration name is required") // ErrConnectorRequired reports a registration without a connector. ErrConnectorRequired = errors.New("provider connector is required") // ErrRegistryStarted reports a second start request. ErrRegistryStarted = errors.New("registry already started") // ErrRegistryClosed reports an operation after registry shutdown. ErrRegistryClosed = errors.New("registry is closed") )
Functions ¶
This section is empty.
Types ¶
type Candidate ¶ added in v1.0.2
type Candidate struct {
// contains filtered or unexported fields
}
Candidate owns a complete runtime generation until publication or close.
func (*Candidate) Availability ¶ added in v1.0.2
func (c *Candidate) Availability() []runtimecatalog.AdapterAvailability
Availability returns the complete adapter projection for catalog validation.
type Lease ¶ added in v1.0.2
type Lease struct {
// contains filtered or unexported fields
}
Lease retains one complete generation for one request.
func (*Lease) AnonymousMaterial ¶ added in v1.0.3
func (l *Lease) AnonymousMaterial(provider string) (credentials.Material, bool)
AnonymousMaterial returns the catalog-default no-auth material, if one is executable in this generation.
func (*Lease) BindEndpoint ¶ added in v1.0.3
func (l *Lease) BindEndpoint( provider string, endpoint starmapcatalogs.ProviderOfferingEndpoint, material credentials.Material, useOperatorOverride bool, ) (starmapcatalogs.ProviderOfferingEndpoint, error)
BindEndpoint applies only the selected request material. Operator endpoint overrides are available only when the caller selected operator material.
func (*Lease) Get ¶ added in v1.0.2
func (l *Lease) Get(provider string) connectors.Connector
Get returns a connector from the leased generation.
func (*Lease) Release ¶ added in v1.0.2
func (l *Lease) Release()
Release ends the request lease. The last old-generation lease closes its connectors after replacement.
func (*Lease) RequiresAuthentication ¶ added in v1.1.0
RequiresAuthentication reports the retained runtime registration policy.
func (*Lease) ResolveMaterial ¶ added in v1.0.2
func (l *Lease) ResolveMaterial( ctx context.Context, provider string, ) (credentials.Material, error)
ResolveMaterial resolves material from the leased generation.
func (*Lease) Snapshot ¶ added in v1.0.2
func (l *Lease) Snapshot() *runtimecatalog.RoutableSnapshot
Snapshot returns the newest availability view for the leased catalog generation. During replacement, it returns the retained complete snapshot.
type Registration ¶
type Registration struct {
Provider string
Connector connectors.Connector
Operations []starmapcatalogs.ProviderOperation
EndpointTypes []starmapcatalogs.EndpointType
OperatorBaseURL string
RequiresAuth bool
OperatorSource credentials.MaterialSource
Anonymous credentials.Material
}
Registration binds one compiled connector and optional operator state to a provider ID.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages provider connectors and their lifecycle
func NewEmpty ¶
func NewEmpty() *Registry
NewEmpty creates an empty registry without initialization Useful for testing
func NewEmptyWithCatalog ¶
func NewEmptyWithCatalog(catalogPlane *runtimecatalog.ControlPlane) *Registry
NewEmptyWithCatalog creates an empty registry with a catalog control plane.
func Open ¶
func Open(catalogPlane *runtimecatalog.ControlPlane, registrations []Registration) (*Registry, error)
Open creates a registry from one complete executable provider set.
func (*Registry) AcquireRuntime ¶ added in v1.0.2
func (r *Registry) AcquireRuntime() (connectors.RuntimeLease, error)
AcquireRuntime retains the current complete generation until Release.
func (*Registry) Catalog ¶
func (r *Registry) Catalog() *runtimecatalog.ControlPlane
Catalog returns the registry's shared catalog control plane.
func (*Registry) Get ¶
func (r *Registry) Get(provider string) (connectors.Connector, error)
Get retrieves a connector by provider name
func (*Registry) GetAll ¶
func (r *Registry) GetAll() map[string]connectors.Connector
GetAll returns all registered connectors
func (*Registry) HasProvider ¶
HasProvider checks if a provider is registered
func (*Registry) ListProviders ¶
ListProviders returns a list of registered provider names
func (*Registry) Prepare ¶ added in v1.0.2
func (r *Registry) Prepare(registrations []Registration) (*Candidate, error)
Prepare validates and owns a complete replacement generation.
func (*Registry) Publish ¶ added in v1.0.2
func (r *Registry) Publish( candidate *Candidate, snapshot *runtimecatalog.RoutableSnapshot, ) error
Publish atomically installs a validated generation and drains its predecessor.
func (*Registry) Register ¶
func (r *Registry) Register(provider string, connector connectors.Connector) error
Register adds a connector to the registry. It derives no operation and no endpoint type. Both come from the compiled transport registry through providers.Assess, which is the one seam that intersects a catalog offering with what this build can execute. A second derivation here read the catalog alone, so it published operations no transport implements.
func (*Registry) ResolveMaterial ¶ added in v1.0.2
func (r *Registry) ResolveMaterial(ctx context.Context, provider string) (credentials.Material, error)
ResolveMaterial resolves request-bound inference material for one exact registered provider.
func (*Registry) Snapshot ¶ added in v1.0.2
func (r *Registry) Snapshot() *runtimecatalog.RoutableSnapshot
Snapshot returns one complete current runtime snapshot.