meles

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: Apache-2.0 Imports: 18 Imported by: 2

README

meles (Badger (genus))

Build Status codecov

meles is an embeddable transactional distributed key-value store powered by dgraph-io/badger

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrNotFound = fmt.Errorf("not found")
)
View Source
var (
	ErrStopped = fmt.Errorf("barge has been stopped")
)

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	Decode(src []byte) error
}

type Encoder

type Encoder interface {
	Encode() []byte
}

type Iterator

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

func (*Iterator) Close

func (i *Iterator) Close()

func (*Iterator) Item

func (i *Iterator) Item() *badger.Item

func (*Iterator) Next

func (i *Iterator) Next()

func (*Iterator) Rewind

func (i *Iterator) Rewind()

func (*Iterator) Seek

func (i *Iterator) Seek(key []byte)

func (*Iterator) Valid

func (i *Iterator) Valid() bool

func (*Iterator) ValidForPrefix

func (i *Iterator) ValidForPrefix(prefix []byte) bool

type Options

type Options struct {
	Directory string
	Peers     []string
}

type Store

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

func NewStore

func NewStore(listener net.Listener, logger timber.Logger, options Options) (*Store, error)

func (*Store) Address

func (s *Store) Address() string

func (*Store) Begin

func (s *Store) Begin() (*Transaction, error)

func (*Store) BeginAt

func (s *Store) BeginAt(timestamp time.Time) (*Transaction, error)

func (*Store) IsLeader

func (s *Store) IsLeader() bool

func (*Store) IsStopped

func (s *Store) IsStopped() bool

func (*Store) NextIncrementId

func (s *Store) NextIncrementId(objectPath []byte) (uint64, error)

func (*Store) NextSequenceId

func (s *Store) NextSequenceId(sequenceName string) (uint64, error)

func (*Store) NodeID

func (s *Store) NodeID() raft.ServerID

func (*Store) Start

func (s *Store) Start() error

func (*Store) Stop

func (s *Store) Stop() error

func (*Store) WaitForLeader

func (s *Store) WaitForLeader(timeout time.Duration) (leaderAddress string, hasLeader bool, err error)

type Transaction

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

func (*Transaction) Commit

func (s *Transaction) Commit() error

func (*Transaction) Delete

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

func (*Transaction) Get

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

func (*Transaction) GetIterator

func (s *Transaction) GetIterator(prefix []byte, keyOnly bool, reverse bool) *Iterator

func (*Transaction) IsLeader

func (s *Transaction) IsLeader() bool

func (*Transaction) IsStopped

func (s *Transaction) IsStopped() bool

func (*Transaction) MustGet

func (s *Transaction) MustGet(key []byte) ([]byte, bool, error)

func (*Transaction) NextIncrementId

func (s *Transaction) NextIncrementId(objectPath []byte) (uint64, error)

func (*Transaction) NextSequenceId

func (s *Transaction) NextSequenceId(sequenceName string) (uint64, error)

func (*Transaction) NodeID

func (s *Transaction) NodeID() raft.ServerID

func (*Transaction) Rollback

func (s *Transaction) Rollback() error

func (*Transaction) Set

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

func (*Transaction) WaitForLeader

func (s *Transaction) WaitForLeader(timeout time.Duration) (leaderAddress string, hasLeader bool, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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