Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunTestAndCleanup ¶
Types ¶
type Client ¶
var GlobalClient *Client
func DynamoDBClient ¶
func DynamoDBClient() Client
func NewDynamoDB ¶
func NewDynamoDB() (Client, func())
NewDynamoDB creates a Docker container with DynamoDB Local, and returns the connected DynamoDB client. Clean up function is returned as well to ensure container gets removed after test is complete.
func (Client) CreateTestingTable ¶
func (c Client) CreateTestingTable(t *testing.T, tablePrefix string, schema dynamodb.CreateTableInput, initialData ...any) string
CreateTestingTable creates a table with the given schema and initial data and returns the table name
** ** tablePrefix is the prefix of the table name, we need this just in case we want to create multiple tables ** with the same schema and different data, so we can differentiate between them, ** and also, to check what happened to the table if not purged ** ** schema is the schema of the table except the table name which is generated by the function using the tablePrefix and the billing mode is set to PayPerRequest ** ** initialData is a type alias for any type of data that can be used to populate the table *