mock

package
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2015 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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

func (cb ConfigBackend) SetWithTTL(key string, value string, ttl uint64) (string, error)

SetWithTTL sets a value for the specified key in an in memory config backend-- with a time to live

type Store

type Store []*model.ConfigNode

Store for a mocked config backend

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL