redis

package
v0.41.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

func WithConnCheckInterval

func WithConnCheckInterval(interval time.Duration) Option

WithConnCheckInterval specifies the minimum interval between two times of checking idle connection health.

func WithDialConnectTimeout

func WithDialConnectTimeout(timeout time.Duration) Option

WithDialConnectTimeout specifies the timeout for connecting to the Redis server.

func WithIdleTimeout

func WithIdleTimeout(duration time.Duration) Option

WithIdleTimeout specifies the timeout for idle connection.

func WithMaxActive

func WithMaxActive(num int) Option

WithMaxActive specifies the maximum number of connections allocated by the pool at a given time. When zero, there is no limit on the number of connections in the pool.

func WithMaxIdle

func WithMaxIdle(num int) Option

WithMaxIdle specifies the maximum number of idle connections in the pool.

type Redis

type Redis interface {
	Get() redis.Conn
	Close() error
}

func NewRedis

func NewRedis(address, password string, opts ...Option) Redis

Directories

Path Synopsis
Package redistest is a generated GoMock package.
Package redistest is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL