Documentation ¶
Index ¶
- type RedisCacheService
- func (service *RedisCacheService) Del(key string) error
- func (service *RedisCacheService) Dels(keys []string) error
- func (service *RedisCacheService) Exists(key string) (bool, error)
- func (service *RedisCacheService) Get(key string) ([]byte, error)
- func (service *RedisCacheService) HDel(key string, fields ...[]byte) (int64, error)
- func (service *RedisCacheService) HExists(key string, field []byte) (bool, error)
- func (service *RedisCacheService) HGet(key string, field []byte) ([]byte, error)
- func (service *RedisCacheService) HGetAll(key string) ([][]byte, error)
- func (service *RedisCacheService) HKeys(key string) ([][]byte, error)
- func (service *RedisCacheService) HLen(key string) (int64, error)
- func (service *RedisCacheService) HMGet(key string, fields ...[]byte) ([][]byte, error)
- func (service *RedisCacheService) HMSet(key string, ttl int64, args ...[]byte) error
- func (service *RedisCacheService) HSet(key string, ttl int64, field string, value []byte) error
- func (service *RedisCacheService) HVals(key string) ([][]byte, error)
- func (service *RedisCacheService) Initialize(redisCfg interface{}, l log.Logger)
- func (service *RedisCacheService) Keys(keyFormat string) ([][]byte, error)
- func (service *RedisCacheService) LIndex(key string, index int64) ([]byte, error)
- func (service *RedisCacheService) LLpop(key string) ([]byte, error)
- func (service *RedisCacheService) LLpush(key string, args ...[]byte) (int64, error)
- func (service *RedisCacheService) LRpop(key string) ([]byte, error)
- func (service *RedisCacheService) LRpush(key string, args ...[]byte) (int64, error)
- func (service *RedisCacheService) Mget(keys []string) ([][]byte, error)
- func (service *RedisCacheService) Mset(keyvalues [][2][]byte, ttl int64) error
- func (service *RedisCacheService) SAdd(key string, ttl int64, members ...[]byte) error
- func (service *RedisCacheService) SCard(key string) (int64, error)
- func (service *RedisCacheService) SIsMember(key string, member []byte) (bool, error)
- func (service *RedisCacheService) SMembers(key string) ([][]byte, error)
- func (service *RedisCacheService) SRem(key string, members ...[]byte) (int64, error)
- func (service *RedisCacheService) Set(key string, value []byte, ttl int64) error
- func (service *RedisCacheService) SetNX(key string, value []byte, ttl int64) (interface{}, error)
- func (service *RedisCacheService) Start()
- func (service *RedisCacheService) Stop()
- func (service *RedisCacheService) ZAdd(key string, ttl int64, args ...[]byte) error
- func (service *RedisCacheService) ZCard(key string) (int64, error)
- func (service *RedisCacheService) ZCount(key string, min, max interface{}) (int64, error)
- func (service *RedisCacheService) ZRange(key string, start, stop int64, withScores bool) ([][]byte, error)
- func (service *RedisCacheService) ZRangeByScore(key string, min, max interface{}, withScores bool) ([][]byte, error)
- func (service *RedisCacheService) ZRank(key string, member []byte) (int64, error)
- func (service *RedisCacheService) ZRem(key string, args ...[]byte) (int64, error)
- func (service *RedisCacheService) ZRemRangeByScore(key string, start, stop int64) (int64, error)
- func (service *RedisCacheService) ZRevRange(key string, start, stop int64, withScores bool) ([][]byte, error)
- func (service *RedisCacheService) ZRevRank(key string, member []byte) (int64, error)
- type RedisOptions
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisCacheService ¶
type RedisCacheService struct {
// contains filtered or unexported fields
}
RedisCacheService redis service define
func (*RedisCacheService) Del ¶
func (service *RedisCacheService) Del(key string) error
func (*RedisCacheService) Dels ¶
func (service *RedisCacheService) Dels(keys []string) error
func (*RedisCacheService) Exists ¶
func (service *RedisCacheService) Exists(key string) (bool, error)
func (*RedisCacheService) HDel ¶
func (service *RedisCacheService) HDel(key string, fields ...[]byte) (int64, error)
func (*RedisCacheService) HExists ¶
func (service *RedisCacheService) HExists(key string, field []byte) (bool, error)
func (*RedisCacheService) HGet ¶
func (service *RedisCacheService) HGet(key string, field []byte) ([]byte, error)
func (*RedisCacheService) HGetAll ¶
func (service *RedisCacheService) HGetAll(key string) ([][]byte, error)
func (*RedisCacheService) HKeys ¶
func (service *RedisCacheService) HKeys(key string) ([][]byte, error)
func (*RedisCacheService) HMGet ¶
func (service *RedisCacheService) HMGet(key string, fields ...[]byte) ([][]byte, error)
func (*RedisCacheService) HMSet ¶
func (service *RedisCacheService) HMSet(key string, ttl int64, args ...[]byte) error
func (*RedisCacheService) HVals ¶
func (service *RedisCacheService) HVals(key string) ([][]byte, error)
func (*RedisCacheService) Initialize ¶
func (service *RedisCacheService) Initialize(redisCfg interface{}, l log.Logger)
Initialize redis service init
func (*RedisCacheService) Keys ¶
func (service *RedisCacheService) Keys(keyFormat string) ([][]byte, error)
func (*RedisCacheService) LIndex ¶
func (service *RedisCacheService) LIndex(key string, index int64) ([]byte, error)
func (*RedisCacheService) LLpop ¶
func (service *RedisCacheService) LLpop(key string) ([]byte, error)
func (*RedisCacheService) LLpush ¶
func (service *RedisCacheService) LLpush(key string, args ...[]byte) (int64, error)
func (*RedisCacheService) LRpop ¶
func (service *RedisCacheService) LRpop(key string) ([]byte, error)
func (*RedisCacheService) LRpush ¶
func (service *RedisCacheService) LRpush(key string, args ...[]byte) (int64, error)
-----------------list operation--------------------
func (*RedisCacheService) Mget ¶
func (service *RedisCacheService) Mget(keys []string) ([][]byte, error)
func (*RedisCacheService) Mset ¶
func (service *RedisCacheService) Mset(keyvalues [][2][]byte, ttl int64) error
func (*RedisCacheService) SAdd ¶
func (service *RedisCacheService) SAdd(key string, ttl int64, members ...[]byte) error
-----------------set operation---------------------
func (*RedisCacheService) SCard ¶
func (service *RedisCacheService) SCard(key string) (int64, error)
func (*RedisCacheService) SIsMember ¶
func (service *RedisCacheService) SIsMember(key string, member []byte) (bool, error)
func (*RedisCacheService) SMembers ¶
func (service *RedisCacheService) SMembers(key string) ([][]byte, error)
func (*RedisCacheService) SRem ¶
func (service *RedisCacheService) SRem(key string, members ...[]byte) (int64, error)
func (*RedisCacheService) Set ¶
func (service *RedisCacheService) Set(key string, value []byte, ttl int64) error
when set exist key, old key ttl must reset it
func (*RedisCacheService) SetNX ¶
func (service *RedisCacheService) SetNX(key string, value []byte, ttl int64) (interface{}, error)
-----------------string operation------------------
func (*RedisCacheService) ZAdd ¶
func (service *RedisCacheService) ZAdd(key string, ttl int64, args ...[]byte) error
-----------------zset operation-------------------
func (*RedisCacheService) ZCard ¶
func (service *RedisCacheService) ZCard(key string) (int64, error)
func (*RedisCacheService) ZCount ¶
func (service *RedisCacheService) ZCount(key string, min, max interface{}) (int64, error)
func (*RedisCacheService) ZRangeByScore ¶
func (service *RedisCacheService) ZRangeByScore(key string, min, max interface{}, withScores bool) ([][]byte, error)
func (*RedisCacheService) ZRank ¶
func (service *RedisCacheService) ZRank(key string, member []byte) (int64, error)
func (*RedisCacheService) ZRem ¶
func (service *RedisCacheService) ZRem(key string, args ...[]byte) (int64, error)
func (*RedisCacheService) ZRemRangeByScore ¶
func (service *RedisCacheService) ZRemRangeByScore(key string, start, stop int64) (int64, error)
type RedisOptions ¶
type Service ¶
type Service interface { // string Set(key string, value []byte, ttl int64) error Get(key string) ([]byte, error) Mset(keyvalues [][2][]byte, ttl int64) error Mget(keys []string) ([][]byte, error) Exists(key string) (bool, error) Del(key string) error Dels(keys []string) error Keys(keyFormat string) ([][]byte, error) // set SAdd(key string, ttl int64, members ...[]byte) error SRem(key string, members ...[]byte) (int64, error) SCard(key string) (int64, error) SIsMember(key string, member []byte) (bool, error) SMembers(key string) ([][]byte, error) // zset ZAdd(key string, ttl int64, args ...[]byte) error ZRem(key string, args ...[]byte) (int64, error) ZCard(key string) (int64, error) ZRank(key string, member []byte) (int64, error) ZRevRank(key string, member []byte) (int64, error) ZRange(key string, start, stop int64, withScores bool) ([][]byte, error) ZRangeByScore(key string, min, max interface{}, withScores bool) ([][]byte, error) ZRevRange(key string, start, stop int64, withScores bool) ([][]byte, error) // hash HSet(key string, ttl int64, field string, value []byte) error HGet(key string, field []byte) ([]byte, error) HMSet(key string, ttl int64, args ...[]byte) error HMGet(key string, fields ...[]byte) ([][]byte, error) HDel(key string, fields ...[]byte) (int64, error) HExists(key string, field []byte) (bool, error) HKeys(key string) ([][]byte, error) HVals(key string) ([][]byte, error) HGetAll(key string) ([][]byte, error) HLen(key string) (int64, error) // list LRpush(key string, args ...[]byte) (int64, error) LLpush(key string, args ...[]byte) (int64, error) LRpop(key string) ([]byte, error) LLpop(key string) ([]byte, error) LIndex(key string, index int64) ([]byte, error) }
Service implement interface for redis servece
Click to show internal directories.
Click to hide internal directories.