data_helper

package
v0.0.0-...-96e313d Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisPlugin

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

func (*RedisPlugin) BatchDeleteKeys

func (r *RedisPlugin) BatchDeleteKeys(ctx context.Context, keys []string) (int64, error)

BatchDeleteKeys 批量删除Key对应的缓存

func (*RedisPlugin) BatchGetValue

func (r *RedisPlugin) BatchGetValue(ctx context.Context, keys []string, p reflect.Type) (interface{}, error)

BatchGetValue 批量获取缓存值

func (*RedisPlugin) BatchKeyExist

func (r *RedisPlugin) BatchKeyExist(ctx context.Context, keys []string) (bool, error)

BatchKeyExist 批量判断Key是否存在于缓存中

func (*RedisPlugin) BatchSetValue

func (r *RedisPlugin) BatchSetValue(ctx context.Context, pairs []util.Pair) error

BatchSetValue 批量插入

func (*RedisPlugin) CleanCache

func (r *RedisPlugin) CleanCache(ctx context.Context) (int64, error)

CleanCache 清空缓存

func (*RedisPlugin) DeleteKey

func (r *RedisPlugin) DeleteKey(ctx context.Context, key string) (int64, error)

DeleteKey 删除Key对应的缓存

func (*RedisPlugin) DeleteKeysWithPrefix

func (r *RedisPlugin) DeleteKeysWithPrefix(ctx context.Context, keyPrefix string) (int64, error)

DeleteKeysWithPrefix 通过前缀删除对应的缓存

func (*RedisPlugin) GetValue

func (r *RedisPlugin) GetValue(ctx context.Context, key string, ptr interface{}) error

GetValue 通过Key获取Value

func (*RedisPlugin) Init

func (r *RedisPlugin) Init(conf *config.CacheConfig, prefix string) error

func (*RedisPlugin) InitScripts

func (r *RedisPlugin) InitScripts() error

InitScripts 预加载部分可能用的到的脚本到Redis

func (*RedisPlugin) KeyExist

func (r *RedisPlugin) KeyExist(ctx context.Context, key string) (int64, error)

KeyExist 判断一个Key是否存在

func (*RedisPlugin) SetBitValue

func (r *RedisPlugin) SetBitValue(ctx context.Context, offsets []int64) error

SetBitValue 布隆过滤器-设置Bit

func (*RedisPlugin) SetValue

func (r *RedisPlugin) SetValue(ctx context.Context, key string, value interface{}) error

SetValue 通过Key设置Value

func (*RedisPlugin) Test

func (r *RedisPlugin) Test(ctx context.Context, offsets []int64) (bool, error)

Test 布隆过滤器-测试

type TangCacheInterface

type TangCacheInterface interface {
	Init(conf *config.CacheConfig, prefix string) error
	InitScripts() error
	CleanCache(ctx context.Context) (int64, error)
	BatchKeyExist(ctx context.Context, keys []string) (bool, error)
	KeyExist(ctx context.Context, key string) (int64, error)
	GetValue(ctx context.Context, key string, ptr interface{}) error
	SetValue(ctx context.Context, key string, value interface{}) error
	BatchGetValue(ctx context.Context, keys []string, p reflect.Type) (interface{}, error)
	BatchSetValue(ctx context.Context, pairs []util.Pair) error
	DeleteKey(ctx context.Context, key string) (int64, error)
	BatchDeleteKeys(ctx context.Context, keys []string) (int64, error)
	DeleteKeysWithPrefix(ctx context.Context, keyPrefix string) (int64, error)
	SetBitValue(ctx context.Context, offsets []int64) error
	Test(ctx context.Context, offsets []int64) (bool, error)
}

Jump to

Keyboard shortcuts

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