state_store

package
v0.0.0-...-841f565 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVStore

type KVStore map[string]interface{}

KVStore a key value store for arbitrary data. It provides methods to get and set values by type.

func (KVStore) Get

func (kvs KVStore) Get(key string) interface{}

Get retrieves a value by its key as an interface which can be cast to any other value

func (KVStore) GetBool

func (kvs KVStore) GetBool(key string) bool

GetBool retrieves a value by its key as bool

func (KVStore) GetCheck

func (kvs KVStore) GetCheck(key string) (interface{}, bool)

GetCheck retrieves a value by its key as an interface which can be cast to any other value

func (KVStore) GetDuration

func (kvs KVStore) GetDuration(key string) time.Duration

GetDuration retrieves a value by its key as duration

func (KVStore) GetFloat64

func (kvs KVStore) GetFloat64(key string) float64

GetFloat64 retrieves a value by its key as float 64

func (KVStore) GetInt

func (kvs KVStore) GetInt(key string) int

GetInt retrieves a value by its key as int

func (KVStore) GetInt32

func (kvs KVStore) GetInt32(key string) int32

GetInt32 retrieves a value by its key as int 32

func (KVStore) GetInt64

func (kvs KVStore) GetInt64(key string) int64

GetInt64 retrieves a value by its key as int 64

func (KVStore) GetIntSlice

func (kvs KVStore) GetIntSlice(key string) []int

GetIntSlice retrieves a value by its key as int slice

func (KVStore) GetString

func (kvs KVStore) GetString(key string) string

GetString retrieves a value by its key as string

func (KVStore) GetStringMap

func (kvs KVStore) GetStringMap(key string) map[string]interface{}

GetStringMap retrieves a value by its key as string map

func (KVStore) GetStringMapString

func (kvs KVStore) GetStringMapString(key string) map[string]string

GetStringMapString retrieves a value by its key as string map string

func (KVStore) GetStringMapStringSlice

func (kvs KVStore) GetStringMapStringSlice(key string) map[string][]string

GetStringMapStringSlice retrieves a value by its key as string map string slice

func (KVStore) GetStringSlice

func (kvs KVStore) GetStringSlice(key string) []string

GetStringSlice retrieves a value by its key as string slice

func (KVStore) GetTime

func (kvs KVStore) GetTime(key string) time.Time

GetTime retrieves a value by its key as time

func (KVStore) GetUint

func (kvs KVStore) GetUint(key string) uint

GetUint retrieves a value by its key as uint

func (KVStore) GetUint32

func (kvs KVStore) GetUint32(key string) uint32

GetUint32 retrieves a value by its key as uint 32

func (KVStore) GetUint64

func (kvs KVStore) GetUint64(key string) uint64

GetUint64 retrieves a value by its key as uint 64

func (KVStore) MapStructure

func (kvs KVStore) MapStructure(key string, v interface{}) error

MapStructure maps the value of a key to a pointer to an arbitrary struct This will raise an error if the value v is not a pointer

func (KVStore) Set

func (kvs KVStore) Set(key string, val interface{}) interface{}

Set adds an arbitrary value of any type by the specified key to the key value store

func (KVStore) SetFromJSON

func (kvs KVStore) SetFromJSON(key string, data []byte) error

SetFromJSON decodes JSON bytes into a map[string]interface{} and stores the decoded value

type StateStore

type StateStore struct {
	Previous KVStore
	Current  KVStore
}

StateStore a generic data container for buildable target state

func NewStateStore

func NewStateStore() *StateStore

NewStateStore initializes an empty state store

Jump to

Keyboard shortcuts

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