response

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ServerError500ResponseString = "server failed to complete request. please try after some time."
View Source
const UnauthorisedError401ResponseString = "The authorization credentials provided for the request are invalid."

Variables

This section is empty.

Functions

func SendBadRequest400Response

func SendBadRequest400Response(c *gin.Context, userErrMessage string)

SendBadRequest400Response sets a "bad request" (HTTP 400) on the gin context and send userErrMessage as a response message as msg. Finally it also aborts any other handlers in-line by calling Abort.

func SendBadRequestPlatform400Response

func SendBadRequestPlatform400Response(c *gin.Context, userErrMessage string)

SendBadRequestPlatform400Response sets a "bad request" (HTTP 400) on the gin context and send userErrMessage as a response message as res_str. Finally it also aborts any other handlers in-line by calling Abort.

func SendCreated201Response

func SendCreated201Response(c *gin.Context, response interface{})

SendCreated201Response sets a ok status (HTTP 201) on the gin context and send responseBody parameter passed as JSON response. Finally it also aborts any other handlers in-line by calling Abort.

func SendNoContent204Response

func SendNoContent204Response(c *gin.Context)

SendNoContent204Response sets a ok status (HTTP 204) on the gin context Finally it also aborts any other handlers in-line by calling Abort.

func SendNotFound404Response

func SendNotFound404Response(c *gin.Context, userErrMessage string)

SendNotFound404Response sets a "resource not found" (HTTP 404) on the gin context and send userErrMessage to user. Finally it also aborts any other handlers in-line by calling Abort.

func SendOK200Response

func SendOK200Response(c *gin.Context, response interface{})

SendOK200Response sets a ok status (HTTP 200) on the gin context and send responseBody parameter passed as JSON response. Finally it also aborts any other handlers in-line by calling Abort.

func SendPaymentRequired402Response

func SendPaymentRequired402Response(c *gin.Context, response interface{})

SendPaymentRequired402Response sets a ok status (HTTP 402) on the gin context Finally it also aborts any other handlers in-line by calling Abort.

func SendResourceConflict409Response

func SendResourceConflict409Response(c *gin.Context, userErrMessage string)

SendResourceConflict409Response sets the response status code to Unauthorised (http 409) on the gin context and send userErrMessage to user. Finally it also aborts any other handlers in-line by calling Abort.

func SendServerError500Response

func SendServerError500Response(c *gin.Context)

SendServerError500Response sets the response status code to Unauthorised (http 500) on the gin context and send userErrMessage to user. Finally it also aborts any other handlers in-line by calling Abort.

func SendStatusProcessing

func SendStatusProcessing(c *gin.Context, userErrMessage string)

SendStatusProcessing sets the response status code to Unauthorised (http 102) on the gin context and send userErrMessage to user. Finally it also aborts any other handlers in-line by calling Abort.

func SendUnauthorised401Response

func SendUnauthorised401Response(c *gin.Context)

SendUnauthorised401Response sets the response status code to Unauthorised (http 401) on the gin context and send userErrMessage to user. Finally it also aborts any other handlers in-line by calling Abort.

Types

This section is empty.

Jump to

Keyboard shortcuts

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