redisclient

package
v0.0.0-...-87192e5 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client() (*redis.Client, error)

func Close

func Close() error

func Exists

func Exists(c context.Context, key string) (bool, error)

func Get

func Get(c context.Context, key string) (string, error)

func Init

func Init(cfg Config) (*redis.Client, error)

func Set

func Set(c context.Context, key string, value interface{}, expiration time.Duration) error

Types

type Config

type Config struct {
	Host     string `mapstructure:"host" validate:"required"`
	Port     int    `mapstructure:"port" validate:"required"`
	Password string `mapstructure:"password" validate:"required"`
	DB       int    `mapstructure:"db" validate:"gte=0,lte=15"`
}

Jump to

Keyboard shortcuts

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