response

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBlankPathParameterResponse = ErrorResponse{Error: "No path parameter"}
View Source
var ErrInternalServerErrorResponse = ErrorResponse{Error: "Internal server error"}
View Source
var ErrInvalidBodyNoSerialResponse = ErrorResponse{Error: "No serial number provided"}
View Source
var ErrInvalidBodyResponse = ErrorResponse{Error: "Invalid request body"}
View Source
var ErrInvalidContentTypeResponse = ErrorResponse{Error: "Invalid request content-type"}
View Source
var ErrInvalidMediaTypeResponse = ErrorResponse{Error: "Invalid mediatype"}
View Source
var ErrInvalidPathParameterResponse = ErrorResponse{Error: "Invalid path parameter"}

Functions

func APIResponse

func APIResponse(status int, rawBody interface{}) (*events.APIGatewayProxyResponse, error)

APIResponse constructs an AWS Lambda API response object from the given data This object can be returned from the Lambda's main handler and will be picked up by AWS Lambda and rendered into an HTTP Response

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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