auth

package
v0.9.23 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TokenValidateFailed = errors.New("token validate failed")
)

Functions

This section is empty.

Types

type JwtAuth

type JwtAuth struct {
	ClaimsKey string
	// contains filtered or unexported fields
}

JwtAuth jwt

func New

func New(signKey []byte) *JwtAuth

New return JwtAuth instance

func (JwtAuth) GenerateToken

func (jwtAuth JwtAuth) GenerateToken(claims jwt.Claims) (string, error)

CreateToken 生成token

func (JwtAuth) ParseToken

func (jwtAuth JwtAuth) ParseToken(token string) (jwt.Claims, error)

ParseToken parse token

func (JwtAuth) ParseTokenWithClaims

func (jwtAuth JwtAuth) ParseTokenWithClaims(token string, claims jwt.Claims) error

ParseToken parse token

Jump to

Keyboard shortcuts

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