Documentation
¶
Index ¶
- Constants
- type Client
- type Config
- type Manager
- func (mgr *Manager) Add(name string, config *Config) (err error)
- func (mgr *Manager) Clear() (err error)
- func (mgr *Manager) Delete(name string) (err error)
- func (mgr *Manager) Load(name string) (client *Client, err error)
- func (mgr *Manager) SetLogger(l logger.Interface)
- func (mgr *Manager) Store(cfgs map[string]*Config)
Constants ¶
View Source
const ( Pong = "PONG" Nil = goredis.Nil )
View Source
const ( MaxDialTimeout = 1000 MaxReadTimeout = 1000 MaxWriteTimeout = 3000 MaxPoolSize = 1024 MaxPoolTimeout = 2 // second MinIdleConns = 3 MaxRetries = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string Network string Addr string Password string DB int DialTimeout time.Duration // 毫秒 ReadTimeout time.Duration // 毫秒 WriteTimeout time.Duration // 毫秒 PoolSize int // 连接池个数 PoolTimeout time.Duration // 超时,秒 MinIdleConns int // 空闲 MaxRetries int // 重试次数 }
Config 配置
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager 管理
var ( // DefaultManager 默认管理 DefaultManager *Manager )
func NewManagerWithLogger ¶
NewManagerWithLogger 返回一个manager对象
Click to show internal directories.
Click to hide internal directories.