# README
godal/dynamodb
Generic AWS DynamoDB DAO implementation.
Guideline
General
- DAOs must implement
IGenericDao.GdaoCreateFilter(string, IGenericBo) FilterOpt.
- Row-mapper's
ColumnsList(table string) []string
must return all attribute names of specified table's primary key.
Use GenericDaoDynamodb
(and godal.IGenericBo
) directly
- Define a DAO struct that implements
IGenericDao.GdaoCreateFilter(string, IGenericBo) FilterOpt
. - Use a row-mapper whose
ColumnsList(table string) []string
returns all attribute names of specified table's primary key.
Implement custom DynamoDB business DAOs and BOs
- Define and implement the business DAO (Note: DAOs must implement
IGenericDao.GdaoCreateFilter(string, IGenericBo) FilterOpt
and its row-mapper'sColumnsList(table string) []string
function must return all attribute names of specified table's primary key). - Define functions to transform
godal.IGenericBo
to business BO and vice versa.
Optionally, create a helper function to create DAO instances.
Examples: see examples and examples_sta.
This package uses github.com/aws/aws-sdk-go to interact with AWS DynamoDB service.
# Functions
NewGenericDaoDynamodb constructs a new AWS DynamoDB implementation of 'godal.IGenericDao'.
# Variables
GenericRowMapperDynamodbInstance is a pre-created instance of GenericRowMapperDynamodb that is ready to use.
# Structs
GenericDaoDynamodb is AWS DynamoDB implementation of godal.IGenericDao.
GenericRowMapperDynamodb is a generic implementation of godal.IRowMapper for AWS DynamoDB.