Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIGatewayV2HTTPContext ¶
type APIGatewayV2Request ¶
type APIGatewayV2Request struct {
Version string `json:"version"`
RouteKey string `json:"routeKey"`
RawPath string `json:"rawPath"`
RawQueryString string `json:"rawQueryString"`
Headers map[string]string `json:"headers"`
Cookies []string `json:"cookies,omitempty"`
QueryStringParameters map[string]string `json:"queryStringParameters,omitempty"`
RequestContext APIGatewayV2RequestContext `json:"requestContext"`
Body string `json:"body,omitempty"`
IsBase64Encoded bool `json:"isBase64Encoded"`
}
APIGatewayV2Request is the HTTP API payload format consumed by Mangum.
type APIGatewayV2RequestContext ¶
type APIGatewayV2RequestContext struct {
RequestID string `json:"requestId"`
TimeEpoch int64 `json:"timeEpoch"`
DomainName string `json:"domainName"`
Stage string `json:"stage"`
HTTP APIGatewayV2HTTPContext `json:"http"`
}
type APIGatewayV2Response ¶
type APIGatewayV2Response struct {
StatusCode int `json:"statusCode"`
Headers map[string]string `json:"headers"`
Cookies []string `json:"cookies"`
Body string `json:"body"`
IsBase64Encoded bool `json:"isBase64Encoded"`
}
APIGatewayV2Response is the response format emitted by Mangum.
type Lambda ¶
type Lambda struct {
FunctionName string `json:"function,omitempty"`
Qualifier string `json:"qualifier,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
Region string `json:"region,omitempty"`
EventFormat string `json:"event_format,omitempty"`
Timeout string `json:"timeout,omitempty"`
MaxBodySize int64 `json:"max_body_size,omitempty"`
RoleARN string `json:"role_arn,omitempty"`
ExternalID string `json:"external_id,omitempty"`
SessionName string `json:"session_name,omitempty"`
UpstreamHeaders map[string][]string `json:"header_upstream,omitempty"`
// contains filtered or unexported fields
}
Lambda implements an HTTP handler that invokes a Lambda function.
func (*Lambda) CaddyModule ¶
func (*Lambda) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*Lambda) UnmarshalCaddyfile ¶
UnmarshalCaddyfile configures the global directive from Caddyfile. Syntax:
lambda [<matcher>] {
function <function name>
qualifier <version or alias>
endpoint <url>
region <region>
timeout <duration>
max_body_size <bytes>
role_arn <role ARN>
external_id <external ID>
session_name <session name>
header_upstream <header> <value>
}
type Reply ¶
type Reply struct {
// Must be set to the constant "HTTPJSON-REP"
Type string `json:"type"`
// Reply metadata. If omitted, a default 200 status with empty headers will be used.
Meta *ReplyMeta `json:"meta"`
// Response body
Body string `json:"body"`
// Encoding of Body - Valid values: "", "base64"
BodyEncoding string `json:"bodyEncoding"`
}
Reply encapsulates the response from a Lambda invocation. AWS Lambda functions should return a JSON object that matches this format.
type ReplyMeta ¶
type ReplyMeta struct {
// HTTP status code (e.g. 200 or 404)
Status int `json:"status"`
// HTTP response headers
Headers map[string][]string `json:"headers"`
}
ReplyMeta encapsulates HTTP response metadata that the lambda function wishes Caddy to set on the HTTP response.
*NOTE* that header values must be encoded as string arrays
type Request ¶
type Request struct {
// Set to the constant "HTTPJSON-REQ"
Type string `json:"type"`
// Metadata about the HTTP request
Meta *RequestMeta `json:"meta"`
// HTTP request body (may be empty)
Body string `json:"body"`
// Encoding of Body - Valid values: "", "base64"
BodyEncoding string `json:"bodyEncoding"`
}
Request represents a single HTTP request. It will be serialized as JSON and sent to the AWS Lambda function as the function payload.
type RequestMeta ¶
type RequestMeta struct {
// HTTP method used by client (e.g. GET or POST)
Method string `json:"method"`
// Path portion of URL without the query string
Path string `json:"path"`
// Query string (without '?')
Query string `json:"query"`
// Host field from net/http Request, which may be of the form host:port
Host string `json:"host"`
// Proto field from net/http Request, for example "HTTP/1.1"
Proto string `json:"proto"`
// HTTP request headers
Headers map[string][]string `json:"headers"`
}
RequestMeta represents HTTP metadata present on the request