consul

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KvPairsToKvBytes

func KvPairsToKvBytes(kvp api.KVPairs) (stores.KVBytes, error)

func New

func New(cfg *config.Config, cn ConsulKVIFace) stores.IFace

func NewDefault

func NewDefault(cfg *config.Config) (stores.IFace, error)

Types

type ConsulKVIFace

type ConsulKVIFace interface {
	List(prefix string, q *api.QueryOptions) (api.KVPairs, *api.QueryMeta, error)
	Get(key string, q *api.QueryOptions) (*api.KVPair, *api.QueryMeta, error)
	Put(p *api.KVPair, q *api.WriteOptions) (*api.WriteMeta, error)
	Delete(key string, w *api.WriteOptions) (*api.WriteMeta, error)
}

type MockConsul

type MockConsul struct {
	Item  *stores.KVByte
	Items stores.KVBytes
	Err   error
}

func NewMockConsul

func NewMockConsul(key string, kvb stores.KVBytes, err error) (mc *MockConsul)

func (*MockConsul) Delete

func (mc *MockConsul) Delete(key string, w *api.WriteOptions) (*api.WriteMeta, error)

func (*MockConsul) Get

func (mc *MockConsul) Get(key string, qo *api.QueryOptions) (*api.KVPair, *api.QueryMeta, error)

func (*MockConsul) List

func (mc *MockConsul) List(prefix string, qo *api.QueryOptions) (api.KVPairs, *api.QueryMeta, error)

func (*MockConsul) Put

func (mc *MockConsul) Put(p *api.KVPair, qo *api.WriteOptions) (*api.WriteMeta, error)

type Store added in v0.2.4

type Store struct {
	// contains filtered or unexported fields
}

func (*Store) Close added in v0.2.4

func (s *Store) Close()

func (*Store) Delete added in v0.2.4

func (cs *Store) Delete(key string) error

func (*Store) Get added in v0.2.4

func (cs *Store) Get(key string) (*stores.KVByte, error)

func (*Store) List added in v0.2.4

func (cs *Store) List(prefix string) (stores.KVBytes, error)

func (*Store) Register added in v0.2.4

func (cs *Store) Register(cb func(kvb stores.KVBytes))

func (*Store) Set added in v0.2.4

func (cs *Store) Set(key string, bts []byte) error

func (*Store) Updated added in v0.2.4

func (cs *Store) Updated(kvs interface{})

func (*Store) Watch added in v0.2.4

func (cs *Store) Watch() error

Jump to

Keyboard shortcuts

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