utils

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractToken

func ExtractToken(c *gin.Context) string

func GetUserId added in v0.1.2

func GetUserId(c *gin.Context) (int32, error)

func GetUserUsername added in v0.1.4

func GetUserUsername(c *gin.Context) (string, error)

func IsEmail added in v0.1.3

func IsEmail(identifier string) bool

func JwtAuthMiddleware

func JwtAuthMiddleware() gin.HandlerFunc

func MakeHTTPRequest

func MakeHTTPRequest(c *gin.Context, method string, url string, requestBody interface{}) ([]byte, int, error)

func NewError

func NewError(ctx *gin.Context, status int, err error)

func TokenValid

func TokenValid(c *gin.Context) error

Types

type HTTPError

type HTTPError struct {
	Code    int    `json:"code" example:"400"`
	Message string `json:"message" example:"status bad request"`
}

Jump to

Keyboard shortcuts

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