Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶
type Component struct {
Session *awsc.SessionComponent
}
Component implements the settings.Component interface.
type Config ¶
type Config struct {
ARN string `description:"Name/ARN of the lambda to invoke."`
Async bool `description:"Fire and forget rather than wait for a response."`
Request string `description:"Template string to transform incoming requests to Lambda requests."`
Success string `description:"Template string to transform a success response into a proxy response."`
Error string `description:"Template string to transform a Lambda error response into a proxy response."`
Authenticate bool `description:"Whether or not to use AWS authentication in a request."`
Session *awsc.SessionConfig
}
Config contains all settings for the lambda plugin.
type LambdaTransport ¶
type LambdaTransport struct {
Wrapped http.RoundTripper
URLParamFn func(context.Context) map[string]string
Name string
Async bool
RequestTemplate *template.Template
ResponseSuccessTemplate *template.Template
ResponseErrorTemplate *template.Template
Signer Signer
}
LambdaTransport is a decorator that rewrites a request into a call to the AWS Lambda Invoke API.
type MultiMap ¶
MultiMap adds a helper for extracting the first element of a slice of values. This is a stand-in for the url.Value and http.Query types which are map[string][]string.
type NOPSigner ¶
type NOPSigner struct{}
NOPSigner does nothing and is used for backwards compatibility.
type Request ¶
type Request struct {
Query MultiMap
Header MultiMap
URL map[string]string
Body map[string]interface{}
}
Request is a container for all available HTTP request values in a template.
type Signer ¶
type Signer interface {
Sign(r *http.Request, body io.ReadSeeker) error
}
Signer represents the AWS request signing process.
type TemplateContext ¶
type TemplateContext struct {
Request Request
// Response is only populated when rendering a response template
// and contains the unmarshalled JSON from the Lambda response.
Response Response
}
TemplateContext is the value given as the root object context when rendering a template.
type TransportResponse ¶
type TransportResponse struct {
Status int `json:"status"`
Header map[string][]string `json:"header"`
Passthrough bool `json:"bodyPassthrough"`
Body json.RawMessage `json:"body"`
}
TransportResponse is used to unmarshal the rendered response template.