aws-sdk-go-bindings

module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0

README

Go Report Card Apache V2 License BCH compliance

aws-sdk-go-bindings

Helper to easily access some aws-sdk-go's methods. It also contains multiple methods to cover tricky problems like preparing and 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, marshalErr := v.MarshalJSON()
		if marshalErr != nil {
			return marshalErr
		}

		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.

Utilization

You can simply import code from pkg package. Almost all the methods are exported so you can access them easily.

Development

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.

Directories

Path Synopsis
internal
configuration
Package configuration allows reading configuration parameters from a given configuration file
Package configuration allows reading configuration parameters from a given configuration file
error
Package error formats errors to contain more information
Package error formats errors to contain more information
pkg
aws
Package aws handles the initialization of a new aws session
Package aws handles the initialization of a new aws session
aws/dynamodb
Package dynamodb contains third party interactions with aws-sdk-go/dynamodb
Package dynamodb contains third party interactions with aws-sdk-go/dynamodb
aws/rekognition
Package rekognition handles interactions with aws-sdk-go/service/rekognition
Package rekognition handles interactions with aws-sdk-go/service/rekognition
aws/s3
Package s3 handles interactions with aws-sdk-go/service/s3
Package s3 handles interactions with aws-sdk-go/service/s3
aws/sns
Package sns handles interactions with aws-sdk-go/service/sns
Package sns handles interactions with aws-sdk-go/service/sns
aws/sqs
Package sqs handles interactions with aws-sdk-go/service/sqs
Package sqs handles interactions with aws-sdk-go/service/sqs

Jump to

Keyboard shortcuts

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