jwt

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	// Id is the agent id
	Id string `json:"id"`
	jwt.RegisteredClaims
}

func DefaultClaims

func DefaultClaims(opts ...OptionsFunc) *Claims

type JWTHandler

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

func New

func New(key string) *JWTHandler

func (*JWTHandler) GenerateJWT

func (j *JWTHandler) GenerateJWT(claims *Claims) (tokenString string, err error)

func (*JWTHandler) Validate

func (j *JWTHandler) Validate(r *http.Request) (*Claims, error)

func (*JWTHandler) ValidateToken

func (j *JWTHandler) ValidateToken(signedToken string) (*Claims, error)

type OptionsFunc

type OptionsFunc func(*Claims)

func OptionId

func OptionId(id string) OptionsFunc

Jump to

Keyboard shortcuts

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