Documentation
¶
Overview ¶
Package modelselectors normalizes provider/model selector strings shared by model-level admin features.
Index ¶
- func ExactMatchKey(providerName, model string) string
- func IsGlobal(raw string) bool
- func IsValidationError(err error) bool
- func NewValidationError(message string, err error) error
- func ParseStoredParts(selector string) (providerName, model string)
- func ProviderNames(catalog Catalog) []string
- func String(providerName, model string) string
- type Catalog
- type ScopeKind
- type Selector
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExactMatchKey ¶
ExactMatchKey returns the lookup key used to index exact provider+model overrides. Returns "" when either side is missing — exact matching only applies to fully-qualified pairs.
func IsValidationError ¶
IsValidationError reports whether err is a validation error.
func NewValidationError ¶
NewValidationError creates a selector validation error.
func ParseStoredParts ¶
ParseStoredParts splits a stored selector without a configured-provider catalog. This is a best-effort fallback for old rows. Stores should persist provider_name and model columns because slash-shaped model IDs cannot be distinguished from provider/model selectors without a provider catalog.
func ProviderNames ¶
ProviderNames returns a copy of configured provider names from catalog.
Types ¶
type Catalog ¶
type Catalog interface {
ProviderNames() []string
}
Catalog is the minimal configured-provider surface needed for selector validation.
type ScopeKind ¶
type ScopeKind string
ScopeKind identifies how broadly a selector applies.
func ScopeKindFor ¶
ScopeKindFor reports the normalized selector scope.
type Selector ¶
Selector is the normalized form of a model selector.
func NormalizeInput ¶
NormalizeInput validates and normalizes one user-supplied selector.
func NormalizeInputWithProviderNames ¶
NormalizeInputWithProviderNames validates and normalizes one user-supplied selector.
func NormalizeStored ¶
NormalizeStored normalizes selector columns loaded from storage.
type ValidationError ¶
type ValidationError = validation.Error
ValidationError indicates invalid selector input or invalid selector state.