コード例 #1
0
ファイル: dynamodb.go プロジェクト: kyani-inc/storage
// 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
}