awsl

package module
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 1 Imported by: 0

README

awsl (AWS Lambda)

CircleCI Build Status Go Report Card Coverage Status GoDoc DependaBot PRs Welcome

Package awsl provides helpful functions to work with AWS Lambda.

Installation

go get -u github.com/thepkg/awsl

Usage

  • FromDynamoDBMap - converts data from AWS Lambda Event for DynamoDB to regular map (from map[string]events.DynamoDBAttributeValue to map[string]interface{}):
func main() {
	lambda.Start(Handler)
}

func Handler(event events.DynamoDBEvent) {
	for _, record := range event.Records {
		rec := awsl.FromDynamoDBMap(record.Change.NewImage)
		// rec contains map[string]interface{} so it's easier to work with data!
	}
}

Documentation

Overview

Package awsl provides helpful functions to work with AWS Lambda.

https://github.com/thepkg/awsl

* **FromDynamoDBMap** - converts data from AWS Lambda Event for DynamoDB to regular map (from `map[string]events.DynamoDBAttributeValue` to `map[string]interface{}`):

func main() {
	lambda.Start(Handler)
}

func Handler(event events.DynamoDBEvent) {
	for _, record := range event.Records {
		rec := FromDynamoDBMap(record.Change.NewImage)
		// rec contains map[string]interface{} so it's easier to work with data!
	}
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromDynamoDBMap

func FromDynamoDBMap(record map[string]events.DynamoDBAttributeValue) map[string]interface{}

FromDynamoDBMap generates regular map out of events.DynamoDBAttributeValue map.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL