redis2

package
v0.0.0-...-4c9d98c Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conf Config) (*redis.ClusterClient, error)

NewClient new redis cluster client

func NewTLSConfig

func NewTLSConfig(clientCertFile, clientKeyFile, caCertFile string) (*tls.Config, error)

NewTLSConfig generates a TLS configuration used to authenticate on server with certificates. Parameters are the three pem files path we need to authenticate: client cert, client key and CA cert.

Types

type Config

type Config struct {
	Addrs           []string
	Username        string
	Password        string
	MaxRetries      int
	MinRetryBackoff time.Duration
	MaxRetryBackoff time.Duration

	DialTimeout  time.Duration
	ReadTimeout  time.Duration
	WriteTimeout time.Duration

	PoolSize           int
	MinIdleConns       int
	MaxConnAge         time.Duration
	PoolTimeout        time.Duration
	IdleTimeout        time.Duration
	IdleCheckFrequency time.Duration

	TLS *TLS
}

Config config

type TLS

type TLS struct {
	ClientCertFile string

	CACertFile string
	// contains filtered or unexported fields
}

TLS tls

Jump to

Keyboard shortcuts

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