tokenx

package
v0.0.0-...-eea11df Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserLogoutKey

func GetUserLogoutKey(uid string) string

Types

type JwtTokenHolder

type JwtTokenHolder struct {
	// contains filtered or unexported fields
}

func NewJwtTokenHolder

func NewJwtTokenHolder(issuer string, secret string, cache *redis.Redis) *JwtTokenHolder

func (*JwtTokenHolder) CreateToken

func (j *JwtTokenHolder) CreateToken(ctx context.Context, uid string, perms string, expiresIn int64) (string, error)

func (*JwtTokenHolder) IsLogout

func (j *JwtTokenHolder) IsLogout(ctx context.Context, uid string, loginAt int64) bool

已退出登录

func (*JwtTokenHolder) SetLogout

func (j *JwtTokenHolder) SetLogout(ctx context.Context, uid string, loginOut int64) error

设置退出登录

func (*JwtTokenHolder) VerifyToken

func (j *JwtTokenHolder) VerifyToken(ctx context.Context, token string, uid string) (jwt.MapClaims, error)

Jump to

Keyboard shortcuts

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