redis

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client() *redis.Client

Client returns the singleton Redis client instance. Returns nil if Redis is not enabled or not initialized.

func Close

func Close() error

Close closes the Redis client connection.

func Init

func Init(cfg Config) error

Init initializes the Redis client singleton with config.

Types

type Config

type Config struct {
	Addr     string `toml:"addr"`
	Password string `toml:"password"`
	DB       int    `toml:"db"`
	Enabled  bool   `toml:"enabled"`
}

Config Redis 配置

func (*Config) Validate

func (c *Config) Validate() error

Validate 验证配置

Jump to

Keyboard shortcuts

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