Documentation ¶
Index ¶
- Constants
- type ConfigMap
- func (l *ConfigMap) AllKeys() []string
- func (l *ConfigMap) Get(key string) interface{}
- func (l *ConfigMap) IsSet(key string) bool
- func (l *ConfigMap) MergeStringMap(cfg map[string]interface{}) error
- func (l *ConfigMap) Set(key string, value interface{})
- func (l *ConfigMap) Sub(key string) (*ConfigMap, error)
- func (l *ConfigMap) ToStringMap() map[string]interface{}
- func (l *ConfigMap) Unmarshal(rawVal interface{}) error
- func (l *ConfigMap) UnmarshalExact(intoCfg interface{}) error
Constants ¶
const (
// KeyDelimiter is used as the default key delimiter in the default koanf instance.
KeyDelimiter = "::"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigMap ¶ added in v0.35.0
type ConfigMap struct {
// contains filtered or unexported fields
}
ConfigMap loads configuration.
func NewConfigMap ¶ added in v0.36.0
func NewConfigMap() *ConfigMap
NewConfigMap creates a new empty ConfigMap instance.
func NewConfigMapFromBuffer ¶ added in v0.36.0
NewConfigMapFromBuffer creates a new ConfigMap by reading the given yaml buffer.
func NewConfigMapFromFile ¶ added in v0.36.0
NewConfigMapFromFile creates a new ConfigMap by reading the given file.
func NewConfigMapFromStringMap ¶ added in v0.36.0
NewConfigMapFromStringMap creates a ConfigMap from a map[string]interface{}.
func (*ConfigMap) AllKeys ¶ added in v0.35.0
AllKeys returns all keys holding a value, regardless of where they are set. Nested keys are returned with a KeyDelimiter separator.
func (*ConfigMap) IsSet ¶ added in v0.35.0
IsSet checks to see if the key has been set in any of the data locations. IsSet is case-insensitive for a key.
func (*ConfigMap) MergeStringMap ¶ added in v0.35.0
MergeStringMap merges the configuration from the given map with the existing config. Note that the given map may be modified.
func (*ConfigMap) Sub ¶ added in v0.35.0
Sub returns new Parser instance representing a sub-config of this instance. It returns an error is the sub-config is not a map (use Get()) and an empty Parser if none exists.
func (*ConfigMap) ToStringMap ¶ added in v0.35.0
ToStringMap creates a map[string]interface{} from a Parser.
func (*ConfigMap) Unmarshal ¶ added in v0.35.0
Unmarshal unmarshalls the config into a struct. Tags on the fields of the structure must be properly set.
func (*ConfigMap) UnmarshalExact ¶ added in v0.35.0
UnmarshalExact unmarshalls the config into a struct, erroring if a field is nonexistent.