This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.go
59 lines (55 loc) · 1.55 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
51
52
53
54
55
56
57
58
59
package cql
import (
"github.com/gocql/gocql"
"time"
)
/*
Creation Time: 2019 - Oct - 16
Created by: (ehsan)
Maintainers:
1. Ehsan N. Moosa (E2)
Auditor: Ehsan N. Moosa (E2)
Copyright Ronak Software Group 2020
*/
type Config struct {
Host string
Username string
Password string
Keyspace string
Retries int
RetryMinBackOff time.Duration
RetryMaxBackOff time.Duration
ConnectTimeout time.Duration
Timeout time.Duration
ReconnectInterval time.Duration
Concurrency int
Consistency gocql.Consistency
SerialConsistency gocql.SerialConsistency
ReplicationClass string
ReplicationFactor int
CqlVersion string
DefaultIdempotence bool
QueryObserver gocql.QueryObserver
PageSize int
WriteCoalesceWaitTime time.Duration
}
var (
DefaultConfig = Config{
Concurrency: 5,
Timeout: 600 * time.Millisecond,
ConnectTimeout: 600 * time.Millisecond,
Retries: 100,
RetryMinBackOff: 100 * time.Millisecond,
RetryMaxBackOff: time.Second,
ReconnectInterval: 10 * time.Second,
Consistency: gocql.LocalQuorum,
SerialConsistency: gocql.LocalSerial,
ReplicationClass: "SimpleStrategy",
ReplicationFactor: 1,
CqlVersion: "3.4.4",
DefaultIdempotence: true,
QueryObserver: nil,
PageSize: 1000,
WriteCoalesceWaitTime: time.Millisecond,
}
)