redis

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(addrs []string, opts ...ClientOpt) (*Client, error)

New returns new redis.UniversalClient. The type of the returned client depends on the following conditions:

1. If the MasterName option is specified, a sentinel-backed FailoverClient is returned. 2. if the number of Addrs is two or more, a ClusterClient is returned. 3. Otherwise, a single-node Client is returned.

func (*Client) API

func (c *Client) API() redis.UniversalClient

func (*Client) ContextWithTimeout

func (c *Client) ContextWithTimeout() (context.Context, context.CancelFunc)

type ClientOpt

type ClientOpt func(opts *clientOpts)

func WithMasterName

func WithMasterName(masterName string) ClientOpt

func WithPassword

func WithPassword(password string) ClientOpt

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) ClientOpt

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOpt

func WithTraceProvider

func WithTraceProvider(traceProvider trace.TracerProvider) ClientOpt

Jump to

Keyboard shortcuts

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