jwthelper

package
v0.0.0-...-dc0fecf Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJWT

func CreateJWT(jwtSecret, username, roles string, expires int64) (string, error)

Types

type CustomClaims

type CustomClaims struct {
	jwt.StandardClaims
	Username string `json:"username,omitempty"`
	Roles    string `json:"roles,omitempty"`
}

func GetClaimsFromContext

func GetClaimsFromContext(jwtSecret string, ctx context.Context) (*CustomClaims, error)

Jump to

Keyboard shortcuts

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