distribution

package
v0.0.0-...-90a1d44 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	StableStorePrefix = 's'
	LogStorePrefix    = 'l'
)

Variables

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

Functions

This section is empty.

Types

type Barge

type Barge interface {
	Start() error
	WaitForLeader(timeout time.Duration) (string, bool, error)
	IsLeader() bool
	Begin() (Transaction, error)
	Stop() error
	IsStopped() bool
	NodeID() raft.ServerID
	NextObjectID(objectPath []byte) (uint8, error)
}

func NewDistributor

func NewDistributor(listener net.Listener, options *Options, l timber.Logger) (Barge, error)

type Decoder

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

type Encoder

type Encoder interface {
	Encode() []byte
}

type Iterator

type Iterator interface {
	Close()
	Item() *badger.Item
	Next()
	Valid() bool
	Seek(key []byte)
	ValidForPrefix(prefix []byte) bool
	Rewind()
}

type ObjectSequence

type ObjectSequence struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*ObjectSequence) Next

func (s *ObjectSequence) Next() (uint8, error)

type Options

type Options struct {
	Directory       string
	ListenAddress   string
	Peers           []string
	Join            bool
	LeaderWaitDelay time.Duration
}

type Transaction

type Transaction interface {
	Get(key []byte, value Decoder) error
	Set(key []byte, value Encoder) error
	SetRaw(key []byte, value []byte) error
	Delete(key []byte) error

	GetKeyIterator(prefix []byte, keyOnly bool, reverse bool) Iterator

	NextObjectID(objectPath []byte) (uint8, error)

	Rollback() error
	Commit() error
}

Jump to

Keyboard shortcuts

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