jwt

package
v0.0.0-...-d512d6d Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenToken

func GenToken(claims *MyCustomClaims) (string, error)

GenToken generate JWT from user infos with secret

Types

type MyCustomClaims

type MyCustomClaims struct {
	jwt.RegisteredClaims
	UserId   uint64 `json:"userId"`
	Username string `json:"username"`
	Role     int32  `json:"role"`
}

func ParseToken

func ParseToken(tokenString string) (*MyCustomClaims, error)

ParseToken extract infos from token

Jump to

Keyboard shortcuts

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