Documentation ¶
Index ¶
- Constants
- func CloseRedisPool()
- func DecrbyKey(ctx context.Context, name, key string, number int64) (num int64, err error)
- func DeleteKey(ctx context.Context, name string, key string) error
- func DeleteRedisLockKey(ctx context.Context, key, lockName string, name ...string) (bool, error)
- func ExistsKey(ctx context.Context, name, key string) (bool, error)
- func ExpireKey(ctx context.Context, name, key string, expire int64) error
- func GetBitmapKey(ctx context.Context, name, key string, offset int) (int, error)
- func GetKey(ctx context.Context, name, key string) (interface{}, error)
- func GetRedisConnect(ctx context.Context, redisConfig gin_config.RedisConf) (redis.Conn, error)
- func HDelMapKey(ctx context.Context, name, mapKey, key string) (err error)
- func HGetMapKey(ctx context.Context, name, mapKey, key string) (value string, err error)
- func HMGetMapKey(ctx context.Context, name, mapKey string, args []interface{}) (data []string, err error)
- func HMSetMapKey(ctx context.Context, name, mapKey string, args []interface{}) (err error)
- func HSetMapKey(ctx context.Context, name, mapKey, key, value string) (err error)
- func IncrbyKey(ctx context.Context, name, key string, number int64) (num int64, err error)
- func InitRedis()
- func MGetKey(ctx context.Context, name string, keys []string) (interface{}, error)
- func MSetKey(ctx context.Context, name string, keys []string) error
- func ResetExpireRedisLockKey(ctx context.Context, key, lockName string, time int, name ...string) (bool, error)
- func ScriptDecrbyKey(ctx context.Context, key string, number int, name ...string) (bool, error)
- func ScriptIncrbyKey(ctx context.Context, key string, number int, name ...string) (bool, error)
- func SendScrip(ctx context.Context, scriptString string, keyCount int, name ...string) (string, error)
- func SetBitmapKey(ctx context.Context, name, key string, offset, value int) error
- func SetKeyValue(ctx context.Context, name, key string, value interface{}, expire ...int) (err error)
- func SetRedisLockKey(ctx context.Context, key, lockName string, time int, name ...string) (bool, error)
- func TtlKey(ctx context.Context, name, key string) (int64, error)
- func UseRedis(name ...string) *redis.Pool
Constants ¶
const ( ScriptLock = `` /* 203-byte string literal not displayed */ ScriptExpire = `` /* 217-byte string literal not displayed */ ScriptDecrby = `` /* 232-byte string literal not displayed */ ScriptIncrby = `` /* 218-byte string literal not displayed */ ScriptDelete = `` /* 200-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func DeleteRedisLockKey ¶
DeleteRedisLockKey **** 删除分布式锁 name:redis名称 key:删除key lockName: 锁名字 返回 int *****//
func GetBitmapKey ¶
GetBitmapKey **** 获取bitmap name:redis名称 key:删除key offset:偏移量 返回 int error *****//
func GetRedisConnect ¶
func HDelMapKey ¶ added in v0.0.38
HDelMapKey 获取map值
func HGetMapKey ¶ added in v0.0.38
HGetMapKey 获取map值
func HMGetMapKey ¶ added in v0.0.38
func HMGetMapKey(ctx context.Context, name, mapKey string, args []interface{}) (data []string, err error)
HMGetMapKey 设置map值
func HMSetMapKey ¶ added in v0.0.38
HMSetMapKey 设置map值
func HSetMapKey ¶ added in v0.0.38
HSetMapKey 设置map值
func ResetExpireRedisLockKey ¶
func ResetExpireRedisLockKey(ctx context.Context, key, lockName string, time int, name ...string) (bool, error)
ResetExpireRedisLockKey **** 续费分布式锁 name:redis名称 key:删除key lockName: 锁名字 返回 int *****//
func ScriptDecrbyKey ¶ added in v0.0.37
ScriptDecrbyKey **** redis 脚本减少库存 *****//
func ScriptIncrbyKey ¶ added in v0.0.37
ScriptIncrbyKey **** redis 脚本增加库存 *****//
func SendScrip ¶ added in v0.0.37
func SendScrip(ctx context.Context, scriptString string, keyCount int, name ...string) (string, error)
SendScrip **** redis 上传脚本 不执行 *****//
func SetBitmapKey ¶
SetBitmapKey **** 设置bitmap name:redis名称 key:删除key offset:偏移量 value:只能0,1 返回 error *****//
func SetKeyValue ¶
func SetKeyValue(ctx context.Context, name, key string, value interface{}, expire ...int) (err error)
SetKeyValue **** 设置name:redis名称 key:查询的key value:设定的值 expire:存在时间 返回 error *****//
func SetRedisLockKey ¶
func SetRedisLockKey(ctx context.Context, key, lockName string, time int, name ...string) (bool, error)
SetRedisLockKey **** 设置分布式锁 name:redis名称 key:值 lockName: 锁名字 time: 锁存在时间 返回 error *****//
Types ¶
This section is empty.