badgerdb

package
v0.0.0-...-50e0b1d Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store type

func Open

func Open(path string, autoGC bool) (store *Store, err error)

Open or creates a store

func (*Store) Close

func (s *Store) Close() (err error)

Close the current Store

func (*Store) NewTxn

func (s *Store) NewTxn(update bool) (txn storage.Txn)

NewTxn creates a rw/ro transaction

func (*Store) Remove

func (s *Store) Remove() (err error)

Remove the current Store

func (*Store) RunGC

func (s *Store) RunGC() (err error)

RunGC garbage collect the undelying DB

type Txn

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

Txn transaction

func (*Txn) Commit

func (t *Txn) Commit() (err error)

Commit this transaction

func (*Txn) Delete

func (t *Txn) Delete(key []byte) (err error)

Delete the given key

func (*Txn) DeleteTree

func (t *Txn) DeleteTree(prefix []byte) (err error)

DeleteTree for the given prefix

func (*Txn) Discard

func (t *Txn) Discard()

Discard this transaction

func (*Txn) Get

func (t *Txn) Get(key []byte) (value []byte, err error)

Get value for the given key

func (*Txn) GetTree

func (t *Txn) GetTree(prefix []byte) (entries []storage.Entry, err error)

GetTree for the given prefix

func (*Txn) Set

func (t *Txn) Set(key, value []byte) (err error)

Set value for the given key

func (*Txn) SetWithTTL

func (t *Txn) SetWithTTL(key, value []byte, ttl time.Duration) (err error)

SetWithTTL value for the given key

Jump to

Keyboard shortcuts

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