Documentation
¶
Overview ¶
Package config loads context-guru's configuration and builds a pipeline from it. One strict YAML struct serves both hosts (design D9): the proxy loads a file; the AuthBridge plugin hands its config: subtree to LoadBytes; a k8s ConfigMap/CRD just renders the same YAML.
The pipeline: name-list controls order + enablement. Each component's own typed config lives under components:<name>; it's handed to the component's constructor verbatim, so adding a component makes it configurable with no change here. A preset expands to a default pipeline + component configs, which the explicit fields then override.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PresetPipeline ¶
PresetPipeline returns the default pipeline (ordered component names) for a named preset. It's the safe way to resolve a caller-supplied preset name (e.g. a /compact ?preset= query param) — a plain map lookup, no YAML parsing of untrusted input.
Types ¶
type Config ¶
type Config struct {
Preset string `yaml:"preset"`
Pipeline []string `yaml:"pipeline"`
Components map[string]yaml.Node `yaml:"components"`
Store store.Options `yaml:"store"`
}
Config is the whole configuration document.
func LoadBytes ¶
LoadBytes parses a YAML config document (strict). Used by the AuthBridge plugin's Configure, which receives its subtree as bytes.
func (*Config) Build ¶
func (c *Config) Build(e components.Emitter) (*components.Pipeline, error)
Build constructs the ordered pipeline from the config, wiring each named component with its raw config block.