redismodule

package
v0.0.0-...-a538cea Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

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 (slf *RedisModule) DelHash(args ...interface{}) error

func (*RedisModule) DelString

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

func (*RedisModule) DelStringKeyList

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

func (*RedisModule) EXPlREInsert

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

func (*RedisModule) ExistsKey

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

func (*RedisModule) GetAllHashJSON

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

GetRedisAllHashJSON ...

func (*RedisModule) GetHash

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

func (*RedisModule) GetListLen

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

获取List的长度

func (*RedisModule) GetMuchHash

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

func (*RedisModule) GetString

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

func (*RedisModule) GetStringJSON

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

func (*RedisModule) GetStringMap

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

func (*RedisModule) HincrbyHashInt

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

func (*RedisModule) Init

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

func (*RedisModule) Keys

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

func (*RedisModule) LPushList

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

func (*RedisModule) LPushListJSON

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

func (*RedisModule) LRange

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

func (*RedisModule) LRangeJSON

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

func (*RedisModule) LRangeList

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

Lrange ...

func (*RedisModule) LTrimList

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

func (*RedisModule) ListPop

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

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

func (*RedisModule) ListPopJson

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

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

func (*RedisModule) RPOPListValue

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

弹出List最后条记录

func (*RedisModule) RPushList

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

func (*RedisModule) RPushListJSON

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

func (*RedisModule) ScanMatchKeys

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

func (*RedisModule) SetHash

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

func (*RedisModule) SetHashMapJSON

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

func (*RedisModule) SetMuchStringExpire

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

func (*RedisModule) SetString

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

func (*RedisModule) SetStringExpire

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

func (*RedisModule) SetStringJSON

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

func (*RedisModule) SetStringJSONExpire

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

func (*RedisModule) SetStringMap

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

func (*RedisModule) TestPingRedis

func (slf *RedisModule) TestPingRedis() error

func (*RedisModule) ZADDInsert

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

有序集合插入

func (*RedisModule) ZADDInsertJson

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

有序集合插入Json

func (*RedisModule) ZREM

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

func (*RedisModule) ZREMMulti

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

func (*RedisModule) ZREMRANGEBYSCORE

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

func (*RedisModule) ZRange

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

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

func (*RedisModule) ZRangeByScore

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

func (*RedisModule) ZRangeByScoreJSON

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

func (*RedisModule) ZRangeJSON

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

func (*RedisModule) ZRank

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

获取指定member的排名

func (*RedisModule) ZScore

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

获取指定member的排名

func (*RedisModule) Zcard

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

获取有序集合长度

func (*RedisModule) Zremrangebyrank

func (slf *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