hash

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func New

func New(c persistence.Config) (m *Manager, err *qerror.Error)

func (*Manager) Cover

func (m *Manager) Cover(dst, src []byte) *qerror.Error

Cover 将src覆盖至dst,若dst不存在则执行Rename, 若src不存在则返回error

func (*Manager) Del

func (m *Manager) Del(key []byte) *qerror.Error

Del 删除元素, 若不存在则返回error

func (*Manager) Dels

func (m *Manager) Dels(keys ...[]byte) int

Dels 删除元素集并返回成功的个数

func (*Manager) Exist

func (m *Manager) Exist(key []byte) bool

Exist 判断是否存在

func (*Manager) Get

func (m *Manager) Get(key []byte) template.Node

Get 获取元素

func (*Manager) Gets

func (m *Manager) Gets(keys ...[]byte) []template.Node

Gets 获取元素列表

func (*Manager) Iterators

func (m *Manager) Iterators(f func(Node) bool)

Iterators 从key开始进行迭代器遍历

func (*Manager) Regexp

func (m *Manager) Regexp(str []byte) [][]byte

Regexp 正则匹配并返回node列表

func (*Manager) Rename

func (m *Manager) Rename(dst, src []byte) *qerror.Error

Rename 重命名,若dst存在或src不存在则返回error

func (*Manager) Set

func (m *Manager) Set(key []byte, value template.Node) *qerror.Error

Set 添加kv至map,若key存在则返回error

func (*Manager) SetX

func (m *Manager) SetX(key []byte, value template.Node)

SetX 添加kv至map,若key存在则覆盖原值

func (*Manager) Size

func (m *Manager) Size() int

Size 返回数据库数据大小

func (*Manager) Update

func (m *Manager) Update(key []byte, value template.Node) *qerror.Error

Update 修改元素,若不存在则返回error

type Node

type Node interface {
	Key() []byte
	Hex() uint32
}

Jump to

Keyboard shortcuts

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