passport

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	UserId string
	jwt.RegisteredClaims
}

func GetClaims

func GetClaims(c *app.RequestContext) (claims Claims)

GetClaims 获取授权标识

type Passport

type Passport struct {
	Namespace string
	Key       string
}

func NewPassport

func NewPassport(namespace string, key string) *Passport

func (*Passport) Create

func (x *Passport) Create(userId string, jti string) (tokenString string, err error)

Create 生成令牌

func (*Passport) Verify

func (x *Passport) Verify(tokenString string) (claims Claims, err error)

Verify 验证令牌

Jump to

Keyboard shortcuts

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