data

package
v0.0.0-...-b988991 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	E_DATAACTION_LIKE = iota
	E_DATAACTION_MATCH
	E_DATAACTION_SET
	E_DATAACTION_TRUNCATE
	E_DATAACTION_DEL
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomDataAction

type CustomDataAction func(client, userData interface{}) (*QueryResultS, error)

自定义数据操作

type DataActionInfoS

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

数据操作

type DataActionType

type DataActionType int

type DataMgrI

type DataMgrI interface {
	// 数据加载
	Load() error
	// 添加
	Set(key string, data proto.DataMetaI)
	// key匹配数据查询
	Like(key string, dataSetType proto.DataSetType, queryCount int) *singlylinkedlist.List
	// key完全匹配查询
	Match(key string, dataSetType proto.DataSetType, queryCount int) *singlylinkedlist.List
	// 删除key
	Delete(key string, data proto.DataMetaI)
	// 修改key
	Modify(oldKey, newKey string, oldData, newData proto.DataMetaI)
	// 清除所有数据
	Truncate()
	// 重新加载数据
	Reload() error
}
var (
	GDataMgr DataMgrI = nil
)

func CreateDataMgr

func CreateDataMgr(name string) DataMgrI

type QueryResultS

type QueryResultS struct {
	Ok     bool
	Result *singlylinkedlist.List
}

数据查询结果

type RedisDataBucket

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

type RedisDataMgr

type RedisDataMgr struct {
	RedisDataBuckets []*RedisDataBucket //
	// contains filtered or unexported fields
}

func (*RedisDataMgr) Delete

func (redisMgr *RedisDataMgr) Delete(key string, data proto.DataMetaI)

func (*RedisDataMgr) Like

func (redisMgr *RedisDataMgr) Like(key string, dataSetType proto.DataSetType, queryCount int) *singlylinkedlist.List

基于key的模糊查询

func (*RedisDataMgr) Load

func (redisMgr *RedisDataMgr) Load() error

func (*RedisDataMgr) Match

func (redisMgr *RedisDataMgr) Match(key string, dataSetType proto.DataSetType, queryCount int) *singlylinkedlist.List

func (*RedisDataMgr) Modify

func (redisMgr *RedisDataMgr) Modify(oldKey, newKey string, oldData, newData proto.DataMetaI)

func (*RedisDataMgr) Reload

func (redisMgr *RedisDataMgr) Reload() error

func (*RedisDataMgr) Set

func (redisMgr *RedisDataMgr) Set(key string, data proto.DataMetaI)

func (*RedisDataMgr) Truncate

func (redisMgr *RedisDataMgr) Truncate()

Jump to

Keyboard shortcuts

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