jwt

package module
v0.0.0-...-7ee8e83 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthTokenObject

type AuthTokenObject struct {
	Token    string      `json:"token" bson:"token,omitempty"`
	ExpireAt string      `json:"expireAt" bson:"expireAt,omitempty"`
	Payload  interface{} `json:"payload" bson:"payload,omitempty"`
}

AuthTokenObject - Encapsulated Object

func GenToken

func GenToken(payload interface{}, secret string) (AuthTokenObject, error)

GenToken - A Util function to generate jwtToken which can be used in the request header

func Parse

func Parse(tokenObj AuthTokenObject, secret string) (AuthTokenObject, error)

Parse - Function to Parse JWT

type Claims

type Claims struct {
	Payload interface{} `json:"payload" bson:"payload,omitempty"`
	jwtgo.StandardClaims
}

Claims - Claims Structure

Jump to

Keyboard shortcuts

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