arctonyx

package module
v0.0.0-...-baba337 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

README

arctonyx

Build Status

An embeddable raft implementation of the badger key-value store.

The compiled protocol files are not included in this repository. To create them cd to the directory and run make protos.

Documentation

Index

Constants

View Source
const (
	SequenceRangeSize   = 1000
	SequencePartitions  = 5
	SequencePreretrieve = 50
)

Variables

View Source
var (
	ErrNotLeader = errors.New("the current node is not the leader and cannot fulfill your request")
)

Functions

This section is empty.

Types

type KeyValue

type KeyValue struct {
	Key   []byte
	Value []byte
}

type SequenceChunk

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

func (*SequenceChunk) GetSequenceIndex

func (sequence *SequenceChunk) GetSequenceIndex() uint64

func (*SequenceChunk) Next

func (sequence *SequenceChunk) Next() (*uint64, error)

type Store

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

func CreateStore

func CreateStore(directory string, listen string, joinAddr string) (*Store, error)

Creates and possibly joins a cluster.

func (*Store) ChangeKey

func (store *Store) ChangeKey(currentKey []byte, newKey []byte) error

func (*Store) Close

func (store *Store) Close()

func (*Store) Delete

func (store *Store) Delete(key []byte) (err error)

func (*Store) Get

func (store *Store) Get(key []byte) (value []byte, err error)

func (*Store) GetKeyOnlyPrefix

func (store *Store) GetKeyOnlyPrefix(prefix []byte) (keys [][]byte, err error)

func (*Store) GetPrefix

func (store *Store) GetPrefix(prefix []byte) (values []KeyValue, err error)

func (*Store) GetPrefixWithPredicate

func (store *Store) GetPrefixWithPredicate(prefix []byte, predicate func(kv KeyValue) (bool, error)) (kv KeyValue, found bool, err error)

func (*Store) IsLeader

func (store *Store) IsLeader() bool

func (*Store) ListenAddr

func (store *Store) ListenAddr() string

func (*Store) NextSequenceValueById

func (store *Store) NextSequenceValueById(sequenceName string) (*uint64, error)

func (*Store) NodeID

func (store *Store) NodeID() uint64

func (*Store) SequenceIndexById

func (store *Store) SequenceIndexById(sequenceName string) (uint64, error)

func (*Store) Set

func (store *Store) Set(key, value []byte) (err error)

Directories

Path Synopsis
example
demo command

Jump to

Keyboard shortcuts

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