auth

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package auth provides authentication and authorization methods using JSON Web Tokens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWT

type JWT interface {
	GenerateToken(payload map[string]interface{}, exp int) (string, error)
	ExtractToken(r *http.Request) (string, error)
	GetDataToken(r *http.Request, key string) (interface{}, error)
}

JWT uses JSON Web Token for generate and extract token.

func NewJWT

func NewJWT(pathPrivateKey, pathPublicKey string) JWT

NewJWT create new instance of JWT.

Jump to

Keyboard shortcuts

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