stores

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 ConsulStore

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

func (*ConsulStore) Delete

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

func (*ConsulStore) Get

func (cs *ConsulStore) Get(key string) (*KVByte, error)

func (*ConsulStore) List

func (cs *ConsulStore) List(prefix string) (KVBytes, error)

func (*ConsulStore) Put

func (cs *ConsulStore) Put(key string, bts []byte) error

func (*ConsulStore) Set

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

type KVByte

type KVByte struct {
	Key   string
	Bytes []byte
}

func (*KVByte) String

func (kv *KVByte) String() string

type KVBytes

type KVBytes []*KVByte

func KvPairsBytesToKvBytes

func KvPairsBytesToKvBytes(bts []byte) (KVBytes, error)

func KvPairsToKvBytes

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

type MockConsul

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

func NewMockConsul

func NewMockConsul(key string, kvb 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 StoreIFace

type StoreIFace interface {
	List(prefix string) (KVBytes, error)
	Get(key string) (*KVByte, error)
	Delete(key string) error
	Put(key string, bts []byte) error
}

func DefaultConsulStore

func DefaultConsulStore() (StoreIFace, error)

func NewConsulStore

func NewConsulStore(cn ConsulKVIFace) StoreIFace

Jump to

Keyboard shortcuts

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