cache

package
v0.0.0-...-7de1f39 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func IsJWTRevoked

func IsJWTRevoked(id string, timestamp int64) (interface{}, bool)

IsJWTRevoked checks if user's jwt is revoked.

func RevokeJWT

func RevokeJWT(id string) error

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

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