Documentation ¶
Index ¶
- Constants
- func GetRedisClient(server string, isMaster bool) redis.Conn
- func GetRedisPool(addr, db string, maxIdle int, idleTimeout time.Duration) *redis.Pool
- func LoadRedisConfig(filePath string) error
- type Connect
- type RedisConfig
- type RedisLoads
- type RedisPool
- type RedisStructure
- func (rs *RedisStructure) Bool(isMaster bool, cmd string, params ...interface{}) (reply bool, err error)
- func (rs *RedisStructure) ByteSlices(isMaster bool, cmd string, params ...interface{}) (reply [][]byte, err error)
- func (rs *RedisStructure) Bytes(isMaster bool, cmd string, params ...interface{}) (reply []byte, err error)
- func (rs *RedisStructure) DelKey(keySuffix string) (bool, error)
- func (rs *RedisStructure) Exists(key string) (bool, error)
- func (rs *RedisStructure) Expire(keySuffix string, second int) (bool, error)
- func (rs *RedisStructure) Float64(isMaster bool, cmd string, params ...interface{}) (reply float64, err error)
- func (rs *RedisStructure) InitPool(connStr, db string)
- func (rs *RedisStructure) InitRedisKey(keySuffix string) string
- func (rs *RedisStructure) Int(isMaster bool, cmd string, params ...interface{}) (reply int, err error)
- func (rs *RedisStructure) Int64(isMaster bool, cmd string, params ...interface{}) (reply int64, err error)
- func (rs *RedisStructure) Int64Map(isMaster bool, cmd string, params ...interface{}) (reply map[string]int64, err error)
- func (rs *RedisStructure) IntMap(isMaster bool, cmd string, params ...interface{}) (reply map[string]int, err error)
- func (rs *RedisStructure) Ints(isMaster bool, cmd string, params ...interface{}) (reply []int, err error)
- func (rs *RedisStructure) Keys(pattern string) ([]string, error)
- func (rs *RedisStructure) MultiBulk(isMaster bool, cmd string, params ...interface{}) (reply []interface{}, err error)
- func (rs *RedisStructure) MultiExec(isMaster bool, cmds [][]interface{}) ([]interface{}, error)
- func (rs *RedisStructure) Ping(isMaster bool) (interface{}, error)
- func (rs *RedisStructure) Rename(keySuffix, newKey string) (string, error)
- func (rs *RedisStructure) String(isMaster bool, cmd string, params ...interface{}) (reply string, err error)
- func (rs *RedisStructure) StringMap(isMaster bool, cmd string, params ...interface{}) (reply map[string]string, err error)
- func (rs *RedisStructure) Strings(isMaster bool, cmd string, params ...interface{}) (reply []string, err error)
- func (rs *RedisStructure) TTL(keySuffix string) (int, error)
- func (rs *RedisStructure) Uint64(isMaster bool, cmd string, params ...interface{}) (reply uint64, err error)
- func (rs *RedisStructure) Values(isMaster bool, cmd string, params ...interface{}) (reply []interface{}, err error)
Constants ¶
View Source
const ( // DefaultPagesize default pagesize DefaultPagesize = 500 // DefaultMaxidle default maxidle DefaultMaxidle = 50 // DefaultIdletimeout default idle timeout DefaultIdletimeout = 240 * time.Second )
View Source
const (
// RedisConfigNotExists redis readme
RedisConfigNotExists = `redis config not exists,server=%s,master=%v`
)
Variables ¶
This section is empty.
Functions ¶
func GetRedisClient ¶
GetRedisClient get redis client
func GetRedisPool ¶
GetRedisPool get redis pool
func LoadRedisConfig ¶
LoadRedisConfig load redis config
Types ¶
type RedisConfig ¶
type RedisConfig struct { Name string `yaml:"name"` PoolSize int `yaml:"poolSize"` TimeOut int `yaml:"timeOut"` Connects []Connect `yaml:"connect"` }
RedisConfig redis config
type RedisLoads ¶
type RedisLoads struct {
RedisConf []*RedisConfig `yaml:"redisConfig"`
}
RedisLoads redis loads config
type RedisPool ¶
type RedisPool struct { MaxIdle int IdleTimeout time.Duration // contains filtered or unexported fields }
RedisPool redis pool
type RedisStructure ¶
type RedisStructure struct { KeyPrefixFormat string ServerName string // contains filtered or unexported fields }
RedisStructure redis structure
func NewRedisStructure ¶
func NewRedisStructure(serverName, keyPrefixFormat string) RedisStructure
NewRedisStructure new redis structure
func (*RedisStructure) Bool ¶
func (rs *RedisStructure) Bool(isMaster bool, cmd string, params ...interface{}) (reply bool, err error)
Bool bool
func (*RedisStructure) ByteSlices ¶
func (rs *RedisStructure) ByteSlices(isMaster bool, cmd string, params ...interface{}) (reply [][]byte, err error)
ByteSlices byte slices
func (*RedisStructure) Bytes ¶
func (rs *RedisStructure) Bytes(isMaster bool, cmd string, params ...interface{}) (reply []byte, err error)
Bytes bytes
func (*RedisStructure) DelKey ¶
func (rs *RedisStructure) DelKey(keySuffix string) (bool, error)
DelKey delete key
func (*RedisStructure) Exists ¶
func (rs *RedisStructure) Exists(key string) (bool, error)
Exists exists
func (*RedisStructure) Expire ¶
func (rs *RedisStructure) Expire(keySuffix string, second int) (bool, error)
Expire expire
func (*RedisStructure) Float64 ¶
func (rs *RedisStructure) Float64(isMaster bool, cmd string, params ...interface{}) (reply float64, err error)
Float64 float64
func (*RedisStructure) InitPool ¶
func (rs *RedisStructure) InitPool(connStr, db string)
InitPool init pool
func (*RedisStructure) InitRedisKey ¶
func (rs *RedisStructure) InitRedisKey(keySuffix string) string
InitRedisKey init redis key
func (*RedisStructure) Int ¶
func (rs *RedisStructure) Int(isMaster bool, cmd string, params ...interface{}) (reply int, err error)
Int int
func (*RedisStructure) Int64 ¶
func (rs *RedisStructure) Int64(isMaster bool, cmd string, params ...interface{}) (reply int64, err error)
Int64 int64
func (*RedisStructure) Int64Map ¶
func (rs *RedisStructure) Int64Map(isMaster bool, cmd string, params ...interface{}) (reply map[string]int64, err error)
Int64Map int64 map
func (*RedisStructure) IntMap ¶
func (rs *RedisStructure) IntMap(isMaster bool, cmd string, params ...interface{}) (reply map[string]int, err error)
IntMap int map
func (*RedisStructure) Ints ¶
func (rs *RedisStructure) Ints(isMaster bool, cmd string, params ...interface{}) (reply []int, err error)
Ints ints
func (*RedisStructure) Keys ¶
func (rs *RedisStructure) Keys(pattern string) ([]string, error)
Keys keys
func (*RedisStructure) MultiBulk ¶
func (rs *RedisStructure) MultiBulk(isMaster bool, cmd string, params ...interface{}) (reply []interface{}, err error)
MultiBulk mulit bulk
func (*RedisStructure) MultiExec ¶
func (rs *RedisStructure) MultiExec(isMaster bool, cmds [][]interface{}) ([]interface{}, error)
MultiExec Multi Exec
func (*RedisStructure) Ping ¶
func (rs *RedisStructure) Ping(isMaster bool) (interface{}, error)
Ping ping
func (*RedisStructure) Rename ¶
func (rs *RedisStructure) Rename(keySuffix, newKey string) (string, error)
Rename rename
func (*RedisStructure) String ¶
func (rs *RedisStructure) String(isMaster bool, cmd string, params ...interface{}) (reply string, err error)
func (*RedisStructure) StringMap ¶
func (rs *RedisStructure) StringMap(isMaster bool, cmd string, params ...interface{}) (reply map[string]string, err error)
StringMap string map
func (*RedisStructure) Strings ¶
func (rs *RedisStructure) Strings(isMaster bool, cmd string, params ...interface{}) (reply []string, err error)
Strings strings
Click to show internal directories.
Click to hide internal directories.