common

package
v0.0.0-...-b26fc39 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADMIN               = "ADMIN"
	ORGANIZATION_MEMBER = "ORGANIZATION_MEMBER"
	PARTICIPANT         = "PARTICIPANT"
	GUEST               = "GUEST"
	NONE                = "NONE"
)

exported roles

Variables

View Source
var (
	HTTPStatusServiceUnavailable = models.HTTPStatus{Status: http.StatusServiceUnavailable, Message: http.StatusText(http.StatusServiceUnavailable)}
	HTTPStatusOK                 = models.HTTPStatus{Status: http.StatusOK, Message: http.StatusText(http.StatusOK)}
)

Functions

func ConvertUintToString

func ConvertUintToString(number uint) string

func HTTPRequestIsSuccessful

func HTTPRequestIsSuccessful(httpCode int) bool

func SendHTTPBadRequest

func SendHTTPBadRequest(e echo.Context) error

SendHTTPBadRequest sends a 400

func SendHTTPForbidden

func SendHTTPForbidden(e echo.Context) error

SendHTTPForbidden sends a 401

func SendHTTPOk

func SendHTTPOk(e echo.Context) error

SendHTTPOk sends a 200

func SendHTTPOkWithBody

func SendHTTPOkWithBody(e echo.Context, payload interface{}) error

SendHTTPOkWithBody sends a 200 with payload

func SendHTTPStatusCreated

func SendHTTPStatusCreated(e echo.Context) error

SendHTTPStatusCreated sends a 201

func SendHTTPStatusInternalServerError

func SendHTTPStatusInternalServerError(e echo.Context) error

SendHTTPStatusService

func SendHTTPStatusServiceUnavailable

func SendHTTPStatusServiceUnavailable(e echo.Context) error

SendHTTPStatusServiceUnavailable sends a 503

func SendHTTPWithMessage

func SendHTTPWithMessage(e echo.Context, status models.HTTPStatus) error

SendHTTPWithMessage takes in an http code and message and sends it to client

func SendHTTPWithPayload

func SendHTTPWithPayload(e echo.Context, status models.HTTPStatus, payload interface{}) error

SendHTTPWithPayload takes in an http code and sends it to the client with an associated payload

Types

This section is empty.

Jump to

Keyboard shortcuts

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