redis

package
v0.0.0-...-b5678d6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 3 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 {
	Addr         string `yaml:"addr" env:"REDIS_ADDR" env-default:"localhost:6379"`
	MinIdleConns int    `yaml:"minIdleConns" env:"REDIS_MIN_IDLE_CONNS" env-default:"200"`
	PoolSize     int    `yaml:"poolSize" env:"REDIS_POOL_SIZE" env-default:"200"`
	PoolTimeout  int    `yaml:"poolTimeout" env:"REDIS_POOL_TIMEOUT" env-default:"5"`
	Password     string `yaml:"password" env:"REDIS_PASSWORD" env-default:""`
	DB           int    `yaml:"db" env:"REDIS_DB" env-default:"0"`
}

Config is a redis config.

type RedisEngine

type RedisEngine interface {
	GetRedisClient() *redis.Client
	Close()
}

RedisEngine is an interface for Redis client.

func NewRedisClient

func NewRedisClient(cfgRedis Config) (RedisEngine, error)

Jump to

Keyboard shortcuts

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