Versions in this module Expand all Collapse all v0 v0.6.5 Dec 1, 2020 Changes in this version + const DefaultBlockCacheSize + const DefaultCompressionMode + const DefaultIndexCacheSize + const DefaultLogValueSize + const DefaultMaxTableSize + const TinyIndexCacheSize + func BadgerTrain(ctx context.Context, namespace string, db string, output string, ...) (float64, float64, error) + func DefaultBadgerOptions(dir string) badger.Options + func PerformanceBadgerOptions(dir string) badger.Options + type BadgerDatabase struct + func (b *BadgerDatabase) Close(ctx context.Context) error + func (b *BadgerDatabase) Encoder() *encoder.Encoder + func (b *BadgerDatabase) ReadTransaction(ctx context.Context) Transaction + func (b *BadgerDatabase) Transaction(ctx context.Context) Transaction + func (b *BadgerDatabase) WriteTransaction(ctx context.Context, identifier string, priority bool) Transaction + type BadgerOption func(b *BadgerDatabase) + func WithCompressorEntries(entries []*encoder.CompressorEntry) BadgerOption + func WithCustomSettings(settings badger.Options) BadgerOption + func WithIndexCacheSize(size int64) BadgerOption + func WithWriterShards(shards int) BadgerOption + func WithoutCompression() BadgerOption + type BadgerTransaction struct + func (b *BadgerTransaction) Commit(context.Context) error + func (b *BadgerTransaction) Delete(ctx context.Context, key []byte) error + func (b *BadgerTransaction) Discard(context.Context) + func (b *BadgerTransaction) Get(ctx context.Context, key []byte) (bool, []byte, error) + func (b *BadgerTransaction) Scan(ctx context.Context, prefix []byte, seekStart []byte, ...) (int, error) + func (b *BadgerTransaction) Set(ctx context.Context, key []byte, value []byte, reclaimValue bool) error + type CommitWorker func(context.Context) error + type Database interface + Close func(context.Context) error + Encoder func() *encoder.Encoder + ReadTransaction func(context.Context) Transaction + Transaction func(context.Context) Transaction + WriteTransaction func(ctx context.Context, identifier string, priority bool) Transaction + func NewBadgerDatabase(ctx context.Context, dir string, storageOptions ...BadgerOption) (Database, error) + type Transaction interface + Commit func(context.Context) error + Delete func(context.Context, []byte) error + Discard func(context.Context) + Get func(context.Context, []byte) (bool, []byte, error) + Scan func(context.Context, []byte, []byte, func([]byte, []byte) error, bool, bool) (int, error) + Set func(context.Context, []byte, []byte, bool) error