Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultPath = "./data"
)
View Source
var ErrNotLeader = errors.New("current node is not leader")
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { View(fn func(tx *badger.Txn) error) error Subscribe(ctx context.Context, cb func(kv *badger.KVList) error, matches []pb.Match) error NewTransaction(ctx context.Context, update bool) (Tx, error) Replicated() bool IsLeader() bool Leader() string LeaderChanges() <-chan string LeaderConn() (grpc.ClientConnInterface, bool) LinearizableReads() bool Close() error }
type Option ¶
type Option func(o *options)
func WithBadgerOptionsFunc ¶
func WithBadgerOptionsFunc(fn func(opts badger.Options) badger.Options) Option
func WithInMemory ¶
func WithLogger ¶
func WithReplication ¶
func WithReplication(opts ...replication.Option) Option
type Tx ¶
type Tx interface { ReadTs() uint64 Iterator(opt badger.IteratorOptions) Iterator Set(ctx context.Context, key, value []byte, expiresAt uint64) error Get(ctx context.Context, key []byte) (Item, error) Delete(ctx context.Context, key []byte) error Commit(ctx context.Context) error Close(ctx context.Context) error }
Click to show internal directories.
Click to hide internal directories.