jwt

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomClaims

type CustomClaims struct {
	UserId int64
	UserNo string
	jwt.StandardClaims
}

type Instance

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

func NewJwtInstance

func NewJwtInstance(c Jwt) *Instance

func (*Instance) DecryptToken

func (j *Instance) DecryptToken(tokenString string) (claims *CustomClaims, err error)

func (*Instance) GenToken

func (j *Instance) GenToken(userId int64) (jwtToken string, err error)

type Jwt

type Jwt struct {
	SecretKey   string        `json:"secretKey" yaml:"secretKey"`
	EffectAfter time.Duration `json:"effectAfter" yaml:"effectAfter"`
	MaxAge      time.Duration `json:"maxAge" yaml:"maxAge"`
}

Jump to

Keyboard shortcuts

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