Documentation
¶
Overview ¶
Package provider is the domain layer for the Provider entity — the vendor / author of a Model. Anthropic, OpenAI, Meta-Llama, Mistral, Google. Operational concerns (BaseURL, auth) live on Host, not Provider. Provider is essentially display metadata + the identity Model rows hang their Owner.ID off.
store.go is the data-access layer for Provider. It maps Provider domain structs to and from the sqlc-generated row types. Metadata JSONB encoding is delegated to app/meta; this file only knows about Provider's Spec.
Store is concrete — no interface declared here. Consumers (snapshot composer, admin handlers, seed) each declare their own narrow interface locally if they want a test seam.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
Meta meta.Metadata `json:"metadata" yaml:"metadata"`
Spec Spec `json:"spec" yaml:"spec"`
}
Provider is the vendor that authors Models.
type Spec ¶
type Spec struct {
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` // nil = true
// Display metadata — operator-set, optional.
HomepageURL string `json:"homepageURL,omitempty" yaml:"homepageURL,omitempty" validate:"omitempty,http_url"`
DocsURL string `json:"docsURL,omitempty" yaml:"docsURL,omitempty" validate:"omitempty,http_url"`
StatusPageURL string `json:"statusPageURL,omitempty" yaml:"statusPageURL,omitempty" validate:"omitempty,http_url"`
Icon *meta.Icon `json:"icon,omitempty" yaml:"icon,omitempty"`
}
Spec is display-only. There is no BaseURL on Provider — that lives on Host, since the same Provider (e.g. Anthropic) is served by multiple Hosts (Anthropic direct, Bedrock, Vertex). Per-Host serving info lives on standalone HostBinding entities (app/binding).
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the Provider data-access type. Holds a sqlc Queries handle.
func NewStore ¶
NewStore constructs a Store from an existing sqlc Queries handle. The caller owns the pgxpool / transaction; Store performs no connection mgmt.
func (*Store) Delete ¶
Delete removes a Provider by id. sqlc returns nil on a no-rows delete; callers can pre-check existence via the snapshot if they need a 404.