-
Notifications
You must be signed in to change notification settings - Fork 16
/
big_segments_config_extra.go
58 lines (45 loc) · 2.17 KB
/
big_segments_config_extra.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
package ldstoreimpl
import (
"time"
"github.com/launchdarkly/go-server-sdk/v7/subsystems"
)
// BigSegmentsConfigurationProperties encapsulates the SDK's configuration with regard to Big Segments.
//
// This struct implements the BigSegmentsConfiguration interface, but allows for addition of new
// properties. In a future version, BigSegmentsConfigurationBuilder and other configuration builders
// may be changed to use concrete types instead of interfaces.
type BigSegmentsConfigurationProperties struct {
// Store the data store instance that is used for Big Segments data. If nil, Big Segments are disabled.
Store subsystems.BigSegmentStore
// ContextCacheSize is the maximum number of contexts whose Big Segment state will be cached by the SDK
// at any given time.
ContextCacheSize int
// ContextCacheTime is the maximum length of time that the Big Segment state for a context will be cached
// by the SDK.
ContextCacheTime time.Duration
// StatusPollInterval is the interval at which the SDK will poll the Big Segment store to make sure
// it is available and to determine how long ago it was updated
StatusPollInterval time.Duration
// StaleAfter is the maximum length of time between updates of the Big Segments data before the data
// is considered out of date.
StaleAfter time.Duration
// StartPolling is true if the polling task should be started immediately. Otherwise, it will only
// start after calling BigSegmentsStoreWrapper.SetPollingActive(true). This property is always true
// in regular use of the SDK; the Relay Proxy may set it to false.
StartPolling bool
}
func (p BigSegmentsConfigurationProperties) GetStore() subsystems.BigSegmentStore { //nolint:revive
return p.Store
}
func (p BigSegmentsConfigurationProperties) GetContextCacheSize() int { //nolint:revive
return p.ContextCacheSize
}
func (p BigSegmentsConfigurationProperties) GetContextCacheTime() time.Duration { //nolint:revive
return p.ContextCacheTime
}
func (p BigSegmentsConfigurationProperties) GetStatusPollInterval() time.Duration { //nolint:revive
return p.StatusPollInterval
}
func (p BigSegmentsConfigurationProperties) GetStaleAfter() time.Duration { //nolint:revive
return p.StaleAfter
}