kv

package
v3.2.5+incompatible Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 17 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DistributePairs

func DistributePairs(kvPairs [](*KVPair)) (err error)

func GetValue

func GetValue(key string) (value string, found bool, err error)

func InitKVStores

func InitKVStores()

InitKVStores initializes the KV stores (duh), once in the lifetime of this app. Configuration reload does not affect a running instance.

func PutKVPairs

func PutKVPairs(kvPairs []*KVPair) (err error)

func PutValue

func PutValue(key string, value string) (err error)

Types

type KVPair

type KVPair struct {
	Key   string
	Value string
}

func NewKVPair

func NewKVPair(key string, value string) *KVPair

func (*KVPair) String

func (this *KVPair) String() string

type KVStore

type KVStore interface {
	PutKeyValue(key string, value string) (err error)
	PutKVPairs(kvPairs []*KVPair) (err error)
	GetKeyValue(key string) (value string, found bool, err error)
	DistributePairs(kvPairs [](*KVPair)) (err error)
}

func NewConsulStore

func NewConsulStore() KVStore

NewConsulStore creates a new consul store. It is possible that the client for this store is nil, which is the case if no consul config is provided.

func NewConsulTxnStore

func NewConsulTxnStore() KVStore

NewConsulTxnStore creates a new consul store that uses Consul Transactions to read/write multiple KVPairs. It is possible that the client for this store is nil, which is the case if no consul config is provided

func NewInternalKVStore

func NewInternalKVStore() KVStore

func NewZkStore

func NewZkStore() KVStore

Jump to

Keyboard shortcuts

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