cache

package
v0.0.0-...-54fccd2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RedisClient *redis.Client

RedisClient Redis缓存客户端单例

Functions

func DelUserToken

func DelUserToken(token string) error

删除用户登录token实现登出

func GetUserByToken

func GetUserByToken(token string) (string, error)

通过Token获取对应的userid

func Redis

func Redis()

Redis 在中间件中初始化redis链接

func SaveUserToken

func SaveUserToken(token, userID string, exp time.Duration) error

把用户token保存在redis中

func UserTokenKey

func UserTokenKey(token string) string

UserTokenKey token的redis key

Types

This section is empty.

Jump to

Keyboard shortcuts

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