Documentation ¶
Index ¶
- Constants
- type RedisClient
- type RedisClientImpl
- func (c *RedisClientImpl) GetConn(host string) (conn redis.Conn, isReadOnly bool, err error)
- func (c *RedisClientImpl) GetConnWithTimeout(host string) (cwt redis.ConnWithTimeout, isReadOnly bool, err error)
- func (c *RedisClientImpl) GetHosts() ([]string, []string)
- func (c *RedisClientImpl) GetMasterFromSlaveIP(slaveIP string) (string, error)
- func (c *RedisClientImpl) GetMaxConn() int
- func (c *RedisClientImpl) GetMode() int
- func (c *RedisClientImpl) GetNodeIPByKey(key string, readOnly bool) (string, error)
- func (c *RedisClientImpl) HandleError(err error)
- type RedisClusterV2ClientImpl
- func (c *RedisClusterV2ClientImpl) GetConn(host string) (conn redis.Conn, isReadOnly bool, err error)
- func (c *RedisClusterV2ClientImpl) GetConnWithTimeout(host string) (cwt redis.ConnWithTimeout, isReadOnly bool, err error)
- func (c *RedisClusterV2ClientImpl) GetHosts() ([]string, []string)
- func (c *RedisClusterV2ClientImpl) GetMasterFromSlaveIP(slaveIP string) (string, error)
- func (c *RedisClusterV2ClientImpl) GetMaxConn() int
- func (c *RedisClusterV2ClientImpl) GetNodeIPByKey(key string, readOnly bool) (string, error)
- func (c *RedisClusterV2ClientImpl) HandleError(err error)
Constants ¶
View Source
const ( //CLUSTER_MODE 0 CLUSTER_MODE int = iota // SINGLE_MODE 1 SINGLE_MODE )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisClient ¶
type RedisClient interface { GetHosts() ([]string, []string) GetMaxConn() int GetConn(host string) (redis.Conn, bool, error) GetConnWithTimeout(host string) (cwt redis.ConnWithTimeout, isReadOnly bool, err error) GetNodeIPByKey(key string, readOnly bool) (string, error) GetMasterFromSlaveIP(slaveIP string) (masterIP string, err error) HandleError(err error) }
RedisClient ...
func New ¶
func New(mode int, host string, maxConn int, dialOption ...redis.DialOption) RedisClient
New return new RedisClient
type RedisClientImpl ¶
type RedisClientImpl struct {
// contains filtered or unexported fields
}
RedisClientImpl implementation of Redis Single Node Client
func (*RedisClientImpl) GetConnWithTimeout ¶
func (c *RedisClientImpl) GetConnWithTimeout(host string) (cwt redis.ConnWithTimeout, isReadOnly bool, err error)
func (*RedisClientImpl) GetHosts ¶
func (c *RedisClientImpl) GetHosts() ([]string, []string)
GetHosts get hosts of client
func (*RedisClientImpl) GetMasterFromSlaveIP ¶
func (c *RedisClientImpl) GetMasterFromSlaveIP(slaveIP string) (string, error)
func (*RedisClientImpl) GetMaxConn ¶
func (c *RedisClientImpl) GetMaxConn() int
GetMaxConn Return Redis Single Node Max Connection Pool
func (*RedisClientImpl) GetMode ¶
func (c *RedisClientImpl) GetMode() int
GetMode get mode of client
func (*RedisClientImpl) GetNodeIPByKey ¶
func (c *RedisClientImpl) GetNodeIPByKey(key string, readOnly bool) (string, error)
func (*RedisClientImpl) HandleError ¶
func (c *RedisClientImpl) HandleError(err error)
type RedisClusterV2ClientImpl ¶
type RedisClusterV2ClientImpl struct {
// contains filtered or unexported fields
}
func (*RedisClusterV2ClientImpl) GetConnWithTimeout ¶
func (c *RedisClusterV2ClientImpl) GetConnWithTimeout(host string) (cwt redis.ConnWithTimeout, isReadOnly bool, err error)
func (*RedisClusterV2ClientImpl) GetHosts ¶
func (c *RedisClusterV2ClientImpl) GetHosts() ([]string, []string)
GetHosts get hosts of client
func (*RedisClusterV2ClientImpl) GetMasterFromSlaveIP ¶
func (c *RedisClusterV2ClientImpl) GetMasterFromSlaveIP(slaveIP string) (string, error)
func (*RedisClusterV2ClientImpl) GetMaxConn ¶
func (c *RedisClusterV2ClientImpl) GetMaxConn() int
func (*RedisClusterV2ClientImpl) GetNodeIPByKey ¶
func (c *RedisClusterV2ClientImpl) GetNodeIPByKey(key string, readOnly bool) (string, error)
func (*RedisClusterV2ClientImpl) HandleError ¶
func (c *RedisClusterV2ClientImpl) HandleError(err error)
Click to show internal directories.
Click to hide internal directories.