Documentation ¶
Index ¶
- Variables
- type Client
- type Option
- func WithAddrs(addrs ...string) Option
- func WithDbIndex(index uint) Option
- func WithDialTimeout(timeout uint) Option
- func WithMapConfig(cfg map[string]any) Option
- func WithPassword(password string) Option
- func WithPoolSize(poolSize uint) Option
- func WithReadTimeout(timeout uint) Option
- func WithUsername(username string) Option
- func WithWriteTimeout(timeout uint) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var Nil = redis.Nil
View Source
var Refactor func(configName string, orgopts *Options) (opts *Options, err error)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { redis.UniversalClient // contains filtered or unexported fields }
Client redis客户端
func NewByConfig ¶
func NewByConfig(configName string, setting config.Config, mapCfg map[string]any) (r *Client, err error)
NewByConfig 构建客户端
type Option ¶
type Option func(opts *Options)
func WithDbIndex ¶
func WithDialTimeout ¶
func WithMapConfig ¶ added in v0.4.3
func WithPassword ¶
func WithPoolSize ¶
func WithReadTimeout ¶
func WithUsername ¶ added in v0.1.40
func WithWriteTimeout ¶
type Options ¶ added in v0.3.1
type Options struct { Addrs []string `json:"addrs,omitempty" valid:"required" ` Username string `json:"username,omitempty" ` Password string `json:"password,omitempty" ` DbIndex uint `json:"db,omitempty"` DialTimeout uint `json:"dial_timeout,omitempty"` ReadTimeout uint `json:"read_timeout,omitempty"` WriteTimeout uint `json:"write_timeout,omitempty" ` PoolSize uint `json:"pool_size,omitempty"` }
Click to show internal directories.
Click to hide internal directories.