redis

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyOptions

func ApplyOptions(opt *redis.Options, options ...Option)

ApplyOptions applies the given options to the given backend.

Types

type Option

type Option func(*redis.Options)

Option is a function type that can be used to configure the `Redis`.

func WithAddr

func WithAddr(addr string) Option

WithAddr sets the `Addr` field of the `redis.Options` struct.

func WithDB

func WithDB(db int) Option

WithDB sets the `DB` field of the `redis.Options` struct.

func WithDialTimeout

func WithDialTimeout(dialTimeout time.Duration) Option

WithDialTimeout sets the `DialTimeout` field of the `redis.Options` struct.

func WithMaxRetries

func WithMaxRetries(maxRetries int) Option

WithMaxRetries sets the `MaxRetries` field of the `redis.Options` struct.

func WithMinIdleConns

func WithMinIdleConns(minIdleConns int) Option

WithMinIdleConns sets the `MinIdleConns` field of the `redis.Options` struct.

func WithPassword

func WithPassword(password string) Option

WithPassword sets the `Password` field of the `redis.Options` struct.

func WithPoolFIFO

func WithPoolFIFO(poolFIFO bool) Option

WithPoolFIFO sets the `PoolFIFO` field of the `redis.Options` struct.

func WithPoolSize

func WithPoolSize(poolSize int) Option

WithPoolSize sets the `PoolSize` field of the `redis.Options` struct.

func WithPoolTimeout

func WithPoolTimeout(poolTimeout time.Duration) Option

WithPoolTimeout sets the `PoolTimeout` field of the `redis.Options` struct.

func WithReadTimeout

func WithReadTimeout(readTimeout time.Duration) Option

WithReadTimeout sets the `ReadTimeout` field of the `redis.Options` struct.

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) Option

WithTLSConfig sets the `TLSConfig` field of the `redis.Options` struct.

func WithUsername

func WithUsername(username string) Option

WithUsername sets the `Username` field of the `redis.Options` struct.

func WithWriteTimeout

func WithWriteTimeout(writeTimeout time.Duration) Option

WithWriteTimeout sets the `WriteTimeout` field of the `redis.Options` struct.

type Store

type Store struct {
	Client *redis.Client
}

Store is a redis store instance with redis client

func New

func New(opts ...Option) (*Store, error)

New create redis store instance with given options and config @param opts

Jump to

Keyboard shortcuts

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