store

package
v0.0.0-...-a5d9027 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package store is a generated protocol buffer package.

It is generated from these files:

kv.proto

It has these top-level messages:

ProtoKVItem

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIterFinished = errors.New("ERR iteration finished successfully")
)
View Source
var (
	ErrNotLeader error = errors.New("not leader")
)

Functions

func NewDeleteCommand

func NewDeleteCommand(key string) *command

func NewFSM

func NewFSM(path string) (*fsm, error)

func NewSetCommand

func NewSetCommand(key, value string) *command

Types

type BadgerDB

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

func NewBadgerDB

func NewBadgerDB(dir, valueDir string) (*BadgerDB, error)

func (*BadgerDB) Close

func (b *BadgerDB) Close()

func (*BadgerDB) Delete

func (b *BadgerDB) Delete(key []byte) (bool, error)

func (*BadgerDB) Get

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

func (*BadgerDB) Set

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

func (*BadgerDB) SnapshotItems

func (b *BadgerDB) SnapshotItems() <-chan DataItem

type DB

type DB interface {
	Get(key []byte) ([]byte, error)
	Set(key, value []byte) error
	Delete(key []byte) (bool, error)

	SnapshotItems() <-chan DataItem

	Close()
}

type DataItem

type DataItem interface{}

type KVItem

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

func (*KVItem) IsFinished

func (i *KVItem) IsFinished() bool

type ProtoKVItem

type ProtoKVItem struct {
	Key              []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
	Value            []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

func (*ProtoKVItem) Descriptor

func (*ProtoKVItem) Descriptor() ([]byte, []int)

func (*ProtoKVItem) GetKey

func (m *ProtoKVItem) GetKey() []byte

func (*ProtoKVItem) GetValue

func (m *ProtoKVItem) GetValue() []byte

func (*ProtoKVItem) ProtoMessage

func (*ProtoKVItem) ProtoMessage()

func (*ProtoKVItem) Reset

func (m *ProtoKVItem) Reset()

func (*ProtoKVItem) String

func (m *ProtoKVItem) String() string

type Store

type Store struct {
	RaftDir  string
	RaftBind string
	// contains filtered or unexported fields
}

func NewStore

func NewStore(raftdir, raftbind string) (*Store, error)

func (*Store) Delete

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

func (*Store) Get

func (s *Store) Get(key string) (string, error)

func (*Store) Join

func (s *Store) Join(nodeID, addr string) error

func (*Store) Leave

func (s *Store) Leave(nodeID string) error

func (*Store) Open

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

func (*Store) Set

func (s *Store) Set(key, value string) error

func (*Store) Snapshot

func (s *Store) Snapshot() error

Jump to

Keyboard shortcuts

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