apigateway

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: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Error400Content = `` /* 198-byte string literal not displayed */
	Error401Content = `` /* 187-byte string literal not displayed */
	Error403Content = `` /* 185-byte string literal not displayed */
	Error404Content = `` /* 204-byte string literal not displayed */
	Error405Content = `` /* 204-byte string literal not displayed */
	Error410Content = `` /* 184-byte string literal not displayed */
	Error413Content = `` /* 174-byte string literal not displayed */
	Error429Content = `` /* 249-byte string literal not displayed */

	Error500Content = `` /* 228-byte string literal not displayed */
	Error502Content = `` /* 232-byte string literal not displayed */
	Error503Content = `` /* 217-byte string literal not displayed */
)

Common HTTP error response body content

Variables

This section is empty.

Functions

func ProxyResponse

func ProxyResponse(status int, headers http.Header, body []byte) events.APIGatewayProxyResponse

ProxyResponse returns an API Gateway Proxy HTTP response with the provided status, headers, and body.

The HTTP response body is always base64 encoded and the appropriate flag is set for API Gateway to handle it. If using REST APIs, make sure to set the Binary Media Types to "*/*". This is not necessary for HTTP APIs.

If headers is nil or empty, DefaultHTTPHeaders() will be used.

func RedirectBody

func RedirectBody(url string) (string, error)

RedirectBody returns a useful html body for 30x response status codes.

func V2HTTPResponse

func V2HTTPResponse(status int, headers http.Header, body []byte) events.APIGatewayV2HTTPResponse

V2HTTPResponse returns an API Gateway HTTP response with the provided status, headers, and body.

The HTTP response body is always base64 encoded and the appropriate flag is set for API Gateway to handle it. If using REST APIs, make sure to set the Binary Media Types to "*/*". This is not necessary for HTTP APIs.

If headers is nil or empty, DefaultHTTPHeaders() will be used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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