redisutils

package module
v0.0.0-...-719548d Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 5 Imported by: 0

README

redisutils

Documentation

Index

Constants

View Source
const (
	Simple   = "simple"
	Failover = "failover"
	Cluster  = "cluster"
	Ring     = "ring"
)

Variables

This section is empty.

Functions

func NewClusterRedis

func NewClusterRedis(opts ...Option) (*redis.ClusterClient, error)

func NewFailoverRedis

func NewFailoverRedis(opts ...Option) (*redis.Client, error)

func NewRedis

func NewRedis(address []string, opts ...Option) (redis.UniversalClient, error)

func NewRedisWithOptions

func NewRedisWithOptions(o *Options) (redis.UniversalClient, error)

func NewRingRedis

func NewRingRedis(opts ...Option) (*redis.Ring, error)

func NewSimpleRedis

func NewSimpleRedis(opts ...Option) (*redis.Client, error)

Types

type Option

type Option func(*Options)

func ClientType

func ClientType(clientType string) Option

func Context

func Context(ctx context.Context) Option

func DB

func DB(db int) Option

func DialTimeout

func DialTimeout(timeout time.Duration) Option

func MasterName

func MasterName(masterName string) Option

func MaxRetries

func MaxRetries(maxRetries int) Option

func MaxRetryBackoff

func MaxRetryBackoff(maxRetryBackoff time.Duration) Option

func MinRetryBackoff

func MinRetryBackoff(minRetryBackoff time.Duration) Option

func Password

func Password(pwd string) Option

func PoolSize

func PoolSize(size int) Option

func ReadTimeout

func ReadTimeout(timeout time.Duration) Option

func Shards

func Shards(shards []string) Option

func Username

func Username(username string) Option

func WriteTimeout

func WriteTimeout(timeout time.Duration) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis
hook

Jump to

Keyboard shortcuts

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