redisx

package
v0.0.0-...-5ee6a2d Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConfigured = errors.New("Redis is not configured")

Functions

func GetRedisClient

func GetRedisClient(conf *RedisConfig) (redis.UniversalClient, error)

Types

type RedisConfig

type RedisConfig struct {
	Address           string   `yaml:"address,omitempty"`
	Username          string   `yaml:"username,omitempty"`
	Password          string   `yaml:"password,omitempty"`
	DB                int      `yaml:"db,omitempty"`
	UseTLS            bool     `yaml:"use_tls,omitempty"`
	MasterName        string   `yaml:"sentinel_master_name,omitempty"`
	SentinelUsername  string   `yaml:"sentinel_username,omitempty"`
	SentinelPassword  string   `yaml:"sentinel_password,omitempty"`
	SentinelAddresses []string `yaml:"sentinel_addresses,omitempty"`
	ClusterAddresses  []string `yaml:"cluster_addresses,omitempty"`
	DialTimeout       int      `yaml:"dial_timeout,omitempty"`
	ReadTimeout       int      `yaml:"read_timeout,omitempty"`
	WriteTimeout      int      `yaml:"write_timeout,omitempty"`
	MaxRedirects      *int     `yaml:"max_redirects,omitempty"`
}

func (*RedisConfig) GetMaxRedirects

func (r *RedisConfig) GetMaxRedirects() int

func (*RedisConfig) IsConfigured

func (r *RedisConfig) IsConfigured() bool

Jump to

Keyboard shortcuts

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