jwt

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SigKey = "mal3d1ct10n"

SigKey JWT signature key and you need to set your own!

Functions

func New

func New(userID, level string, expiration time.Time) (token string, err error)

New creates new JWT with claims payload.

Types

type Claims

type Claims struct {
	UserID string
	Level  string
	jwt.StandardClaims
}

Claims represents JWT payload.

func Parse

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

Parse validates and extract claims from token.

func ParseFromHeader added in v0.3.0

func ParseFromHeader(h http.Header) (*Claims, error)

ParseFromHeader parses Authorization bearer token as JWT.

Jump to

Keyboard shortcuts

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