Documentation ¶
Index ¶
- func MemoryUsage(ctx context.Context, client redis.Cmdable, key string) (size int64, err error)
- func NewServiceScript(config interface{}) (res map[string]interface{}, err error)
- func ValueType(ctx context.Context, client redis.Cmdable, key string) (ValueType string, err error)
- type Arg
- type ArgCache
- type ClusterService
- func (this_ *ClusterService) Close()
- func (this_ *ClusterService) DelPattern(pattern string, args ...Arg) (count int, err error)
- func (this_ *ClusterService) GetClient(args ...Arg) (client redis.Cmdable, err error)
- func (this_ *ClusterService) GetValueInfo(key string, args ...Arg) (valueInfo *ValueInfo, err error)
- func (this_ *ClusterService) Keys(pattern string, args ...Arg) (keysResult *KeysResult, err error)
- func (this_ *ClusterService) ValueType(key string, args ...Arg) (valueType string, err error)
- type CmdService
- func (this_ *CmdService) BitCount(key string, args ...Arg) (count int64, err error)
- func (this_ *CmdService) BitSet(key string, offset int64, value int, args ...Arg) (err error)
- func (this_ *CmdService) Del(key string, args ...Arg) (count int, err error)
- func (this_ *CmdService) Exists(key string, args ...Arg) (res int64, err error)
- func (this_ *CmdService) Expire(key string, expire int64, args ...Arg) (res bool, err error)
- func (this_ *CmdService) Get(key string, args ...Arg) (value string, err error)
- func (this_ *CmdService) HashDel(key string, field string, args ...Arg) (err error)
- func (this_ *CmdService) HashGet(key string, field string, args ...Arg) (value string, err error)
- func (this_ *CmdService) HashGetAll(key string, args ...Arg) (value map[string]string, err error)
- func (this_ *CmdService) HashSet(key string, field string, value string, args ...Arg) (err error)
- func (this_ *CmdService) Info(args ...Arg) (res string, err error)
- func (this_ *CmdService) IsNotFound(err error) (res bool)
- func (this_ *CmdService) ListPush(key string, value string, args ...Arg) (err error)
- func (this_ *CmdService) ListRPush(key string, value string, args ...Arg) (err error)
- func (this_ *CmdService) ListRem(key string, count int64, value string, args ...Arg) (err error)
- func (this_ *CmdService) ListSet(key string, index int64, value string, args ...Arg) (err error)
- func (this_ *CmdService) Persist(key string, args ...Arg) (res bool, err error)
- func (this_ *CmdService) ScriptRun(src string, KEYS []string, ARGV interface{}, args ...Arg) (value interface{}, err error)
- func (this_ *CmdService) Set(key string, value string, args ...Arg) (err error)
- func (this_ *CmdService) SetAdd(key string, value string, args ...Arg) (err error)
- func (this_ *CmdService) SetCard(key string, args ...Arg) (res int64, err error)
- func (this_ *CmdService) SetRem(key string, value string, args ...Arg) (err error)
- func (this_ *CmdService) SetThrowNotFoundErr(ThrowNotFoundErr bool)
- func (this_ *CmdService) Ttl(key string, args ...Arg) (res int64, err error)
- type Config
- type IService
- type KeyInfo
- type KeysResult
- type Param
- type SizeArg
- type StartArg
- type V8Service
- func (this_ *V8Service) Close()
- func (this_ *V8Service) DelPattern(pattern string, args ...Arg) (count int, err error)
- func (this_ *V8Service) GetClient(args ...Arg) (client redis.Cmdable, err error)
- func (this_ *V8Service) GetValueInfo(key string, args ...Arg) (valueInfo *ValueInfo, err error)
- func (this_ *V8Service) Keys(pattern string, args ...Arg) (keysResult *KeysResult, err error)
- func (this_ *V8Service) ValueType(key string, args ...Arg) (valueType string, err error)
- type ValueInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MemoryUsage ¶ added in v0.0.7
func NewServiceScript ¶ added in v0.5.7
Types ¶
type ClusterService ¶ added in v0.0.7
type ClusterService struct { *Config *CmdService // contains filtered or unexported fields }
func (*ClusterService) Close ¶ added in v0.5.7
func (this_ *ClusterService) Close()
func (*ClusterService) DelPattern ¶ added in v0.0.7
func (this_ *ClusterService) DelPattern(pattern string, args ...Arg) (count int, err error)
func (*ClusterService) GetClient ¶ added in v0.0.7
func (this_ *ClusterService) GetClient(args ...Arg) (client redis.Cmdable, err error)
func (*ClusterService) GetValueInfo ¶ added in v0.0.8
func (this_ *ClusterService) GetValueInfo(key string, args ...Arg) (valueInfo *ValueInfo, err error)
func (*ClusterService) Keys ¶ added in v0.0.7
func (this_ *ClusterService) Keys(pattern string, args ...Arg) (keysResult *KeysResult, err error)
type CmdService ¶ added in v0.5.7
type CmdService struct { ThrowNotFoundErr bool GetClient func(param *Param) (client redis.Cmdable, err error) `json:"-"` }
func (*CmdService) BitCount ¶ added in v0.5.7
func (this_ *CmdService) BitCount(key string, args ...Arg) (count int64, err error)
func (*CmdService) Del ¶ added in v0.5.7
func (this_ *CmdService) Del(key string, args ...Arg) (count int, err error)
func (*CmdService) Exists ¶ added in v0.5.7
func (this_ *CmdService) Exists(key string, args ...Arg) (res int64, err error)
Exists key是否存在
func (*CmdService) Get ¶ added in v0.5.7
func (this_ *CmdService) Get(key string, args ...Arg) (value string, err error)
func (*CmdService) HashDel ¶ added in v0.5.7
func (this_ *CmdService) HashDel(key string, field string, args ...Arg) (err error)
func (*CmdService) HashGetAll ¶ added in v0.5.7
func (*CmdService) Info ¶ added in v0.5.7
func (this_ *CmdService) Info(args ...Arg) (res string, err error)
func (*CmdService) IsNotFound ¶ added in v1.2.15
func (this_ *CmdService) IsNotFound(err error) (res bool)
func (*CmdService) ListPush ¶ added in v0.5.7
func (this_ *CmdService) ListPush(key string, value string, args ...Arg) (err error)
func (*CmdService) ListRPush ¶ added in v0.5.7
func (this_ *CmdService) ListRPush(key string, value string, args ...Arg) (err error)
func (*CmdService) Persist ¶ added in v0.5.7
func (this_ *CmdService) Persist(key string, args ...Arg) (res bool, err error)
Persist 移除键的过期时间
func (*CmdService) ScriptRun ¶ added in v1.2.7
func (this_ *CmdService) ScriptRun(src string, KEYS []string, ARGV interface{}, args ...Arg) (value interface{}, err error)
func (*CmdService) Set ¶ added in v0.5.7
func (this_ *CmdService) Set(key string, value string, args ...Arg) (err error)
func (*CmdService) SetAdd ¶ added in v0.5.7
func (this_ *CmdService) SetAdd(key string, value string, args ...Arg) (err error)
func (*CmdService) SetCard ¶ added in v0.5.7
func (this_ *CmdService) SetCard(key string, args ...Arg) (res int64, err error)
func (*CmdService) SetRem ¶ added in v0.5.7
func (this_ *CmdService) SetRem(key string, value string, args ...Arg) (err error)
func (*CmdService) SetThrowNotFoundErr ¶ added in v1.2.15
func (this_ *CmdService) SetThrowNotFoundErr(ThrowNotFoundErr bool)
type IService ¶
type IService interface { // Close 关闭 redis 客户端 Close() // GetClient 获取 redis 指令客户端 GetClient(args ...Arg) (client redis.Cmdable, err error) // Info 获取 redis 信息 Info(args ...Arg) (res string, err error) // Keys 模糊 搜索 key,如 "xx*" 搜索 Keys(pattern string, args ...Arg) (keysResult *KeysResult, err error) // Expire 设置 key 过期时间 让给定键在指定的秒数之后过期 Expire(key string, expire int64, args ...Arg) (res bool, err error) // Ttl 查看给定键距离过期还有多少秒 Ttl(key string, args ...Arg) (res int64, err error) // Persist 移除键的过期时间 Persist(key string, args ...Arg) (res bool, err error) // Exists 判断 key 是否存在 Exists(key string, args ...Arg) (res int64, err error) ValueType(key string, args ...Arg) (valueType string, err error) // GetValueInfo 获取 key 的值信息 string、set、list、hash等值 多个值的情况下 使用 StartArg 和 SizeArg 查询一定数量的值 GetValueInfo(key string, args ...Arg) (valueInfo *ValueInfo, err error) // Get 获取 string 类型的值 Get(key string, args ...Arg) (value string, err error) // Set 设置 string 类型的值 Set(key string, value string, args ...Arg) (err error) // SetAdd 在 set 中 添加 string 类型的值 SetAdd(key string, value string, args ...Arg) (err error) // SetRem 在 set 中 移除 string 类型的值 SetRem(key string, value string, args ...Arg) (err error) // SetCard 在 set 中 移除 string 类型的值 SetCard(key string, args ...Arg) (res int64, err error) // ListPush 在 list 中 往 头部 追加 string 类型的值 ListPush(key string, value string, args ...Arg) (err error) // ListRPush 在 list 中 往 尾部 追加 string 类型的值 ListRPush(key string, value string, args ...Arg) (err error) // ListSet 在 list 中 往 某个 索引位 设置 string 类型的值 ListSet(key string, index int64, value string, args ...Arg) (err error) // ListRem 在 list 中 根据参数 COUNT 的值,移除列表中与参数 VALUE 相等的元素 count > 0 : 从表头开始向表尾搜索,移除与 VALUE 相等的元素,数量为 COUNT count < 0 : 从表尾开始向表头搜索,移除与 VALUE 相等的元素,数量为 COUNT 的绝对值 count = 0 : 移除表中所有与 VALUE 相等的值 ListRem(key string, count int64, value string, args ...Arg) (err error) // HashSet 在 hash 中 设置 字段 的值 HashSet(key string, field string, value string, args ...Arg) (err error) // HashGet 在 hash 中 获取 字段 的值 HashGet(key string, field string, args ...Arg) (value string, err error) // HashGetAll 在 hash 中 获取 所有 字段 的值 HashGetAll(key string, args ...Arg) (value map[string]string, err error) // HashDel 在 hash 中 删除 字段 的值 HashDel(key string, field string, args ...Arg) (err error) // Del 删除 某个 key Del(key string, args ...Arg) (count int, err error) // DelPattern 模糊删除 匹配 key DelPattern(pattern string, args ...Arg) (count int, err error) // BitSet 在 bitmap 中 设置 某个 位置的值 BitSet(key string, offset int64, value int, args ...Arg) (err error) // BitCount 在 bitmap 中 统计 所有 值 BitCount(key string, args ...Arg) (count int64, err error) ScriptRun(src string, KEYS []string, ARGV interface{}, args ...Arg) (value interface{}, err error) SetThrowNotFoundErr(ThrowNotFoundErr bool) IsNotFound(err error) (res bool) }
func NewClusterService ¶ added in v0.0.8
NewClusterService 创建集群客户端
func NewRedisService ¶ added in v0.0.8
NewRedisService 创建客户端
type KeysResult ¶ added in v0.0.7
func ClusterKeys ¶ added in v0.0.7
type StartArg ¶ added in v0.5.7
type StartArg struct {
Start int
}
func NewStartArg ¶ added in v0.5.7
type V8Service ¶ added in v0.0.7
type V8Service struct { *Config *CmdService // contains filtered or unexported fields }
func (*V8Service) DelPattern ¶ added in v0.0.7
func (*V8Service) GetValueInfo ¶ added in v0.0.8
type ValueInfo ¶ added in v0.0.7
type ValueInfo struct { Database int `json:"database"` Key string `json:"key"` ValueType string `json:"valueType"` Value interface{} `json:"value"` ValueCount int64 `json:"valueCount"` ValueStart int64 `json:"valueStart"` ValueEnd int64 `json:"valueEnd"` Cursor uint64 `json:"cursor"` MemoryUsage int64 `json:"memoryUsage"` TTL int64 `json:"ttl"` }
Click to show internal directories.
Click to hide internal directories.