Documentation ¶
Overview ¶
Package config provides the interface Handler and errors related to the configuration of adapters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyConfigCode = "11055" ErrViperCode = "11056" ErrInMemCode = "11057" // ErrEmptyConfig is returned when the config has not been initialized. ErrEmptyConfig = errors.New(ErrEmptyConfigCode, errors.Alert, []string{"Config not initialized"}, []string{}, []string{"Viper is crashing"}, []string{"Make sure viper is configured properly"}) )
Functions ¶
Types ¶
type Handler ¶
type Handler interface { // SetKey is used to set a string value for a given key. SetKey(key string, value string) // GetKey is used to retrieve a string value for a given key. GetKey(key string) string // GetObject is used to retrieve an object for a given key and a given interface representing that object in result. // An example of such an object is map[string]string. These objects can e.g. be set in the factory function for a specific // config provider implementation. GetObject(key string, result interface{}) error SetObject(key string, value interface{}) error }
Interface Handler is the interface to be implemented by config providers used by adapters.
Provided implementations can be found in the package config/provider.
Directories ¶
Path | Synopsis |
---|---|
Package provider provides config provider implementations that can be used in the adapters, as well as the Options type containing options for various aspects of an adapter.
|
Package provider provides config provider implementations that can be used in the adapters, as well as the Options type containing options for various aspects of an adapter. |
Click to show internal directories.
Click to hide internal directories.