jwt

package
v0.0.0-...-ffea4ed Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Issuer = "Distributed, Blockchain and Business Solutions LLC"

Issuer is the value used as a JWT Claim issuer.

View Source
var TokenEncodeString = []byte("dfgr45uty53jyjerghejhgjeaNRghehy5")

TokenEncodeString is the byte string used for encoding/decoding JWT tokens. It's recommended to change this value for every use of the package

Functions

func CreateToken

func CreateToken(data map[string]interface{}, expires int64) (string, error)

CreateToken will create new JWT token with the provided data

func ParseToken

func ParseToken(t string) (map[string]interface{}, error)

ParseToken parses a JWT token and returns the custom data of the token

Types

type Claims

type Claims struct {
	Data map[string]interface{}
	jwtlib.StandardClaims
}

Claims contains the JWT StandardClaims and a data map for custom data

Jump to

Keyboard shortcuts

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