cache

package
v0.0.0-...-598afe9 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefixJWT     = "jwt"
	PrefixSession = "session"
)
View Source
const (
	Login  = 1
	Logout = 0
)

Variables

This section is empty.

Functions

func CheckJWTInBlacklist

func CheckJWTInBlacklist(id int64, timestamp int64) (bool, error)

CheckJWTInBlacklist checks if user's jwt is in blacklist.

func SetJWTDeadline

func SetJWTDeadline(id int64) error

SetJWTDeadline sets a deadline of user's jwt. All jwt issued before the new deadline will be rejected.

func SetStatusLogin

func SetStatusLogin(id int64) error

You can use bitmap of cache to keep a record of each user's login status. Here we don't use it.

func SetStatusLogout

func SetStatusLogout(id int64) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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