utils

package
v0.0.0-...-0d90696 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BodyParser

func BodyParser(r *http.Request) ([]byte, error)

func CheckErr

func CheckErr(err error)

func ExtractBearerToken

func ExtractBearerToken(r *http.Request) string

func GenerateJWT

func GenerateJWT(user models.User) (string, error)

func JwtExtract

func JwtExtract(r *http.Request) (map[string]interface{}, error)

func RespondWithError

func RespondWithError(response http.ResponseWriter, message string, statusCode int)

func RespondWithJSON

func RespondWithJSON(response http.ResponseWriter, data interface{}, statusCode int)

func ToJson

func ToJson(w http.ResponseWriter, data interface{}, statusCode int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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