services

package
v0.0.0-...-b73fbf5 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(email string) (string, error)

GenerateToken creates a JWT with email and expiration time in the payload

func HashPassword

func HashPassword(password string) string

HashPassword takes a string in parameter and returns the same string hashed with sha512

Types

type Claims

type Claims struct {
	Email string
	jwt.StandardClaims
}

func DecodeToken

func DecodeToken(tokenString string) (*jwt.Token, *Claims, error)

DecodeToken decode and validates a token

type Rsa

type Rsa struct {
	PublicKeyPath  string
	PrivateKeyPath string
	PublicKey      interface{}
	PrivateKey     interface{}
}

Rsa is the struct to get the rsa keys used to generate and verify tokens from the environment variables

Jump to

Keyboard shortcuts

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