Documentation ¶
Index ¶
- func NewPool(option ...Option) *redis.Pool
- type Option
- func WithConnectTimeout(connecttimeout time.Duration) Option
- func WithDb(db int) Option
- func WithDial(f func() (redis.Conn, error)) Option
- func WithHost(host string) Option
- func WithIdleTimeout(idletimeout time.Duration) Option
- func WithMaxActive(maxactive int) Option
- func WithMaxConnLifetime(maxconnlifetime time.Duration) Option
- func WithMaxIdle(maxidle int) Option
- func WithPass(pass string) Option
- func WithPort(port int) Option
- func WithReadTimeout(timeout time.Duration) Option
- func WithTestOnBorrow(f func(c redis.Conn, t time.Time) error) Option
- func WithWait(wait bool) Option
- func WithWriteTimeout(timeout time.Duration) Option
- type RedisConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*RedisConfig)
Option is a RedisConfig configurator to be supplied to NewRedisConfig() function.
func WithConnectTimeout ¶
WithConnectTimeout sets the ConnectTimeout
func WithIdleTimeout ¶
WithIdleTimeout sets the IdleTimeout
func WithMaxConnLifetime ¶
WithMaxConnLifetime sets the MaxConnLifetime
func WithReadTimeout ¶
WithReadTimeout sets the ReadTimeout
func WithTestOnBorrow ¶
WithTestOnBorrow sets the TestOnBorrow
func WithWriteTimeout ¶
WithWriteTimeout sets the WriteTimeout
type RedisConfig ¶
type RedisConfig struct { Dial func() (redis.Conn, error) TestOnBorrow func(c redis.Conn, t time.Time) error MaxIdle int MaxActive int IdleTimeout time.Duration Wait bool MaxConnLifetime time.Duration Host string Port int ConnectTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration Pass string Db int }
Click to show internal directories.
Click to hide internal directories.