Documentation
¶
Overview ¶
Package registry manages LLM provider connectors
Index ¶
- Variables
- type Candidate
- type Lease
- type ProviderMetadata
- 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) GetProviderMetadata() []ProviderMetadata
- func (r *Registry) GetProviderMetadataForRuntime(lease connectors.RuntimeLease) []ProviderMetadata
- func (r *Registry) HasProvider(provider string) bool
- func (r *Registry) IsProviderConfigured(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") // ErrProvidersRequired reports an empty provider registration set. ErrProvidersRequired = errors.New("at least one provider registration 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") // ErrCredentialSourceRequired reports a production registration without a // request-time material source. ErrCredentialSourceRequired = errors.New("provider credential material source 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) 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) 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 ProviderMetadata ¶
type ProviderMetadata struct {
ID string
Name string
URL string
Models []string
Capabilities []string
RequiresAuth bool
}
ProviderMetadata contains catalog facts needed by gateway provider discovery.
type Registration ¶
type Registration struct {
Provider string
Connector connectors.Connector
Operations []starmapcatalogs.ProviderOperation
EndpointTypes []starmapcatalogs.EndpointType
BaseURL string
EndpointBindings map[string]string
RequiresAuth bool
CredentialSource credentials.MaterialSource
}
Registration binds one configured connector 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 explicit production registrations.
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) GetProviderMetadata ¶
func (r *Registry) GetProviderMetadata() []ProviderMetadata
GetProviderMetadata returns Starmap metadata for registered providers.
func (*Registry) GetProviderMetadataForRuntime ¶ added in v1.0.2
func (r *Registry) GetProviderMetadataForRuntime( lease connectors.RuntimeLease, ) []ProviderMetadata
GetProviderMetadataForRuntime returns provider facts from one retained request generation. The caller owns the lease lifecycle.
func (*Registry) HasProvider ¶
HasProvider checks if a provider is registered
func (*Registry) IsProviderConfigured ¶
IsProviderConfigured reports whether app composition registered the provider.
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
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.