Documentation ¶
Index ¶
- func Do(cmdName string, args ...interface{}) (interface{}, error)
- func DoLua(luaStr string, keyCount int, keyAndArgs ...interface{}) (interface{}, error)
- func DoLuaInt(luaStr string, keyCount int, keyAndArgs ...interface{}) (int, error)
- func DoLuaInt64(luaStr string, keyCount int, keyAndArgs ...interface{}) (int64, error)
- func DoLuaUint(luaStr string, keyCount int, keyAndArgs ...interface{}) (uint32, error)
- func GetBool(cmdName string, args ...interface{}) (bool, error)
- func GetBytes(cmdName string, args ...interface{}) ([]byte, error)
- func GetInt(cmdName string, args ...interface{}) (int, error)
- func GetInt64(cmdName string, args ...interface{}) (int64, error)
- func GetRedisConn() goredis.Conn
- func GetString(cmdName string, args ...interface{}) (string, error)
- func GetStringMap(cmdName string, args ...interface{}) (map[string]string, error)
- func GetStrings(cmdName string, args ...interface{}) ([]string, error)
- func GetValues(cmdName string, args ...interface{}) ([]interface{}, error)
- func HGetall(key string, args interface{}) error
- func MSet(cmdName string, key string, arg interface{}) (interface{}, error)
- func NewRedisCache()
- func ReplyGet(cmdName string, reply interface{}, args ...interface{}) error
- func ScanSlice(cmdName string, args ...interface{}) error
- func ScanStruct(cmdName string, args ...interface{}) error
- func StructHMset(key string, arg interface{}) (interface{}, error)
- type RedisCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoLuaInt64 ¶
func GetRedisConn ¶
func GetStringMap ¶
func GetStrings ¶
func MSet ¶
/////////////////////////////////////////////////////// Hash 结构体操作 /////////////////////////////////////////////////////// 支持多k-v操作,需要指定key 例如:MSET,HMSET等 arg字段支持slice、map和struct
func ScanStruct ¶
Types ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
redis cache
func Connect ¶
func Connect() *RedisCache
func (*RedisCache) Do ¶
func (rc *RedisCache) Do(commandName string, args ...interface{}) (reply interface{}, err error)
/////////////////////////////////////////////////////// actually do the redis cmds
func (*RedisCache) GetMulti ¶
func (rc *RedisCache) GetMulti(keys []string) []interface{}
GetMulti get cache from redis.
func (*RedisCache) StartAndGC ¶
func (rc *RedisCache) StartAndGC(config string) error
config is like {"key":"collection key","conn":"connection info","dbNum":"0"} the cache item in redis are stored forever, so no gc operation.
Click to show internal directories.
Click to hide internal directories.