Documentation
¶
Overview ¶
Package constant owns immutable, application-supplied constant values. It never reads request values or changes authored metadata.
Index ¶
- type Loader
- type Values
- func (v *Values) Apply(component *spec.Component) *spec.Component
- func (v *Values) Empty() bool
- func (v *Values) For(component *spec.Component) (*Values, error)
- func (v *Values) Identity() string
- func (v *Values) Lookup(name string) (string, bool)
- func (v *Values) Names() []string
- func (v *Values) Path(source string) (string, error)
- func (v *Values) Resources(source fs.FS) fs.FS
- func (v *Values) Validate(component *spec.Component, lookup func(string) (reflect.Type, error)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
Loader reads one flat YAML/JSON scalar mapping. Multiple-file merging is not supported. JSON numbers never pass through float64.
type Values ¶
type Values struct {
// contains filtered or unexported fields
}
Values is a frozen, case-insensitive set. Constructors copy all caller maps. Values are strings to retain the existing typed-constant conversion boundary and preserve integer precision when loading JSON or YAML numbers.
func (*Values) Apply ¶
Apply returns runtime-only metadata with externally overridden const values. Call this after authored duplicate/conflict checks and never before generation.
func (*Values) For ¶
For overlays these instance values on validated authored defaults. Missing instance keys retain defaults; an empty value is an explicit override.
func (*Values) Identity ¶
Identity partitions native cache namespaces without exposing configured values.
func (*Values) Path ¶
Path expands only exact constant tokens in a trusted path/URL argument. It is single-pass: dollar signs inside values never become further tokens.
func (*Values) Resources ¶
Resources resolves a path at Open while retaining the supplied filesystem's namespace and root authority. It neither caches contents nor rewrites files.
func (*Values) Validate ¶
func (v *Values) Validate(component *spec.Component, lookup func(string) (reflect.Type, error)) error
Validate checks external values with the same native conversion used by Bindly's const provider, before any discovery/connection work. Authored declaration consistency is deliberately left to the DQL compiler.