jwt

package
v0.0.0-...-00b26e8 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const KeyUserId = "USER_ID"

Variables

View Source
var (
	TokenExpired     = errors.New("Token is expired")
	TokenNotValidYet = errors.New("Token not active yet")
	TokenMalformed   = errors.New("That's not even a token")
	TokenInvalid     = errors.New("Couldn't handle this token")
)

Functions

func CreateToken

func CreateToken(userId uint) (string, error)

creating, signing, and encoding a JWT token using the HMAC signing

Types

type CustomClaims

type CustomClaims struct {
	UserId uint
	jwt.StandardClaims
}

func ParseToken

func ParseToken(tokenString string) (claims *CustomClaims, err error)

parsing and validating a token using the HMAC signing

Jump to

Keyboard shortcuts

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