Documentation ¶
Index ¶
- type RedisHandler
- func (r *RedisHandler) Delete(key string) (bool, error)
- func (r *RedisHandler) Exists(key string) bool
- func (r *RedisHandler) Get(key string) ([]byte, error)
- func (r *RedisHandler) GetInt(key string) (int, error)
- func (r *RedisHandler) GetString(key string) (string, error)
- func (r *RedisHandler) GetSumLikeKeys(key string) (int, error)
- func (r *RedisHandler) Incr(key string) (int, error)
- func (r *RedisHandler) Init(url, auth string, db, maxIdle, maxActive, idleTimeout int) error
- func (r *RedisHandler) LikeDeletes(key string) error
- func (r *RedisHandler) Set(key string, data interface{}, time int) error
- func (r *RedisHandler) SetVal(key, value interface{}, time int) error
- func (r *RedisHandler) Ttl(key string) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisHandler ¶
RedisHandler 处理Redis连接的对象
func NewRedisHandler ¶
func NewRedisHandler() *RedisHandler
NewRedisHandler 创建RedisHandler @return *RedisHandler
func (*RedisHandler) Delete ¶
func (r *RedisHandler) Delete(key string) (bool, error)
Delete delete a kye
func (*RedisHandler) GetInt ¶
func (r *RedisHandler) GetInt(key string) (int, error)
GetInt 根据key获得一个int的value @param key @return int @return error
func (*RedisHandler) GetString ¶
func (r *RedisHandler) GetString(key string) (string, error)
GetString 根据key获得一个string的value @param key @return string @return error
func (*RedisHandler) GetSumLikeKeys ¶
func (r *RedisHandler) GetSumLikeKeys(key string) (int, error)
GetSumLikeKeys - get the sum of all likely keys value
func (*RedisHandler) Init ¶
func (r *RedisHandler) Init(url, auth string, db, maxIdle, maxActive, idleTimeout int) error
Init 初始化一个Redis连接 @param url @param auth @param db @param maxIdle @param maxActive @param idleTimeout @return error
func (*RedisHandler) LikeDeletes ¶
func (r *RedisHandler) LikeDeletes(key string) error
LikeDeletes batch delete
func (*RedisHandler) Set ¶
func (r *RedisHandler) Set(key string, data interface{}, time int) error
Set json
func (*RedisHandler) SetVal ¶
func (r *RedisHandler) SetVal(key, value interface{}, time int) error
SetVal 往Redis Set一个值 @param key @param value @param time @return error
Click to show internal directories.
Click to hide internal directories.