Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalResponse ¶
func MarshalResponse(response interface{}, statusCode int) *events.APIGatewayProxyResponse
MarshalResponse replaces nil maps + slices and serializes a response model.
response is a pointer to a struct and statusCode is the http status to return
Types ¶
type Client ¶ added in v1.12.0
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶ added in v1.12.0
func NewClient(lambda lambdaiface.LambdaAPI, functionName string) *Client
Create a new client for invoking a lambda gateway API proxy directly.
func (*Client) Invoke ¶ added in v1.12.0
Invoke a former API gateway proxy Lambda directly.
Unmarshals the response body into output and returns (http status code, error). A non-nil error could be caused by:
- failure to marshal request / unmarshal response
- lambda function failed to invoke (does not exist, insufficient permissions)
- lambda function runtime exception (panic, OOM, timeout)
- status code is not 2XX
This is similar to genericapi.Invoke and will be obsolete once we consolidate the internal API.
type MockClient ¶ added in v1.12.0
func (*MockClient) Invoke ¶ added in v1.12.0
func (m *MockClient) Invoke(input, output interface{}) (int, error)
Click to show internal directories.
Click to hide internal directories.