redisx

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(configKey string, c *Config)

func GetClient

func GetClient(ctx context.Context, keys ...string) *redis.Client

GetClient used to get a redis client instance keys is used to declare get which one Index 0 of keys is the store key Index 1 of keys is the db key If keys is empty, it will return the default client

func Init

func Init(cm components.ConfigMap[*Config]) (func() error, error)

func IsHealth

func IsHealth() (err error)

Types

type Config

type Config struct {
	Dsn      string         `json:"dsn" yaml:"dsn"`
	Password string         `json:"password" yaml:"password"`
	DBList   map[string]int `json:"db_list" yaml:"db_list"`
}

func (*Config) SetDefault

func (c *Config) SetDefault()

Jump to

Keyboard shortcuts

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