Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load loads a configuration source and returns its content as a flattened map[string]string.
The source string format is:
[optional:]<provider>:<path> <path> (defaults to file provider)
Examples:
- "file:./config.yaml" // file provider, required
- "optional:file:./config.yaml" // file provider, optional
- "./config.yaml" // shorthand for file:./config.yaml
- "etcd:localhost:2379/config" // custom provider
- "optional:etcd:localhost:2379/config" // custom provider, optional
When optional is true and the source does not exist, Load returns (nil, nil).
Types ¶
type Provider ¶
Provider defines a function type that provides configuration data from a specific source.
If access to a remote server is needed, the information required to access it is usually placed in the source string or passed through environment variables.
To support dynamic refresh, a version number field can be added and a regular Bean can be registered to listen for changes. When the version changes, the configuration can be updated.
Click to show internal directories.
Click to hide internal directories.