redis

package
v0.0.0-...-17b6be2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func DoInLock

func DoInLock(key string, timeout time.Duration, fun func() interface{}) interface{}

func GetClient

func GetClient(name string) *redis.Client

func GetDefaultClient

func GetDefaultClient() *redis.Client

func GetObj

func GetObj(key string, obj interface{}) (bool, error)

GetObj @desc 查询缓存,并返回对象 @return bool 缓存是否有数据 @return error 异常

func Init

func Init()

func SetObj

func SetObj(key string, obj interface{}, expiration time.Duration) error

func TryLock

func TryLock(key string, timeout time.Duration) string

func Unlock

func Unlock(key string, version string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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