kv

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemType  = "mem"
	DiskType = "disk"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FsID      string
	Driver    string
	CachePath string
	Capacity  int64
}

type KVTxn added in v0.14.5

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

func (*KVTxn) Append added in v0.14.5

func (kv *KVTxn) Append(key []byte, value []byte) []byte

func (*KVTxn) Dels added in v0.14.5

func (kv *KVTxn) Dels(keys ...[]byte) error

func (*KVTxn) Exist added in v0.14.5

func (kv *KVTxn) Exist(Prefix []byte) bool

func (*KVTxn) Get added in v0.14.5

func (kv *KVTxn) Get(key []byte) []byte

func (*KVTxn) IncrBy added in v0.14.5

func (kv *KVTxn) IncrBy(key []byte, value int64) int64

func (*KVTxn) ScanValues added in v0.14.5

func (kv *KVTxn) ScanValues(prefix []byte) (map[string][]byte, error)

func (*KVTxn) Set added in v0.14.5

func (kv *KVTxn) Set(key, value []byte) error

type KvClient added in v0.14.5

type KvClient interface {
	Name() string
	Txn(f func(KvTxn) error) error
}

func NewBadgerClient added in v0.14.5

func NewBadgerClient(config Config) (KvClient, error)

type KvTxn added in v0.14.5

type KvTxn interface {
	Get(key []byte) []byte
	Set(key, value []byte) error
	Dels(keys ...[]byte) error
	ScanValues(prefix []byte) (map[string][]byte, error)
	Exist(Prefix []byte) bool
	Append(key []byte, value []byte) []byte
	IncrBy(key []byte, value int64) int64
}

Jump to

Keyboard shortcuts

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