Documentation
¶
Index ¶
- Variables
- func Close()
- func Connect(opts ...Option) error
- func GetClient(name ...string) *goRedis.Client
- type Config
- type Option
- func Addr(addr string) Option
- func DB(num int) Option
- func DialTimeout(timeout time.Duration) Option
- func MaxRetries(max int) Option
- func Metrics(b bool) Option
- func Name(name string) Option
- func Password(password string) Option
- func PoolSize(size int) Option
- func PoolTimeout(timeout time.Duration) Option
- func ReadTimeout(timeout time.Duration) Option
- func Trace(b bool) Option
- func Username(username string) Option
- func WriteTimeout(timeout time.Duration) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultName = "default"
)
Functions ¶
Types ¶
type Option ¶
type Option func(*Options)
func DialTimeout ¶
func MaxRetries ¶
func PoolTimeout ¶
func ReadTimeout ¶
func WriteTimeout ¶
type Options ¶
type Options struct { Name string `json:"name" mapstructure:"name"` Addr string `json:"addr" mapstructure:"addr"` Username string `json:"username" mapstructure:"username"` Password string `json:"password" mapstructure:"password"` DB int `json:"db" mapstructure:"db"` MaxRetries int `json:"max_retries" mapstructure:"max_retries"` DialTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration PoolSize int PoolTimeout time.Duration Trace bool Metrics bool }
Click to show internal directories.
Click to hide internal directories.