kv

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfig = Config{
		DirPath:             "./_hdd",
		ConflictRetries:     100,
		ConflictMaxInterval: time.Millisecond,
	}
)

Functions

func DB

func DB() *badger.DB

func Index added in v0.2.7

func Index() *buntdb.DB

func Init

func Init(config Config) error

func MustInit

func MustInit(config Config)

func Update

func Update(fn func(txn *badger.Txn) error) (err error)

func UpdateIndex added in v0.2.7

func UpdateIndex(fn func(tx *buntdb.Tx) error) (err error)

func View

func View(fn func(txn *badger.Txn) error) (err error)

func ViewIndex added in v0.2.7

func ViewIndex(fn func(tx *buntdb.Tx) error) error

Types

type Allocator added in v0.2.6

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

func NewAllocator added in v0.2.6

func NewAllocator() *Allocator

func (*Allocator) GenKey added in v0.2.6

func (bk *Allocator) GenKey(v ...interface{}) []byte

func (*Allocator) GenValue added in v0.2.6

func (bk *Allocator) GenValue(m proto.Message) []byte

func (*Allocator) ReleaseAll added in v0.2.6

func (bk *Allocator) ReleaseAll()

type Config

type Config struct {
	DirPath             string
	ConflictRetries     int
	ConflictMaxInterval time.Duration
}

Jump to

Keyboard shortcuts

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