kv

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: BSD-3-Clause Imports: 5 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 Init

func Init(config Config) error

func MustInit

func MustInit(config Config)

func New

func New(config Config) (*badger.DB, error)

func Update

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

func View

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

Types

type BulkKey

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

func NewBulkKey

func NewBulkKey() *BulkKey

func (*BulkKey) GenKey

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

func (*BulkKey) ReleaseAll

func (bk *BulkKey) 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