Documentation ¶
Index ¶
- Variables
- type Map
- func (m Map) Clone() Map
- func (m Map) Flatten(glue string) map[string]string
- func (m Map) GetBool(key string, fallback bool) (bool, error)
- func (m Map) GetFloat(key string, fallback float64) (float64, error)
- func (m Map) GetInt(key string, fallback int) (int, error)
- func (m Map) GetInt64(key string, fallback int64) (int64, error)
- func (m Map) GetInterface(key string, fallback interface{}) (interface{}, error)
- func (m Map) GetMap(key string, fallback Map) (Map, error)
- func (m Map) GetString(key, fallback string) (string, error)
- func (m Map) GetStringSlice(key string, fallback []string) ([]string, error)
- func (m Map) Has(key string) bool
- func (m *Map) Merge(source Map, replace bool)
- func (m *Map) Scan(v interface{}) error
- func (m Map) Set(k string, v interface{})
- func (m Map) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidType represents an invalid configuration value type error. ErrInvalidType = errors.New("invalid value type") // ErrUnscannableValue represents an unscannable value error. ErrUnscannableValue = errors.New("unscannable value") )
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map map[string]interface{}
Map represents an instance of keys mapping.
All the function returning values associated with keys will return a fallback value if the key is not present in the map or if the value can't be converted to the requested type.
func (Map) Flatten ¶
Flatten returns a "flattened" version of the map. * all nested elements are moved at the top level, with sub-level keys prefixed with the original key name using the glue string * any value whose type is different than maps or slice is returned as string representation (fmt "%v" verb) * slice elements are flattened, with their numeric index value as suffix * any pointer value is dereferenced
func (Map) GetInterface ¶
GetInterface returns the interface value associated with a key.
func (Map) GetStringSlice ¶
GetStringSlice returns the string value associated with a key.
func (*Map) Merge ¶
Merge merges the source map entries into the receiver map. If replace parameter is true, existing entries in the receiver map will be replaced with entries from the source map.