boltdb

package
v0.0.0-...-fa720cf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKVInterface

func NewKVInterface(path string, opts kvi.Options) (kvi.KVInterface, error)

NewKVInterface creates new BoltDB backed KVInterface at `path`

Types

type BoltKV

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

BoltKV is an implementation of the KVStore for bolt

func (*BoltKV) BulkWrite

func (boltkv *BoltKV) BulkWrite(u func(tx kvi.KVBulkWrite) error) error

BulkWrite is a replication of the regular update, no special code for bulk writes

func (*BoltKV) Close

func (boltkv *BoltKV) Close() error

Close closes the boltdb connection

func (*BoltKV) Delete

func (boltkv *BoltKV) Delete(id []byte) error

Delete removes a key/value from a kvstore

func (*BoltKV) DeletePrefix

func (boltkv *BoltKV) DeletePrefix(id []byte) error

DeletePrefix deletes all elements in kvstore that begin with prefix `id`

func (*BoltKV) Get

func (boltkv *BoltKV) Get(id []byte) ([]byte, error)

Get retrieves the value of key `id`

func (*BoltKV) HasKey

func (boltkv *BoltKV) HasKey(id []byte) bool

HasKey returns true if the key is exists in kvstore

func (*BoltKV) Set

func (boltkv *BoltKV) Set(id []byte, val []byte) error

Set value in kvstore

func (*BoltKV) Update

func (boltkv *BoltKV) Update(u func(tx kvi.KVTransaction) error) error

Update runs an alteration transaction of the kvstore

func (*BoltKV) View

func (boltkv *BoltKV) View(u func(it kvi.KVIterator) error) error

View run iterator on bolt keyvalue store

Jump to

Keyboard shortcuts

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