...

Source file src/github.com/launchdarkly/go-server-sdk/v6/subsystems/ldstoreimpl/big_segments_config_extra.go

Documentation: github.com/launchdarkly/go-server-sdk/v6/subsystems/ldstoreimpl

     1  package ldstoreimpl
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/launchdarkly/go-server-sdk/v6/subsystems"
     7  )
     8  
     9  // BigSegmentsConfigurationProperties encapsulates the SDK's configuration with regard to Big Segments.
    10  //
    11  // This struct implements the BigSegmentsConfiguration interface, but allows for addition of new
    12  // properties. In a future version, BigSegmentsConfigurationBuilder and other configuration builders
    13  // may be changed to use concrete types instead of interfaces.
    14  type BigSegmentsConfigurationProperties struct {
    15  	// Store the data store instance that is used for Big Segments data. If nil, Big Segments are disabled.
    16  	Store subsystems.BigSegmentStore
    17  
    18  	// ContextCacheSize is the maximum number of contexts whose Big Segment state will be cached by the SDK
    19  	// at any given time.
    20  	ContextCacheSize int
    21  
    22  	// ContextCacheTime is the maximum length of time that the Big Segment state for a context will be cached
    23  	// by the SDK.
    24  	ContextCacheTime time.Duration
    25  
    26  	// StatusPollInterval is the interval at which the SDK will poll the Big Segment store to make sure
    27  	// it is available and to determine how long ago it was updated
    28  	StatusPollInterval time.Duration
    29  
    30  	// StaleAfter is the maximum length of time between updates of the Big Segments data before the data
    31  	// is considered out of date.
    32  	StaleAfter time.Duration
    33  
    34  	// StartPolling is true if the polling task should be started immediately. Otherwise, it will only
    35  	// start after calling BigSegmentsStoreWrapper.SetPollingActive(true). This property is always true
    36  	// in regular use of the SDK; the Relay Proxy may set it to false.
    37  	StartPolling bool
    38  }
    39  
    40  func (p BigSegmentsConfigurationProperties) GetStore() subsystems.BigSegmentStore { //nolint:revive
    41  	return p.Store
    42  }
    43  
    44  func (p BigSegmentsConfigurationProperties) GetContextCacheSize() int { //nolint:revive
    45  	return p.ContextCacheSize
    46  }
    47  
    48  func (p BigSegmentsConfigurationProperties) GetContextCacheTime() time.Duration { //nolint:revive
    49  	return p.ContextCacheTime
    50  }
    51  
    52  func (p BigSegmentsConfigurationProperties) GetStatusPollInterval() time.Duration { //nolint:revive
    53  	return p.StatusPollInterval
    54  }
    55  
    56  func (p BigSegmentsConfigurationProperties) GetStaleAfter() time.Duration { //nolint:revive
    57  	return p.StaleAfter
    58  }
    59  

View as plain text