Documentation ¶
Index ¶
- type Database
- func (db *Database) Close() error
- func (db *Database) Compact(start []byte, limit []byte) error
- func (db *Database) Delete(key []byte) error
- func (db *Database) Get(key []byte) ([]byte, error)
- func (dbd *Database) IsHas(key []byte) (bool, error)
- func (db *Database) NewBatch() typedb.Batch
- func (db *Database) NewBatchWithSize(size int) typedb.Batch
- func (db *Database) NewIterator(prefix []byte, start []byte) typedb.Iterator
- func (db *Database) Put(key []byte, value []byte) error
- func (db *Database) Stat(property string) (string, error)
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 NewCustom ¶
func NewCustom(file string, namespace string, customize func(options *opt.Options)) (*Database, error)
NewCustom返回一个包装的LevelDB对象。命名空间是度量报告用于呈现内部统计信息的前缀。 自定义函数允许调用者修改leveldb选项
func (*Database) NewBatchWithSize ¶
NewBatchWithSize使用预先分配的缓冲区创建一个只写数据库批处理。
func (*Database) NewIterator ¶
NewIterator在具有特定键前缀的数据库内容子集上创建一个二进制字母迭代器,从特定的初始键开始(如果不存在,则在其之后)。
Click to show internal directories.
Click to hide internal directories.