jwt

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWT

type JWT struct {
	SignKey []byte
}

func NewJWT

func NewJWT(signKey []byte) *JWT

func (*JWT) Create

func (j *JWT) Create(claims jwt.Claims) (tokenString string, err error)

func (*JWT) Parse

func (j *JWT) Parse(token string) (tkn *jwt.Token, err error)

func (*JWT) Valid

func (j *JWT) Valid(token string) (valid bool, err error)

type UserClaim

type UserClaim struct {
	UserID      int64    `json:"user_id"`
	SecondaryID string   `json:"secondary_id"`
	ClientID    string   `json:"client_id"`
	Scopes      []string `json:"scopes"`
	jwt.StandardClaims
}

UserClaim defines user token claim

Jump to

Keyboard shortcuts

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