Documentation ¶
Index ¶
- Constants
- Variables
- func Close()
- func Get(table RedisDatabase, prefix, key string) (value interface{}, err error)
- func GetBytes(key string, start int64, end int64) ([]byte, error)
- func HDel(table RedisDatabase, prefix, key string, fields []string) (int64, error)
- func HGet(table RedisDatabase, prefix, key, field string) (string, error)
- func HGetAll(table RedisDatabase, prefix, key string) (map[string]string, error)
- func HGetInt64(table RedisDatabase, prefix, key, field string) (int64, error)
- func HIncrBy(table RedisDatabase, prefix, key, field string, incr int64) (int64, error)
- func HMGet(table RedisDatabase, prefix, key string, fields []string) (map[string]interface{}, error)
- func HMSet(table RedisDatabase, prefix, key string, fields map[string]interface{}) (string, error)
- func HSet(table RedisDatabase, prefix, key, field string, value interface{}) (bool, error)
- func HasRedisClient() bool
- func IncrBy(table RedisDatabase, prefix, key string, value int64) (int64, error)
- func Initialize(cfg *config.CacheConfig)
- func Invalid(table RedisDatabase, key string) (err error)
- func Keys(table RedisDatabase, pattern string) ([]string, error)
- func MGet(table RedisDatabase, prefix string, keys []string) ([]interface{}, error)
- func MSet(table RedisDatabase, prefix string, pairs map[string]interface{}) (string, error)
- func Remove(table RedisDatabase, prefix, key string) (err error)
- func Set(table RedisDatabase, prefix, key string, value interface{}) (err error)
- func SetBytes(key string, value []byte) (err error)
- type RedisCli
- func (cli *RedisCli) Close() error
- func (cli *RedisCli) Del(key string) (int64, error)
- func (cli *RedisCli) Expire(key string, expire int64) (bool, error)
- func (cli *RedisCli) Get(key string) (val []byte, err error)
- func (cli *RedisCli) GetRange(key string, start, end int64) (val []byte, err error)
- func (cli *RedisCli) HDel(key string, fields []string) (val int64, err error)
- func (cli *RedisCli) HGet(key, field string) (val string, err error)
- func (cli *RedisCli) HGetAll(key string) (val map[string]string, err error)
- func (cli *RedisCli) HGetInt64(key, field string) (val int64, err error)
- func (cli *RedisCli) HIncrBy(key, field string, incr int64) (int64, error)
- func (cli *RedisCli) HMGet(key string, fields []string) (map[string]interface{}, error)
- func (cli *RedisCli) HMSet(key string, fields map[string]interface{}) (string, error)
- func (cli *RedisCli) HSet(key, field string, value interface{}) (bool, error)
- func (cli *RedisCli) IncrBy(key string, value int64) (int64, error)
- func (cli *RedisCli) Init(cfg *config.CacheConfig)
- func (cli *RedisCli) IsValid() bool
- func (cli *RedisCli) Keys(pattern string) ([]string, error)
- func (cli *RedisCli) MGet(keys []string) ([]interface{}, error)
- func (cli *RedisCli) MSet(pairs map[interface{}]interface{}) (string, error)
- func (cli *RedisCli) Ping() (string, error)
- func (cli *RedisCli) Publish(channel string, message interface{}) (int64, error)
- func (cli *RedisCli) Set(key string, value interface{}, expire int64) (string, error)
- type RedisDatabase
Constants ¶
View Source
const ( REDIS_UNKNOWN_CLIENT = iota REDIS_NORMAL_CLIENT REDIS_CLUSTER_CLIENT REDIS_SENTINEL_CLIENT )
View Source
const ERR_NOT_INIT_MSG = "redis client is not initialized yet."
View Source
const InvalidQueueName = "InvalidQueue"
Variables ¶
View Source
var DataTables = []RedisDatabase{FileTable}
View Source
var MetadataTables = []RedisDatabase{UserTable, BucketTable, ObjectTable, ClusterTable}
Functions ¶
func Get ¶
func Get(table RedisDatabase, prefix, key string) (value interface{}, err error)
func GetBytes ¶
Get file bytes `start` and `end` are inclusive FIXME: this API causes an extra memory copy, need to patch radix to fix it
func HIncrBy ¶
func HIncrBy(table RedisDatabase, prefix, key, field string, incr int64) (int64, error)
func HMGet ¶
func HMGet(table RedisDatabase, prefix, key string, fields []string) (map[string]interface{}, error)
func HMSet ¶
func HMSet(table RedisDatabase, prefix, key string, fields map[string]interface{}) (string, error)
func HSet ¶
func HSet(table RedisDatabase, prefix, key, field string, value interface{}) (bool, error)
func HasRedisClient ¶
func HasRedisClient() bool
func Initialize ¶
func Initialize(cfg *config.CacheConfig)
func Invalid ¶
func Invalid(table RedisDatabase, key string) (err error)
Publish the invalid message to other YIG instances through Redis
func Keys ¶
func Keys(table RedisDatabase, pattern string) ([]string, error)
don't use the escapecolon in keys command.
func MSet ¶
func MSet(table RedisDatabase, prefix string, pairs map[string]interface{}) (string, error)
func Remove ¶
func Remove(table RedisDatabase, prefix, key string) (err error)
func Set ¶
func Set(table RedisDatabase, prefix, key string, value interface{}) (err error)
Types ¶
type RedisCli ¶
type RedisCli struct {
// contains filtered or unexported fields
}
func NewRedisCli ¶
func NewRedisCli() *RedisCli
func (*RedisCli) Init ¶
func (cli *RedisCli) Init(cfg *config.CacheConfig)
type RedisDatabase ¶
type RedisDatabase int
const ( UserTable RedisDatabase = iota BucketTable ObjectTable FileTable ClusterTable )
func (RedisDatabase) InvalidQueue ¶
func (r RedisDatabase) InvalidQueue() string
func (RedisDatabase) String ¶
func (r RedisDatabase) String() string
Click to show internal directories.
Click to hide internal directories.