Skip to content

ebh/mockdynamodb

Repository files navigation

github.com/ebh/mockdynamodb

In-memory implementation of DynamoDB, ideal for unit testing

Continuous Integration Go Reference

Credit

This module was inspired by and basically copies github.com/elliotchance/mocksqs by Elliot Chance.

Creating the Service

The simplest way to create a new DynamoDB service is with mockdynamodb.New(). However, if you need tables you can use mockdynamodb.NewWithTables():

tableName := "foobar"
client := mocksqs.NewWithTables({tableName})

result, err := client.PutItem(&dynamodb.PutItemInput{
    TableName: aws.String(tableName),
})

Supported Functionality

Only some DynamoDB methods are implemented, at moment. Methods not implemented will panic. If you want a method implemented please raise an issue.

You can view the specific implementation details in the godoc documentation.