generates

package
v0.0.0-...-af57f77 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateBasic

type GenerateBasic struct {
	UserInfo  *models.PublicUserInfo
	CreateAt  *time.Time
	TokenInfo *models.Token
}

GenerateBasic provide the basis of the generated token data

type JWTAccessClaims

type JWTAccessClaims struct {
	UserName string `json:"username,omitempty"`
	Email    string `json:"email,omitempty"`
	Name     string `json:"name,omitempty"`
	jwt.StandardClaims
}

JWTAccessClaims jwt claims

type JWTAccessGenerate

type JWTAccessGenerate struct {
	SignedKey    []byte
	SignedMethod jwt.SigningMethod
}

JWTAccessGenerate generate the jwt access token

func NewJWTAccessGenerate

func NewJWTAccessGenerate(key []byte, method jwt.SigningMethod) *JWTAccessGenerate

NewJWTAccessGenerate create to generate the jwt access token instance

func (*JWTAccessGenerate) Parse

func (a *JWTAccessGenerate) Parse(tokenString string) (*models.PublicUserInfo, error)

Parse parses a UserName from a token

func (*JWTAccessGenerate) Token

func (a *JWTAccessGenerate) Token(data *GenerateBasic) (string, error)

Token based on the UUID generated token

func (*JWTAccessGenerate) Validate

func (a *JWTAccessGenerate) Validate(tokenString string) (bool, error)

Validate validates the token

Jump to

Keyboard shortcuts

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