Documentation
¶
Overview ¶
Package config provides small, domain-neutral configuration boundary primitives. It parses process input; application policy remains with the application that declares the environment names and defaults.
Index ¶
- func LabelRefinementError(message proto.Message, label func(field protoreflect.FieldDescriptor) string, ...) error
- func ValidatePrivateOrigin(raw string) error
- type Environment
- func (environment Environment) Duration(name string, fallback time.Duration) (time.Duration, error)
- func (environment Environment) First(names ...string) string
- func (environment Environment) Int32(name string, fallback int32) (int32, error)
- func (environment Environment) Raw(name string) string
- func (environment Environment) String(name, fallback string) string
- type ProviderModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LabelRefinementError ¶
func LabelRefinementError( message proto.Message, label func(field protoreflect.FieldDescriptor) string, err error, ) error
LabelRefinementError translates a Liquid Proto schema field into the label used at the consuming configuration boundary, such as an environment name. Liquid owns the invariant; this function only makes its error actionable to the operator and returns the original error unchanged when it cannot map the field safely.
func ValidatePrivateOrigin ¶
ValidatePrivateOrigin accepts an HTTP(S) origin whose host is loopback, private, link-local, tailnet, or a private DNS name. Credentials, paths, queries, and fragments are rejected so callers cannot accidentally grant a remote service a broader URL boundary than intended.
Types ¶
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment reads configuration from a named string source.
func NewEnvironment ¶
func NewEnvironment(lookup func(name string) (string, bool)) Environment
NewEnvironment constructs an environment reader around lookup. A nil lookup is an empty environment, which keeps zero-input configuration deterministic.
func OSEnvironment ¶
func OSEnvironment() Environment
OSEnvironment reads the current process environment.
func (Environment) Duration ¶
Duration parses the named Go duration or returns fallback when it is empty.
func (Environment) First ¶
func (environment Environment) First(names ...string) string
First returns the first non-empty named value.
func (Environment) Int32 ¶
func (environment Environment) Int32(name string, fallback int32) (int32, error)
Int32 parses the named base-10 integer or returns fallback when it is empty.
func (Environment) Raw ¶
func (environment Environment) Raw(name string) string
Raw returns the trimmed named value.
func (Environment) String ¶
func (environment Environment) String(name, fallback string) string
String returns the trimmed named value or fallback when it is empty.
type ProviderModel ¶
ProviderModel identifies one model within one provider.
func ParseProviderModel ¶
func ParseProviderModel(value string) (ProviderModel, error)
ParseProviderModel parses the provider/model reference used by agent APIs. Model IDs may contain further slashes; neither component may be empty.