Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andream16/aws-sdk-go-bindings
Helper package to easily access some aws-sdk-go's methods (SNS, SQS, DynamoDB, Rekognition, S3) & aws-lambda-go utilities.
https://github.com/andream16/aws-sdk-go-bindings
aws-dynamodb aws-lambda-golang aws-rekognition aws-s3 aws-sdk aws-sdk-go aws-sns aws-sqs go golang
Last synced: about 5 hours ago
JSON representation
Helper package to easily access some aws-sdk-go's methods (SNS, SQS, DynamoDB, Rekognition, S3) & aws-lambda-go utilities.
- Host: GitHub
- URL: https://github.com/andream16/aws-sdk-go-bindings
- Owner: andream16
- License: apache-2.0
- Created: 2018-06-15T15:40:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-25T21:41:04.000Z (over 5 years ago)
- Last Synced: 2024-06-20T03:33:07.317Z (5 months ago)
- Topics: aws-dynamodb, aws-lambda-golang, aws-rekognition, aws-s3, aws-sdk, aws-sdk-go, aws-sns, aws-sqs, go, golang
- Language: Go
- Homepage:
- Size: 335 KB
- Stars: 13
- Watchers: 3
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# aws-sdk-go-bindings [![CircleCI](https://circleci.com/gh/andream16/aws-sdk-go-bindings.svg?style=svg)](https://circleci.com/gh/andream16/aws-sdk-go-bindings) [![GoDoc](https://godoc.org/github.com/andream16/aws-sdk-go-bindings?status.svg)](https://godoc.org/github.com/andream16/aws-sdk-go-bindings) [![Go Report Card](https://goreportcard.com/badge/github.com/AndreaM16/aws-sdk-go-bindings)](https://goreportcard.com/report/github.com/AndreaM16/aws-sdk-go-bindings) [![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/andream16/aws-sdk-go-bindings/blob/master/LICENSE.txt)
Helper to easily access some [aws-sdk-go](https://github.com/aws/aws-sdk-go)'s methods and lambda utilities like preparing an sns default message and unmarshal an image coming out from a stream like:
```
// UnmarshalDynamoEvent unmarshals a events.DynamoDBEventRecord into a given target.
// Out has to be a pointer.
func UnmarshalDynamoEvent(event events.DynamoDBEventRecord, out interface{}) error {if reflect.DeepEqual(event, reflect.Zero(reflect.TypeOf(event)).Interface()) {
return errors.Wrap(bindings.ErrInvalidParameter, "event")
}
if reflect.ValueOf(out).Kind() != reflect.Ptr {
return errors.Wrap(bindings.ErrInvalidParameter, "out")
}img := event.Change.NewImage
if len(img) == 0 {
return errors.New("event's image is empty")
}m := make(map[string]*dynamodb.AttributeValue, len(img))
for k, v := range img {
b, err := v.MarshalJSON()
if err != nil {
return errors.Wrap(err, "unable to marshal current element to json")
}var attr dynamodb.AttributeValue
err = json.Unmarshal(b, &attr)
if err != nil {
return errors.Wrap(err, "unable to unmarshal current element to json")
}m[k] = &attr
}
return dynamodbattribute.UnmarshalMap(m, out)
}
```## Contributors
Special thanks to:
- [martingallagher](https://github.com/martingallagher/)
- [ferruvich](https://github.com/ferruvich/)