redismodule

package
v1.17.5 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigRedis

type ConfigRedis struct {
	IP          string
	Port        int
	Password    string
	DbIndex     int
	MaxIdle     int //最大的空闲连接数,表示即使没有redis连接时依然可以保持N个空闲的连接,而不被清除,随时处于待命状态。
	MaxActive   int //最大的激活连接数,表示同时最多有N个连接
	IdleTimeout int //最大的空闲连接等待时间,超过此时间后,空闲连接将被关闭
}

ConfigRedis 服务器配置

type ErrorMapStringBool

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

type RedisModule

type RedisModule struct {
	service.Module
	// contains filtered or unexported fields
}

func (*RedisModule) DelHash

func (m *RedisModule) DelHash(args ...interface{}) error

func (*RedisModule) DelString

func (m *RedisModule) DelString(key interface{}) error

func (*RedisModule) DelStringKeyList

func (m *RedisModule) DelStringKeyList(keys []interface{}) (map[interface{}]bool, error)

func (*RedisModule) EXPlREInsert

func (m *RedisModule) EXPlREInsert(key string, TTl int) error

func (*RedisModule) ExistsKey

func (m *RedisModule) ExistsKey(key interface{}) (bool, error)

func (*RedisModule) GetAllHashJSON

func (m *RedisModule) GetAllHashJSON(redisKey string) (map[string]string, error)

GetRedisAllHashJSON ...

func (*RedisModule) GetHash

func (m *RedisModule) GetHash(redisKey interface{}, fieldKey interface{}) (string, error)

func (*RedisModule) GetListLen

func (m *RedisModule) GetListLen(key string) (int, error)

获取List的长度

func (*RedisModule) GetMuchHash

func (m *RedisModule) GetMuchHash(args ...interface{}) ([]string, error)

func (*RedisModule) GetString

func (m *RedisModule) GetString(key interface{}) (string, error)

func (*RedisModule) GetStringJSON

func (m *RedisModule) GetStringJSON(key string, st interface{}) error

func (*RedisModule) GetStringMap

func (m *RedisModule) GetStringMap(keys []string) (retMap map[string]string, err error)

func (*RedisModule) HGetStruct

func (m *RedisModule) HGetStruct(key string, out_val interface{}) error

func (*RedisModule) HSetStruct

func (m *RedisModule) HSetStruct(key string, val interface{}) error

func (*RedisModule) HincrbyHashInt

func (m *RedisModule) HincrbyHashInt(redisKey, hashKey string, value int) error

func (*RedisModule) Init

func (m *RedisModule) Init(redisCfg *ConfigRedis)

func (*RedisModule) Keys

func (m *RedisModule) Keys(key string) ([]string, error)

func (*RedisModule) LPushList

func (m *RedisModule) LPushList(args ...interface{}) error

func (*RedisModule) LPushListJSON

func (m *RedisModule) LPushListJSON(key interface{}, value ...interface{}) error

func (*RedisModule) LRange

func (m *RedisModule) LRange(key string, start, stop int) ([]byte, error)

func (*RedisModule) LRangeJSON

func (m *RedisModule) LRangeJSON(key string, start, stop int, data interface{}) error

func (*RedisModule) LRangeList

func (m *RedisModule) LRangeList(key string, start, end int) ([]string, error)

Lrange ...

func (*RedisModule) LTrimList

func (m *RedisModule) LTrimList(key string, start, end int) error

func (*RedisModule) ListPop

func (m *RedisModule) ListPop(key string, fromLeft, block bool, timeout int) ([]byte, error)

弹出list(消息队列)数据 fromLeft表示是否从左侧弹出 block表示是否阻塞 timeout表示阻塞超时

func (*RedisModule) ListPopJson

func (m *RedisModule) ListPopJson(key string, fromLeft, block bool, timeout int, out interface{}) error

弹出list(消息队列)数据,数据放入out fromLeft表示是否从左侧弹出 block表示是否阻塞 timeout表示阻塞超时

func (*RedisModule) RPOPListValue

func (m *RedisModule) RPOPListValue(key string) (string, error)

弹出List最后条记录

func (*RedisModule) RPushList

func (m *RedisModule) RPushList(args ...interface{}) error

func (*RedisModule) RPushListJSON

func (m *RedisModule) RPushListJSON(key interface{}, value ...interface{}) error

func (*RedisModule) ScanMatchKeys

func (m *RedisModule) ScanMatchKeys(cursorValue int, redisKey string, count int) (int, []string, error)

func (*RedisModule) SetHash

func (m *RedisModule) SetHash(redisKey, hashKey, value interface{}) error

func (*RedisModule) SetHashMapJSON

func (m *RedisModule) SetHashMapJSON(redisKey string, mapFieldValue map[interface{}]interface{}) error

func (*RedisModule) SetMuchStringExpire

func (m *RedisModule) SetMuchStringExpire(mapInfo map[interface{}]interface{}, ex string) (err error)

func (*RedisModule) SetString

func (m *RedisModule) SetString(key, value interface{}) (err error)

func (*RedisModule) SetStringExpire

func (m *RedisModule) SetStringExpire(key, value, expire string) (err error)

func (*RedisModule) SetStringJSON

func (m *RedisModule) SetStringJSON(key interface{}, val interface{}) (err error)

func (*RedisModule) SetStringJSONExpire

func (m *RedisModule) SetStringJSONExpire(key interface{}, val interface{}, expire string) (err error)

func (*RedisModule) SetStringMap

func (m *RedisModule) SetStringMap(mapInfo map[interface{}]interface{}) (err error)

func (*RedisModule) TestPingRedis

func (m *RedisModule) TestPingRedis() error

func (*RedisModule) ZADDInsert

func (m *RedisModule) ZADDInsert(key string, score float64, Data interface{}) error

有序集合插入

func (*RedisModule) ZADDInsertJson

func (m *RedisModule) ZADDInsertJson(key string, score float64, value interface{}) error

有序集合插入Json

func (*RedisModule) ZREM

func (m *RedisModule) ZREM(key string, member interface{}) (int, error)

func (*RedisModule) ZREMMulti

func (m *RedisModule) ZREMMulti(key string, member ...interface{}) (int, error)

func (*RedisModule) ZREMRANGEBYSCORE

func (m *RedisModule) ZREMRANGEBYSCORE(key string, start, stop interface{}) error

func (*RedisModule) ZRange

func (m *RedisModule) ZRange(key string, start, stop int, ascend bool, withScores bool) ([]byte, error)

取有序set指定排名 ascend=true表示按升序遍历 否则按降序遍历

func (*RedisModule) ZRangeByScore

func (m *RedisModule) ZRangeByScore(key string, start, stop float64, ascend bool, withScores bool) ([]byte, error)

func (*RedisModule) ZRangeByScoreJSON

func (m *RedisModule) ZRangeByScoreJSON(key string, start, stop float64, ascend bool, withScores bool, data interface{}) error

func (*RedisModule) ZRangeJSON

func (m *RedisModule) ZRangeJSON(key string, start, stop int, ascend bool, withScores bool, data interface{}) error

func (*RedisModule) ZRank

func (m *RedisModule) ZRank(key string, member interface{}, ascend bool) (int, error)

获取指定member的排名

func (*RedisModule) ZScore

func (m *RedisModule) ZScore(key string, member interface{}) (float64, error)

获取指定member的排名

func (*RedisModule) Zcard

func (m *RedisModule) Zcard(key string) (int, error)

获取有序集合长度

func (*RedisModule) Zremrangebyrank

func (m *RedisModule) Zremrangebyrank(redisKey string, start, end interface{}) (int, error)

type RetError

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

func (*RetError) Get

func (slf *RetError) Get() error

type RetMapString

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

func (*RetMapString) Get

func (slf *RetMapString) Get() (error, map[string]bool)

type ZSetDataWithScore

type ZSetDataWithScore struct {
	Data  json.RawMessage `json:"data"`
	Score float64         `json:"score"`
}

Jump to

Keyboard shortcuts

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