jwt

package
Version: v0.0.0-...-49abefd Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package jwt contains structs that handles JWT token encoding and parsing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler exposes JWT related functions

func NewHandler

func NewHandler(config *env.RestConfig) *Handler

NewHandler creates a new JWT Handler

func (*Handler) Generate

func (h *Handler) Generate(id int64) (string, *jwtgo.StandardClaims, error)

Generate creates a new JWT token with the given id

func (*Handler) Parse

func (h *Handler) Parse(tokenString string) (*jwtgo.StandardClaims, error)

Parse receives a token string, parses it, validates its content, and returns a token claims

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL