redis

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 8 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 `yaml:"address"`
	Username        string   `yaml:"username"`
	Password        string   `yaml:"password"`
	MaxRetries      int
	MinRetryBackoff time.Duration
	MaxRetryBackoff time.Duration

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

	PoolSize           int           `yaml:"poolSize"`
	MinIdleConns       int           `yaml:"minIdleConns"`
	MaxConnAge         time.Duration `yaml:"minIdleAge"`
	PoolTimeout        time.Duration `yaml:"poolTimeout"`
	IdleTimeout        time.Duration `yaml:"idleTimeout"`
	IdleCheckFrequency time.Duration `yaml:"idleCheckFrequency"`

	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