Helper to easily access some aws-sdk-go's methods. It also contains multiple methods to cover tricky problems like preparing an sns default message and unmarshal an image coming out from a stream like:
// UnmarshalStreamImage unmarshals a dynamo stream image in a pointer to an interface
func UnmarshalStreamImage(in map[string]events.DynamoDBAttributeValue, out interface{}) error {
dbAttrMap := make(map[string]*dynamodb.AttributeValue)
for k, v := range in {
bytes, err := v.MarshalJSON()
if err != nil {
return err
}
var dbAttr dynamodb.AttributeValue
json.Unmarshal(bytes, &dbAttr)
dbAttrMap[k] = &dbAttr
}
return dynamodbattribute.UnmarshalMap(dbAttrMap, out)
}
At the moment it covers SNS, SQS, DynamoDB, Rekognition and S3.
You can simply import code from pkg
package. Almost all the methods are exported so you can access them easily.
Install dep and run dep ensure
inside the project's folder to get project's vendors.
If you want to fork it or just use it in local, edit internal/configuration/configuration.json
as you wish. The default configuration contains endpoints to run the tests on localstack. To run Rekognition
tests you need to have an AWS account and use a region where the latter is available.