forked from crolly/dyngeo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
50 lines (43 loc) · 1.22 KB
/
config.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
48
49
50
package dyngeo
import (
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/golang/geo/s2"
)
// MERGE_THRESHOLD ...
const MERGE_THRESHOLD = 2
type DynGeoConfig struct {
TableName string
ConsistentRead bool
HashKeyAttributeName string
RangeKeyAttributeName string
GeoHashAttributeName string
GeoJSONAttributeName string
GeoHashIndexName string
HashKeyLength int8
LongitudeFirst bool
DynamoDBClient *dynamodb.DynamoDB
s2RegionCoverer s2.RegionCoverer
}
// func NewConfig(dynamoClient *dynamodb.DynamoDB, tableName string) DynGeoConfig {
// return DynGeoConfig{
// tableName: tableName,
// consistentRead: false,
// hashKeyAttributeName: "hashKey",
// rangeKeyAttributeName: "rangeKey",
// geohashAttributeName: "geohash",
// geoJSONAttributeName: "geoJson",
// geohashIndexName: "geohash-index",
// hashKeyLength: 2,
// longitudeFirst: true,
// dynamodbClient: dynamoClient,
// s2RegionCoverer: s2.RegionCoverer{
// MinLevel: 10,
// MaxLevel: 10,
// MaxCells: 10,
// },
// }
// }
// // SetHashKeyLength ...
// func (config *DynGeoConfig) SetHashKeyLength(length int8) {
// config.hashKeyLength = length
// }