Documentation
¶
Overview ¶
This Go package provides ready-to-use handlers designed for quick and easy usage without the need for extensive code writing, often referred to as 'low-code.' These handlers are constructed based on the origin of the request being made to the Lambda function. The package's documentation covers the public API, including details about available handlers, their signatures, accepted input types, and produced output types. Users can benefit from clear usage examples, code comments that explain the logic behind each handler, installation and configuration instructions, error handling guidance, and any external dependencies required. Additionally, the documentation showcases real-world use cases, integration examples with other services or frameworks, and recommendations for testing to ensure the handlers function as intended. Users can find licensing information, attribution requirements, and details on how to stay updated with package releases and contribute to its development. The package aims to simplify the development process by providing developers with pre-built handlers that can be easily integrated into their AWS Lambda functions.
Index ¶
- func HandleAPIGatewayEvent(ctx context.Context, event events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
- func HandleDynamoDBStreamEvent(ctx context.Context, event events.DynamoDBEvent) (events.DynamoDBEventResponse, error)
- func HandleSQSEvent(ctx context.Context, event events.DynamoDBEvent) (events.DynamoDBEventResponse, error)
- type DynamoDBClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleAPIGatewayEvent ¶ added in v0.1.6
func HandleAPIGatewayEvent(ctx context.Context, event events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
HandleLambdaEvent is the function responsible for receiving API Gateway requests in your Lambda function. It redirects these requests to the DynamoDBClient, which is responsible for interacting with the database and returning a response with the result.
Before using this function, you'll need to build a Config object with request, database, and response configuration, and instantiate the DynamoDBClient.
If everything is okay, you will receive an APIGatewayProxyResponse. However, if something goes wrong, you'll receive an empty response and an error describing the problem.
func HandleDynamoDBStreamEvent ¶ added in v0.1.6
func HandleDynamoDBStreamEvent(ctx context.Context, event events.DynamoDBEvent) (events.DynamoDBEventResponse, error)
func HandleSQSEvent ¶ added in v0.1.6
func HandleSQSEvent(ctx context.Context, event events.DynamoDBEvent) (events.DynamoDBEventResponse, error)
Types ¶
type DynamoDBClient ¶
type DynamoDBClient struct {
// contains filtered or unexported fields
}
DynamoDBClient is a struct representing the DynamoDB client. It includes the 'svc' attribute, which is an interface to enable mocking the dynamodb.DynamoDB service client's API operation, paginators, and waiters. This make unit testing your code that calls out to the SDK's service client's calls easier.
var Client *DynamoDBClient
Client refers to the DynamoDBClient created for integrating the Lambda function with DynamoDB. It enables the redirection of GET, POST, PUT, and DELETE requests.
func NewDynamoDBClient ¶
func NewDynamoDBClient(configuration ...*lambda.Config) (*DynamoDBClient, error)
NewDynamoDBClient is responsible for creating a new DynamoDBClient, which is a crucial function.
If you have a 'DYNAMO_ENDPOINT' environment variable pointing to a local DynamoDB container defined, the session will automatically be configured to use this endpoint.
This function creates a session and loads the configurations if provided, returning a pointer reference to the DynamoDBClient.
If something goes wrong, you will receive an empty client and an error.