Documentation ¶
Index ¶
- Constants
- func Proxy(r Response) (*events.APIGatewayProxyResponse, error)
- type Error
- type Headers
- type Response
- func BadRequest(message string) Response
- func Conflict(message string) Response
- func Created(body interface{}, location string) Response
- func InternalServerError(message string) Response
- func MethodNotAllowed(allow string) Response
- func NoContent() Response
- func NotFound(message string) Response
- func OK(body interface{}, headers Headers) Response
Constants ¶
View Source
const DefaultStatusText string = ""
DefaultStatusText is used for substitution with a standard HTTP status text
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error struct { Code int `json:"code,omitempty"` // code (use either code or reason) Reason string `json:"reason,omitempty"` // reason (use either code or reason) Message string `json:"message"` // human-readable description Details interface{} `json:"details,omitempty"` // public details Errors []Error `json:"errors,omitempty"` // detailed errors Meta interface{} `json:"-"` // private meta data (excluded from marshalling) }
Error response body
type Response ¶
type Response struct { StatusCode int `json:"statusCode"` // HTTP status code Body interface{} `json:"body"` // HTTP response body Headers Headers `json:"headers"` // HTTP headers }
Response message
func InternalServerError ¶
InternalServerError returns 500 status code
func MethodNotAllowed ¶
MethodNotAllowed returns 405 status code
Click to show internal directories.
Click to hide internal directories.