-
Notifications
You must be signed in to change notification settings - Fork 15
/
config.go
39 lines (33 loc) · 920 Bytes
/
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
package flagsmith
import (
"time"
)
const (
// Number of seconds to wait for a request to
// complete before terminating the request.
DefaultTimeout = 10 * time.Second
// Default base URL for the API.
DefaultBaseURL = "https://edge.api.flagsmith.com/api/v1/"
bulkIdentifyMaxCount = 100
DefaultRealtimeBaseUrl = "https://realtime.flagsmith.com/"
)
// config contains all configurable Client settings.
type config struct {
baseURL string
timeout time.Duration
localEvaluation bool
envRefreshInterval time.Duration
enableAnalytics bool
offlineMode bool
realtimeBaseUrl string
useRealtime bool
}
// defaultConfig returns default configuration.
func defaultConfig() config {
return config{
baseURL: DefaultBaseURL,
timeout: DefaultTimeout,
envRefreshInterval: time.Second * 60,
realtimeBaseUrl: DefaultRealtimeBaseUrl,
}
}