services

package
v0.0.0-...-f2300c2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrJWTExtract = errors.New("Error while extracting values from JWT Token")

ErrJWTExtract is an error thrown

View Source
var ErrJWTSigning = errors.New("Error while signing the JWT Token")

ErrJWTSigning is an error thrown during the JWT Signing process

Functions

func ExtractToken

func ExtractToken(tokenString, secret string) (string, error)

ExtractToken takes a JWT Token that is used by the application and extracts the values out with the application secret. If process goes well, it would be able to return the values

func NewToken

func NewToken(id string, exp int, secret, issuer string) (string, error)

NewToken creates a new JWT token that is to be used by the application id generally refer to a string to be stored - in this case is user id exp is the expiry in the number of seconds after its issue issuer is to specify the application that is providing this token as an identifier secret is to seal everything into the token

Types

type JWTCustomClaims

type JWTCustomClaims struct {
	ID string `json:"id"`
	jwt.StandardClaims
}

JWTCustomClaims contains the list of values that is to be contained within the JWT Token

type Storage

type Storage struct {
	DB *gorm.DB
}

func (*Storage) AutoMigrate

func (s *Storage) AutoMigrate()

func (*Storage) NewDB

func (s *Storage) NewDB()

Jump to

Keyboard shortcuts

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