Пример #1
0
// New creates an instance of the DynamoDB struct for us.
func New(access string, secret string, region string, tableName string) (DynamoDB, error) {
	creds := credentials.NewStaticCredentials(access, secret, "")

	cfg := aws.Config{
		Region: aws.String(region),
	}

	cfg.WithCredentials(creds)

	ddb := DynamoDB{
		Table: tableName,
		Conn:  dynamodb.New(session.New(), &cfg),
	}

	return ddb, nil
}