Documentation ¶
Overview ¶
Package configmap provides an abstraction for reading and writing config
Index ¶
- type Getter
- type Map
- func (c *Map) AddGetter(getter Getter, priority Priority) *Map
- func (c *Map) AddSetter(setter Setter) *Map
- func (c *Map) ClearGetters(priority Priority) *Map
- func (c *Map) ClearSetters() *Map
- func (c *Map) Get(key string) (value string, ok bool)
- func (c *Map) GetPriority(key string, maxPriority Priority) (value string, ok bool)
- func (c *Map) Set(key, value string)
- type Mapper
- type Priority
- type Setter
- type Simple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Getter ¶
type Getter interface { // Get should get an item with the key passed in and return // the value. If the item is found then it should return true, // otherwise false. Get(key string) (value string, ok bool) }
Getter provides an interface to get config items
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map provides a wrapper around multiple Setter and Getter interfaces.
func (*Map) ClearGetters ¶ added in v1.56.0
ClearGetters removes all the getters with the priority given
func (*Map) ClearSetters ¶ added in v1.56.0
ClearSetters removes all the setters set so far
func (*Map) Get ¶
Get gets an item with the key passed in and return the value from the first getter. If the item is found then it returns true, otherwise false.
func (*Map) GetPriority ¶ added in v1.56.0
GetPriority gets an item with the key passed in and return the value from the first getter to return a result with priority <= maxPriority. If the item is found then it returns true, otherwise false.
type Setter ¶
type Setter interface { // Set should set an item into persistent config store. Set(key, value string) }
Setter provides an interface to set config items