utils

package
v0.0.0-...-d926718 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJWT

func CreateJWT(user models.UserDTO) (value string, errorOccured bool)

CreateJWT turns a UserDTO into a JWT token string

func RespondError

func RespondError(w http.ResponseWriter, code int, message string)

RespondError handles errors in response

func RespondJSON

func RespondJSON(w http.ResponseWriter, status int, payload interface{})

RespondJSON responds JSON data

func ValidateJWT

func ValidateJWT(tokenStr string) models.UserDTO

ValidateJWT validates that a JWT token is valid

Types

This section is empty.

Jump to

Keyboard shortcuts

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