kv

package
v0.0.0-...-aa1fe35 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseStores

func CloseStores()

CloseStores closes the stores

Types

type KV

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

KV store for both in-memory and on-disk usage

func GetDiskStore

func GetDiskStore() (*KV, error)

GetDiskStore does what it says on the tin

func GetMemoryStore

func GetMemoryStore() (*KV, error)

GetMemoryStore does what it says on the tin

func (*KV) EndSerialTransaction

func (kv *KV) EndSerialTransaction() error

EndSerialTransaction or error

func (*KV) EndTransaction

func (kv *KV) EndTransaction() error

EndTransaction or error

func (*KV) Get

func (kv *KV) Get(key string) (string, error)

Get the value for the given key without a transcation or error

func (*KV) ListKeys

func (kv *KV) ListKeys(prefix string, limit int) ([]string, error)

ListKeys with the given prefix up to the limit specified or error

func (*KV) ListPairs

func (kv *KV) ListPairs(prefix string, limit int) ([]Pair, error)

ListPairs with the given prefix up to the limit specified or error

func (*KV) StartSerialTransaction

func (kv *KV) StartSerialTransaction() error

StartSerialTransaction or error

func (*KV) StartTransaction

func (kv *KV) StartTransaction() error

StartTransaction or error

func (*KV) TransactionDelete

func (kv *KV) TransactionDelete(key string) error

TransactionDelete the given key or error as part of a transaction

func (*KV) TransactionGet

func (kv *KV) TransactionGet(key string) (string, error)

TransactionGet the value for the given key or error as part of a transaction

func (*KV) TransactionSet

func (kv *KV) TransactionSet(key, value string) error

TransactionSet the KV pair or error as part of a transaction

type LogWrapper

type LogWrapper struct{}

LogWrapper for translating badger logs to zerolog logs

func (*LogWrapper) Debugf

func (*LogWrapper) Debugf(s string, i ...interface{})

Debugf emits formatted badger debugging info

func (*LogWrapper) Errorf

func (*LogWrapper) Errorf(s string, i ...interface{})

Errorf emits a formatted badger error

func (*LogWrapper) Infof

func (*LogWrapper) Infof(s string, i ...interface{})

Infof emits formatted badger info

func (*LogWrapper) Warningf

func (*LogWrapper) Warningf(s string, i ...interface{})

Warningf emits a formatted badger warning

type Pair

type Pair struct {
	Key   string
	Value string
}

Pair you know

Jump to

Keyboard shortcuts

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