redis

package
v0.0.0-...-35a4376 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRedisNil = redis.Nil

Functions

This section is empty.

Types

type Client

type Client interface {
	redis.Cmdable
}

func NewClient

func NewClient(config *Config) (Client, error)

type ClientCertConfig

type ClientCertConfig struct {
	CertFile string `json:"cert_file" yaml:"cert_file"`
	KeyFile  string `json:"key_file" yaml:"key_file"`
}

func (*ClientCertConfig) Load

func (c *ClientCertConfig) Load() (tls.Certificate, error)

type Config

type Config struct {
	Address  string     `json:"address"`
	Password string     `json:"password"`
	Database int        `json:"database"`
	Mode     Mode       `json:"mode"`
	TLS      *TLSConfig `json:"tls"`
}

func NewConfig

func NewConfig() *Config

func (Config) ValidateConfigFields

func (c Config) ValidateConfigFields() error

type Mode

type Mode string
const (
	Single  Mode = "single"
	Cluster Mode = "cluster"
)

func (Mode) Valid

func (m Mode) Valid() error

type TLSConfig

type TLSConfig struct {
	Enabled             bool             `json:"enabled" yaml:"enabled"`
	RootCAsFile         string           `json:"root_cas_file" yaml:"root_cas_file"`
	InsecureSkipVerify  bool             `json:"skip_cert_verify" yaml:"skip_cert_verify"`
	ClientCertificates  ClientCertConfig `json:"client_certs" yaml:"client_certs"`
	EnableRenegotiation bool             `json:"enable_renegotiation" yaml:"enable_renegotiation"`
}

func (*TLSConfig) Get

func (c *TLSConfig) Get() (*tls.Config, error)

Jump to

Keyboard shortcuts

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