helpers

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedirectWithError

func RedirectWithError(c *gin.Context, err error)

func RedirectWithString

func RedirectWithString(c *gin.Context, message string)

func RedirectWithToken

func RedirectWithToken(c *gin.Context, token string)

func Respond

func Respond(c *gin.Context, code int)

Respond with status

func RespondWithError

func RespondWithError(c *gin.Context, code int, data error)

Respond with error, aborts rest of request

func RespondWithJSON

func RespondWithJSON(c *gin.Context, code int, data interface{})

Respond returns status and json

func RespondWithString

func RespondWithString(c *gin.Context, code int, data string)

Respond returns basic status and message

func RespondWithToken

func RespondWithToken(c *gin.Context, token string)

func StringToJSON

func StringToJSON(s string) map[string]interface{}

func ValidatePathParameters

func ValidatePathParameters(c *gin.Context, expectedParameters ...string) bool

* Validates path parameters exist * This doesn't care if there are extra parameters in the path * it just checks that it contains the required ones * /v1/society/compsoc will pass if given compsoc * /v1/society will fail if given compsoc

Types

This section is empty.

Jump to

Keyboard shortcuts

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