Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseReply ¶
type BaseReply struct {
// contains filtered or unexported fields
}
BaseReply base reply
func (*BaseReply) DuringTime ¶
DuringTime return during time
func (*BaseReply) RequestTime ¶
RequestTime return request time
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client redis client
func NewClient ¶
func NewClient(config *ConfigDefinition) (client *Client, err error)
NewClient new redis client
func (*Client) Get ¶
func (c *Client) Get(key string) *StringReply
func (*Client) Set ¶
func (c *Client) Set(key string, value interface{}) *StringReply
type Commands ¶
type Commands interface { Get(key string) *StringReply Set(key, value string) *StringReply }
Commands redis commands
type ConfigDefinition ¶
type ConfigDefinition struct { // redis地址 Address string // 密码 Password string // 池中空闲连接的最大数量 . MaxIdle int // 池在给定时间分配的最大连接数。 // 当为零时,池中的连接数没有限制。 MaxActive int // 在这段时间内保持空闲后关闭连接。 如果值 // 为零,则不关闭空闲连接。 应用程序应设置 // 超时值小于服务器的超时值。 // 单位秒 IdleTimeout int // 如果 Wait 为真并且池处于 MaxActive 限制,则 Get() 等待 // 用于在返回之前将连接返回到池中。 Wait bool // 关闭早于此持续时间的连接。 如果该值为零,则 // 池不会根据年龄关闭连接。 // 单位秒 MaxConnLifetime int }
ConfigDefinition redis配置信息
Click to show internal directories.
Click to hide internal directories.