redis

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingAddresses = errors.New("redis-cluster: shard addresses is empty")

Functions

func New

func New(opt *Options) (*redis.ClusterClient, error)

New creates a new cluster client given the shard addresses (ip:port) and checks the connection for each one. Returns ErrMissingAddress if len(opts.addrs) == 0. The remaining Options fields aren't checked by this function.

Types

type ClusterPool

type ClusterPool struct {
	*redis.ClusterClient
}

ClusterPool contains the redis cluster client.

type Options

type Options struct {
	// Addrs contains the shards addresses in the form <host/domain>:<port>
	Addrs []string

	Username string
	// Password can be optional.
	Password string

	// MaxConnRetries is the max trials before giving up.
	MaxConnRetries int

	// PingDeadline represents the limit to
	// receive a ping response from each node.
	PingDeadline time.Duration
}

Options contains only a subset of the internal configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳