-
Notifications
You must be signed in to change notification settings - Fork 342
/
database.go
47 lines (39 loc) · 1.39 KB
/
database.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package params
import (
"time"
)
type KV struct {
Type string
Postgres *Postgres
DynamoDB *DynamoDB
}
type Postgres struct {
ConnectionString string
MaxOpenConnections int32
MaxIdleConnections int32
ConnectionMaxLifetime time.Duration
ScanPageSize int32
}
type DynamoDB struct {
// The name of the DynamoDB table to be used as KV
TableName string
// Table provisioned throughput parameters, as described in
// https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html
ReadCapacityUnits int64
WriteCapacityUnits int64
// Maximal number of items per page during scan operation
ScanLimit int64
// The endpoint URL of the DynamoDB endpoint
// Can be used to redirect to DynmoDB on AWS, local docker etc.
Endpoint string
// AWS connection details - region and credentials
// This will override any such details that are already exist in the system
// While in general, AWS region and credentials are configured in the system for AWS usage,
// these can be used to specify fake values, that cna be used to connect to local DynamoDB,
// in case there are no credentials configured in the system
// This is a client requirement as described in section 4 in
// https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html
AwsRegion string
AwsAccessKeyID string
AwsSecretAccessKey string
}