leveldb

package
v0.0.0-...-de85661 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Unlicense Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

数据库是一个持久的键值存储。除了基本的数据存储功能外,它还支持按二进制字母顺序对键空间进行批写入和迭代。

func New

func New(file string, cache int, handles int, namespace string, readonly bool) (*Database, error)

New返回一个包装的LevelDB对象。命名空间是度量报告用于呈现内部统计信息的前缀。

func NewCustom

func NewCustom(file string, namespace string, customize func(options *opt.Options)) (*Database, error)

NewCustom返回一个包装的LevelDB对象。命名空间是度量报告用于呈现内部统计信息的前缀。 自定义函数允许调用者修改leveldb选项

func (*Database) Close

func (db *Database) Close() error

Close停止度量集合,将所有挂起的数据刷新到磁盘,并关闭对底层键值存储的所有io访问。

func (*Database) Compact

func (db *Database) Compact(start []byte, limit []byte) error

func (*Database) Delete

func (db *Database) Delete(key []byte) error

Delete从键值存储中删除键。

func (*Database) Get

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

Get检索给定的键(如果它存在于键值存储中)。

func (*Database) IsHas

func (dbd *Database) IsHas(key []byte) (bool, error)

func (*Database) NewBatch

func (db *Database) NewBatch() typedb.Batch

NewBatch创建一个只写键值存储,该存储缓冲对其主机数据库的更改,直到调用最终写入。

func (*Database) NewBatchWithSize

func (db *Database) NewBatchWithSize(size int) typedb.Batch

NewBatchWithSize使用预先分配的缓冲区创建一个只写数据库批处理。

func (*Database) NewIterator

func (db *Database) NewIterator(prefix []byte, start []byte) typedb.Iterator

NewIterator在具有特定键前缀的数据库内容子集上创建一个二进制字母迭代器,从特定的初始键开始(如果不存在,则在其之后)。

func (*Database) Put

func (db *Database) Put(key []byte, value []byte) error

Put将给定值插入键值存储区。

func (*Database) Stat

func (db *Database) Stat(property string) (string, error)

Jump to

Keyboard shortcuts

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