Documentation ¶
Index ¶
- type ConfigBackend
- func (cb ConfigBackend) Delete(key string) (err error)
- func (cb ConfigBackend) Get(key string) (value string, err error)
- func (cb ConfigBackend) GetRecursive(key string) ([]*model.ConfigNode, error)
- func (cb ConfigBackend) GetWithDefault(key string, defaultValue string) (string, error)
- func (cb ConfigBackend) Set(key, value string) (returnedValue string, err error)
- func (cb ConfigBackend) SetWithTTL(key string, value string, ttl uint64) (string, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigBackend ¶
type ConfigBackend struct {
Expected Store
}
ConfigBackend is an in memory "mock" config datastore used for testing
func (ConfigBackend) Delete ¶
func (cb ConfigBackend) Delete(key string) (err error)
Delete a key/value pair by key from an in memory config backend
func (ConfigBackend) Get ¶
func (cb ConfigBackend) Get(key string) (value string, err error)
Get a value by key from an in memory config backend
func (ConfigBackend) GetRecursive ¶
func (cb ConfigBackend) GetRecursive(key string) ([]*model.ConfigNode, error)
GetRecursive returns a slice of all key/value pairs "under" a specified key in an in memory config backend (this is assuming some hierarchichal order exists wherein the value corresponding to a key may in fact be another key/value pair)
func (ConfigBackend) GetWithDefault ¶ added in v1.10.0
func (cb ConfigBackend) GetWithDefault(key string, defaultValue string) (string, error)
GetWithDefault gets a value by key from an in memory config backend and return a default value if not found
func (ConfigBackend) Set ¶
func (cb ConfigBackend) Set(key, value string) (returnedValue string, err error)
Set a value for the specified key in an in memory config backend
func (ConfigBackend) SetWithTTL ¶
SetWithTTL sets a value for the specified key in an in memory config backend-- with a time to live