store

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVS

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

func NewKVS

func NewKVS(dir string, valueDir string, logger *log.Logger) (*KVS, error)

func (*KVS) Close

func (b *KVS) Close() error

func (*KVS) Delete

func (b *KVS) Delete(key []byte) error

func (*KVS) Get

func (b *KVS) Get(key []byte) ([]byte, error)

func (*KVS) Set

func (b *KVS) Set(key []byte, value []byte) error

func (*KVS) SnapshotItems

func (b *KVS) SnapshotItems() <-chan *kvs.KeyValuePair

type KVSFSM

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

func NewKVSFSM

func NewKVSFSM(path string, logger *log.Logger) (*KVSFSM, error)

func (*KVSFSM) Apply

func (f *KVSFSM) Apply(l *raft.Log) interface{}

func (*KVSFSM) Close

func (f *KVSFSM) Close() error

func (*KVSFSM) Get

func (f *KVSFSM) Get(key []byte) ([]byte, error)

func (*KVSFSM) Restore

func (f *KVSFSM) Restore(rc io.ReadCloser) error

func (*KVSFSM) Snapshot

func (f *KVSFSM) Snapshot() (raft.FSMSnapshot, error)

type KVSFSMSnapshot

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

func (*KVSFSMSnapshot) Persist

func (f *KVSFSMSnapshot) Persist(sink raft.SnapshotSink) error

func (*KVSFSMSnapshot) Release

func (f *KVSFSMSnapshot) Release()

type KeyValueStore

type KeyValueStore struct {
	BindAddr string
	DataDir  string
	// contains filtered or unexported fields
}

func NewKeyValueStore

func NewKeyValueStore(bindAddr string, dataDir string, logger *log.Logger) (*KeyValueStore, error)

func (*KeyValueStore) Close

func (s *KeyValueStore) Close() error

func (*KeyValueStore) Delete

func (s *KeyValueStore) Delete(key []byte) error

func (*KeyValueStore) Get

func (s *KeyValueStore) Get(key []byte) ([]byte, error)

func (*KeyValueStore) Join

func (s *KeyValueStore) Join(nodeId string, addr string) error

func (*KeyValueStore) Leave

func (s *KeyValueStore) Leave(nodeId string) error

func (*KeyValueStore) Open

func (s *KeyValueStore) Open(bootstrap bool, localID string) error

func (*KeyValueStore) Set

func (s *KeyValueStore) Set(key []byte, value []byte) error

func (*KeyValueStore) Snapshot

func (s *KeyValueStore) Snapshot() error

Jump to

Keyboard shortcuts

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