driver

package
v0.0.0-...-32dd021 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: LGPL-2.1 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelDBDriver

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

支持按照文件名返回连接

func NewLevelDBDriver

func NewLevelDBDriver(prefix string) (*LevelDBDriver, error)

func (*LevelDBDriver) Close

func (l *LevelDBDriver) Close() error

func (*LevelDBDriver) Delete

func (l *LevelDBDriver) Delete(dbName, key string) error

func (*LevelDBDriver) Get

func (l *LevelDBDriver) Get(dbName, key string) ([]byte, error)

func (*LevelDBDriver) GetArrJson

func (l *LevelDBDriver) GetArrJson(dbName string, key string) ([]map[string]interface{}, error)

func (*LevelDBDriver) GetDB

func (l *LevelDBDriver) GetDB(dbName string) (*goleveldb.DB, error)

func (*LevelDBDriver) GetDBName

func (l *LevelDBDriver) GetDBName(dbName string) string

func (*LevelDBDriver) GetJson

func (l *LevelDBDriver) GetJson(dbName, key string) (map[string]interface{}, error)

func (*LevelDBDriver) GetRangeNum

func (l *LevelDBDriver) GetRangeNum(dbName string, start string, end string) (int, error)

func (*LevelDBDriver) IterAll

func (l *LevelDBDriver) IterAll(dbName string) error

func (*LevelDBDriver) IterAllLen

func (l *LevelDBDriver) IterAllLen(dbName string) (int, error)

func (*LevelDBDriver) IteratorByPrefix

func (l *LevelDBDriver) IteratorByPrefix(dbName string, prefix string) (map[string][]byte, error)

根据前缀获取key,value

func (*LevelDBDriver) IteratorByRange

func (l *LevelDBDriver) IteratorByRange(dbName string, start, end string) ([]map[string]interface{}, error)

func (*LevelDBDriver) IteratorStrByRange

func (l *LevelDBDriver) IteratorStrByRange(dbName string, start, end string) ([]map[string]string, error)

IteratorStrByRange 按照范围获取key-value

func (*LevelDBDriver) Put

func (l *LevelDBDriver) Put(dbName, key string, value []byte) error

func (*LevelDBDriver) Remove

func (l *LevelDBDriver) Remove(dbName string, start string, end string, nums int) error

Remove 删除给定范围的数据 nums 指定删除的记录条数 TODO: 需要把占位key的逻辑移除出去作为通用的

func (*LevelDBDriver) Truncate

func (l *LevelDBDriver) Truncate(dbName string) error

func (*LevelDBDriver) WriteByArray

func (l *LevelDBDriver) WriteByArray(dbName string, key string, value interface{}) error

写入数据 找给定key判断能否找到 能找到的话按照数组的格式往后添加数据

func (*LevelDBDriver) WriteJson

func (l *LevelDBDriver) WriteJson(dbName string, key string, value interface{}) error

Jump to

Keyboard shortcuts

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