redis

package
v0.0.0-...-d6791e1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeyEnum = struct {
	HttpCaching string
}{
	HttpCaching: "HTTP_CACHING",
}
View Source
var Rdb *redis.Client
View Source
var TtlEnum = struct {
	Second30 time.Duration
	Minute1  time.Duration
	Minute5  time.Duration
	Minute10 time.Duration
	Minute15 time.Duration
	Minute30 time.Duration
	Hour1    time.Duration
	Hour2    time.Duration
	Hour3    time.Duration
	Hour6    time.Duration
	Hour12   time.Duration
	Day1     time.Duration
}{
	Second30: time.Second * 30,
	Minute1:  time.Minute * 1,
	Minute5:  time.Minute * 5,
	Minute10: time.Minute * 10,
	Minute15: time.Minute * 15,
	Minute30: time.Minute * 30,
	Hour1:    time.Hour * 1,
	Hour2:    time.Hour * 2,
	Hour3:    time.Hour * 3,
	Hour6:    time.Hour * 6,
	Hour12:   time.Hour * 12,
	Day1:     time.Hour * 24,
}

Functions

func CheckExist

func CheckExist(key string) (bool, error)

func Delete

func Delete(key string) error

func Get

func Get(key string) (any, error)

func GetBind

func GetBind(key string, dest any) (any, error)

func GetRedisConnection

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

func Set

func Set(key string, value any, expiration time.Duration) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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