redis

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host         string        `env:"REDIS_HOST,required"`
	Port         string        `env:"REDIS_PORT,required"`
	Password     string        `env:"REDIS_PASSWORD" envdefault:""`
	DB           int           `env:"REDIS_DB,required"`
	TTL          time.Duration `env:"REDIS_TTL,required"`
	DialTimeout  time.Duration `env:"REDIS_DIAL_TIMEOUT" envdefault:"10s"`
	UseTls       bool          `env:"REDIS_USE_TLS" envdefault:"false"`
	MaxIdleConns int           `env:"REDIS_MAX_IDLE_CONNS,required"`
	MinIdleConns int           `env:"REDIS_MIN_IDLE_CONNS,required"`
}

func NewConfig

func NewConfig() (*Config, error)

type Redis

type Redis struct {
	*redis.Client
}

func NewRedis

func NewRedis(config *Config) (*Redis, error)

Jump to

Keyboard shortcuts

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