Documentation ¶
Overview ¶
Package env allows propagating runtime configurations via the environment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { *adapter.EnvConfig // Environment variable containing the namespace of the adapter. Namespace string `envconfig:"NAMESPACE" required:"true"` // Component is the kind of this adapter. Component string `envconfig:"K_COMPONENT" required:"true"` }
Config is the minimal set of configuration parameters routing adapters should support.
func (*Config) GetComponent ¶
GetComponent implements ConfigAccessor.
type ConfigAccessor ¶
type ConfigAccessor interface { adapter.EnvConfigAccessor // Get the component name. GetComponent() string }
ConfigAccessor is a superset of adaper.EnvConfigAccessor that overrides properties about certain variables.
func MustProcessConfig ¶
func MustProcessConfig(envCtor ConfigConstructor) ConfigAccessor
MustProcessConfig populates the specified adapter.EnvConfigConstructor based on environment variables.
type ConfigConstructor ¶
type ConfigConstructor func() ConfigAccessor
ConfigConstructor is a callback function that returns a ConfigAccessor.
Click to show internal directories.
Click to hide internal directories.