common

package
v0.0.0-...-7b4e26c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidHash error
	ErrInvalidHash = errors.New("the encoded hash is not in the correct format")
	// ErrIncompatibleVersion error
	ErrIncompatibleVersion = errors.New("incompatible version of argon2")
)

Functions

func GetAvatarURL

func GetAvatarURL(emailHash string) string

GetAvatarURL get avatar url from email hash

func Hash

func Hash(password string) (encodedHash string, err error)

Hash using argon 2

func LoadEnv

func LoadEnv(dir string)

LoadEnv load environement variables

func SignToken

func SignToken(claims jwt.StandardClaims) (token string, err error)

SignToken sign jwt token using JWT_SECRET

func Verify

func Verify(password, encodedHash string) (match bool, err error)

Verify argon 2

func VerifyToken

func VerifyToken(token string, issuer string) (claims *jwt.StandardClaims, err error)

VerifyToken verify token

Types

This section is empty.

Jump to

Keyboard shortcuts

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