badgdb

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerDB

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

func NewBadgerDB

func NewBadgerDB(dbpath string, dttl int) (*BadgerDB, error)

func (*BadgerDB) Close

func (db *BadgerDB) Close() error

func (*BadgerDB) Del

func (db *BadgerDB) Del(key []byte) error

func (*BadgerDB) DelBatch

func (db *BadgerDB) DelBatch(keys ...[]byte) error

func (*BadgerDB) Get

func (db *BadgerDB) Get(key []byte) ([]byte, error)

func (*BadgerDB) Init

func (db *BadgerDB) Init()

func (*BadgerDB) KeyCount

func (db *BadgerDB) KeyCount() int64

func (*BadgerDB) Range

func (db *BadgerDB) Range(f func(key, value []byte) bool, opt *option.RangeOption) error

func (*BadgerDB) RangeSort

func (db *BadgerDB) RangeSort(f func(key, value []byte) bool, f2 ssort.SSort, opt *option.RangeOption) error

先调用f2排序、再调用f处理数据

func (*BadgerDB) RangeWithOption

func (db *BadgerDB) RangeWithOption(f func(key, value []byte) bool, f2 ssort.SSort, opt *option.RangeOption) error

func (*BadgerDB) Set

func (db *BadgerDB) Set(key []byte, value []byte) error

func (*BadgerDB) SetBatch

func (db *BadgerDB) SetBatch(list map[string][]byte, ttl int) error

func (*BadgerDB) SetWithDTTL

func (db *BadgerDB) SetWithDTTL(key []byte, value []byte) error

func (*BadgerDB) SetWithTTL

func (db *BadgerDB) SetWithTTL(key []byte, value []byte, ttl int) error

SetWithTTL 带ttl 存储,ttl<=0是永久存储

Jump to

Keyboard shortcuts

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