Documentation ¶
Index ¶
- Variables
- func BadRequestResponse(err error) (events.APIGatewayProxyResponse, error)
- func GenericResponse(statusCode int, body string, headers map[string]string) (events.APIGatewayProxyResponse, error)
- func GenericSuccessResponse(message string) (events.APIGatewayProxyResponse, error)
- func InternalServerErrorResponse(err error) (events.APIGatewayProxyResponse, error)
- func JSONSuccessResponse(body interface{}) (events.APIGatewayProxyResponse, error)
- func LockedResponse(err error) (events.APIGatewayProxyResponse, error)
- func MaintenanceResponse(message string) events.APIGatewayProxyResponse
- func NoContent() (events.APIGatewayProxyResponse, error)
- func NotFoundResponse(err error) (events.APIGatewayProxyResponse, error)
- func OptionsResponse() events.APIGatewayProxyResponse
- func RateLimitResponse(message string) events.APIGatewayProxyResponse
- func SuccessResponse(body string) (events.APIGatewayProxyResponse, error)
- func TooManyRequests(message string) (events.APIGatewayProxyResponse, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ContentTypeJSONHeader = map[string]string{"Content-Type": "application/json"}
Functions ¶
func BadRequestResponse ¶
func BadRequestResponse(err error) (events.APIGatewayProxyResponse, error)
BadRequestResponse - invalid user input
func GenericResponse ¶
func GenericResponse(statusCode int, body string, headers map[string]string) (events.APIGatewayProxyResponse, error)
GenericResponse - called by the other functions
func GenericSuccessResponse ¶
func GenericSuccessResponse(message string) (events.APIGatewayProxyResponse, error)
SuccessResponse - everything worked
func InternalServerErrorResponse ¶
func InternalServerErrorResponse(err error) (events.APIGatewayProxyResponse, error)
InternalServerErrorResponse - something went wrong
func JSONSuccessResponse ¶
func JSONSuccessResponse(body interface{}) (events.APIGatewayProxyResponse, error)
JSONSuccessResponse - try to JSONify any struct and send it as the body of a successful response Return an internal server error if JSON marshalling fails NOTE: struct fields must be exported (i.e. Capitalised) and tagged
func LockedResponse ¶
func LockedResponse(err error) (events.APIGatewayProxyResponse, error)
func MaintenanceResponse ¶
func MaintenanceResponse(message string) events.APIGatewayProxyResponse
func NoContent ¶
func NoContent() (events.APIGatewayProxyResponse, error)
func NotFoundResponse ¶
func NotFoundResponse(err error) (events.APIGatewayProxyResponse, error)
NotFoundResponse - 404
func OptionsResponse ¶
func OptionsResponse() events.APIGatewayProxyResponse
func RateLimitResponse ¶
func RateLimitResponse(message string) events.APIGatewayProxyResponse
func SuccessResponse ¶
func SuccessResponse(body string) (events.APIGatewayProxyResponse, error)
SuccessResponse - everything worked
func TooManyRequests ¶
func TooManyRequests(message string) (events.APIGatewayProxyResponse, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.