jwt

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(claims *Claims) (string, error)

func GetValueFromClaims

func GetValueFromClaims(key string, claims jwt.Claims) string

Types

type Claims

type Claims struct {
	Scope       string `json:"scope"`
	RedirectURI string `json:"redirect_uri"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(token string) (*Claims, error)

func (*Claims) Valid

func (a *Claims) Valid() error

Valid claims verification

type JwtSetting

type JwtSetting struct {
	Secret      string `json:"secret" yaml:"secret"`
	Method      string `json:"mehtod" yaml:"method"`
	OnlineUsers int    `json:"onlineUser" yaml:"onlineUsers"`
}
var (
	Setting *JwtSetting = &JwtSetting{
		Method: "HS256",
	}
)

type UserDetails

type UserDetails struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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