Documentation ¶
Index ¶
- Constants
- func New(config map[string]interface{}) (interface{}, error)
- type Client
- func (c *Client) Add(key string, value interface{}, expire ...time.Duration) (bool, error)
- func (c *Client) Del(key string) (bool, error)
- func (c *Client) Do(cmd string, args ...interface{}) (interface{}, error)
- func (c *Client) Exists(key string) (bool, error)
- func (c *Client) Expire(key string, expire time.Duration) (bool, error)
- func (c *Client) ExpireAt(key string, timestamp int64) (bool, error)
- func (c *Client) Get(key string) (*value.Value, error)
- func (c *Client) HDel(key string, fields ...interface{}) (int64, error)
- func (c *Client) HExists(key string, field string) (bool, error)
- func (c *Client) HGet(key, field string) (*value.Value, error)
- func (c *Client) HGetAll(key string) (map[string]*value.Value, error)
- func (c *Client) HIncrBy(key, field string, delta int64) (int64, error)
- func (c *Client) HMGet(key string, fields ...interface{}) (map[string]*value.Value, error)
- func (c *Client) HMSet(key string, fv ...interface{}) (bool, error)
- func (c *Client) HSet(key string, fv ...interface{}) (bool, error)
- func (c *Client) Incr(key string, delta int64) (int64, error)
- func (c *Client) LLen(key string) (int64, error)
- func (c *Client) LPop(key string) (*value.Value, error)
- func (c *Client) LPush(key string, values ...interface{}) (bool, error)
- func (c *Client) MAdd(items map[string]interface{}, expire ...time.Duration) (bool, error)
- func (c *Client) MDel(keys []string) (bool, error)
- func (c *Client) MGet(keys []string) (map[string]*value.Value, error)
- func (c *Client) MSet(items map[string]interface{}, expire ...time.Duration) (bool, error)
- func (c *Client) RPop(key string) (*value.Value, error)
- func (c *Client) RPush(key string, values ...interface{}) (bool, error)
- func (c *Client) Set(key string, value interface{}, expire ...time.Duration) (bool, error)
- func (c *Client) ZAdd(key string, members ...*Z) (int64, error)
- func (c *Client) ZAddOpt(key string, opts []string, members ...*Z) (int64, error)
- func (c *Client) ZCard(key string) (int64, error)
- func (c *Client) ZRange(key string, start, end int) ([]*value.Value, error)
- func (c *Client) ZRangeWithScores(key string, start, end int) ([]*ZV, error)
- func (c *Client) ZRem(key string, members ...interface{}) (int64, error)
- func (c *Client) ZRevRange(key string, start, end int) ([]*value.Value, error)
- func (c *Client) ZRevRangeWithScores(key string, start, end int) ([]*ZV, error)
- type ClusterPool
- type Conn
- func (c *Conn) CheckActive() (bool, error)
- func (c *Conn) Close(force bool)
- func (c *Conn) Do(cmd string, args ...interface{}) (interface{}, error)
- func (c *Conn) ExtendDeadLine(deadLine ...time.Duration) bool
- func (c *Conn) ReadReply() (interface{}, error)
- func (c *Conn) WriteCmd(cmd string, args ...interface{}) error
- type IPool
- type MasterSlavePool
- type Pool
- func (p *Pool) AddrNewKeys(cmd string, v interface{}) (map[string][]string, map[string]string, error)
- func (p *Pool) BuildKey(key string) string
- func (p *Pool) GetAddrByKey(cmd, key string, prevDft ...string) string
- func (p *Pool) GetConnByAddr(addr string) (*Conn, error)
- func (p *Pool) GetConnByKey(cmd, key string) (*Conn, error)
- func (p *Pool) GetServers() (servers []string)
- func (p *Pool) Init() error
- func (p *Pool) RunAddrFunc(addr string, keys []string, wg *sync.WaitGroup, f func(*Conn, []string)) error
- func (p *Pool) SetDb(db int)
- func (p *Pool) SetLogger(logger logs.ILogger)
- func (p *Pool) SetMaxIdleConn(v int)
- func (p *Pool) SetMaxIdleTime(v string) error
- func (p *Pool) SetMod(v string) error
- func (p *Pool) SetNetTimeout(v string) error
- func (p *Pool) SetPassword(password string)
- func (p *Pool) SetPrefix(prefix string)
- func (p *Pool) SetProbeInterval(v string) error
- func (p *Pool) SetServers(v []interface{})
- type Z
- type ZV
Constants ¶
View Source
const ( ModCluster = "cluster" ModMasterSlave = "masterSlave" PgoMasterSlaveCheckPrefix = "pgo_master_slave_check_" NodeActionAdd = "add" NodeActionDel = "del" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
Pool
}
func (*Client) ZRangeWithScores ¶ added in v0.1.137
type ClusterPool ¶
type ClusterPool struct {
// contains filtered or unexported fields
}
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) CheckActive ¶
type MasterSlavePool ¶
type MasterSlavePool struct {
// contains filtered or unexported fields
}
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) AddrNewKeys ¶
func (*Pool) GetAddrByKey ¶
get redis address/node prevDft 一般用于master-slave mset mget mdel
func (*Pool) GetServers ¶
func (*Pool) RunAddrFunc ¶
func (*Pool) SetMaxIdleConn ¶
func (*Pool) SetMaxIdleTime ¶
func (*Pool) SetNetTimeout ¶
func (*Pool) SetPassword ¶
func (*Pool) SetProbeInterval ¶
func (*Pool) SetServers ¶
func (p *Pool) SetServers(v []interface{})
Click to show internal directories.
Click to hide internal directories.