Mayfly.Runtime (Mayfly v0.1.0)

View Source

Handles communication with the AWS Lambda Runtime API. Provides functions for fetching invocations and sending responses.

Summary

Functions

Sends an initialization error to the Lambda Runtime API.

Sends an invocation error to the Lambda Runtime API.

Sends a successful response for a Lambda invocation.

Fetches the next invocation from the Lambda Runtime API. Returns {:ok, {protocol, headers, body}} on success or {:error, reason} on failure.

Returns the base service endpoint for the Lambda Runtime API.

Functions

init_error(error)

@spec init_error(map()) :: {:ok, any()} | {:error, any()}

Sends an initialization error to the Lambda Runtime API.

invocation_error(aws_req_id, error)

@spec invocation_error(binary(), map()) :: {:ok, any()} | {:error, any()}

Sends an invocation error to the Lambda Runtime API.

invocation_response(aws_req_id, response)

@spec invocation_response(binary(), any()) :: {:ok, any()} | {:error, any()}

Sends a successful response for a Lambda invocation.

next_invocation()

@spec next_invocation() :: {:ok, {atom(), list(), binary()}} | {:error, any()}

Fetches the next invocation from the Lambda Runtime API. Returns {:ok, {protocol, headers, body}} on success or {:error, reason} on failure.

service_endpoint()

@spec service_endpoint() :: String.t()

Returns the base service endpoint for the Lambda Runtime API.