Documentation ¶
Overview ¶
Package datasource is an internal package containing implementation types for the SDK's data source implementations (streaming, polling, etc.) and related functionality. These types are not visible from outside of the SDK.
This does not include the file data source, which is in the ldfiledata package.
Index ¶
- func NewDataSourceStatusProviderImpl(broadcaster *internal.DataSourceStatusBroadcaster, ...) interfaces.DataSourceStatusProvider
- func NewNullDataSource() subsystems.DataSource
- type DataSourceUpdatesImpl
- func (d *DataSourceUpdatesImpl) GetDataStoreStatusProvider() intf.DataStoreStatusProvider
- func (d *DataSourceUpdatesImpl) GetLastStatus() intf.DataSourceStatus
- func (d *DataSourceUpdatesImpl) Init(allData []st.Collection) bool
- func (d *DataSourceUpdatesImpl) UpdateStatus(newState intf.DataSourceState, newError intf.DataSourceErrorInfo)
- func (d *DataSourceUpdatesImpl) Upsert(kind st.DataKind, key string, item st.ItemDescriptor) bool
- type PollingProcessor
- type StreamProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDataSourceStatusProviderImpl ¶
func NewDataSourceStatusProviderImpl( broadcaster *internal.DataSourceStatusBroadcaster, dataSourceUpdates *DataSourceUpdatesImpl, ) interfaces.DataSourceStatusProvider
NewDataSourceStatusProviderImpl creates the internal implementation of DataSourceStatusProvider.
func NewNullDataSource ¶
func NewNullDataSource() subsystems.DataSource
NewNullDataSource returns a stub implementation of DataSource.
Types ¶
type DataSourceUpdatesImpl ¶
type DataSourceUpdatesImpl struct {
// contains filtered or unexported fields
}
DataSourceUpdatesImpl is the internal implementation of DataSourceUpdates. It is exported because the actual implementation type, rather than the interface, is required as a dependency of other SDK components.
func NewDataSourceUpdatesImpl ¶
func NewDataSourceUpdatesImpl( store subsystems.DataStore, dataStoreStatusProvider intf.DataStoreStatusProvider, dataSourceStatusBroadcaster *internal.DataSourceStatusBroadcaster, flagChangeEventBroadcaster *internal.FlagChangeEventBroadcaster, logDataSourceOutageAsErrorAfter time.Duration, loggers ldlog.Loggers, ) *DataSourceUpdatesImpl
NewDataSourceUpdatesImpl creates the internal implementation of DataSourceUpdates.
func (*DataSourceUpdatesImpl) GetDataStoreStatusProvider ¶
func (d *DataSourceUpdatesImpl) GetDataStoreStatusProvider() intf.DataStoreStatusProvider
func (*DataSourceUpdatesImpl) GetLastStatus ¶
func (d *DataSourceUpdatesImpl) GetLastStatus() intf.DataSourceStatus
GetLastStatus is used internally by SDK components.
func (*DataSourceUpdatesImpl) Init ¶
func (d *DataSourceUpdatesImpl) Init(allData []st.Collection) bool
func (*DataSourceUpdatesImpl) UpdateStatus ¶
func (d *DataSourceUpdatesImpl) UpdateStatus( newState intf.DataSourceState, newError intf.DataSourceErrorInfo, )
func (*DataSourceUpdatesImpl) Upsert ¶
func (d *DataSourceUpdatesImpl) Upsert( kind st.DataKind, key string, item st.ItemDescriptor, ) bool
type PollingProcessor ¶
type PollingProcessor struct {
// contains filtered or unexported fields
}
PollingProcessor is the internal implementation of the polling data source.
This type is exported from internal so that the PollingDataSourceBuilder tests can verify its configuration. All other code outside of this package should interact with it only via the DataSource interface.
func NewPollingProcessor ¶
func NewPollingProcessor( context subsystems.ClientContext, dataSourceUpdates subsystems.DataSourceUpdates, baseURI string, pollInterval time.Duration, ) *PollingProcessor
NewPollingProcessor creates the internal implementation of the polling data source.
func (*PollingProcessor) Close ¶
func (pp *PollingProcessor) Close() error
func (*PollingProcessor) GetBaseURI ¶
func (pp *PollingProcessor) GetBaseURI() string
GetBaseURI returns the configured polling base URI, for testing.
func (*PollingProcessor) GetPollInterval ¶
func (pp *PollingProcessor) GetPollInterval() time.Duration
GetPollInterval returns the configured polling interval, for testing.
func (*PollingProcessor) IsInitialized ¶
func (pp *PollingProcessor) IsInitialized() bool
func (*PollingProcessor) Start ¶
func (pp *PollingProcessor) Start(closeWhenReady chan<- struct{})
type StreamProcessor ¶
type StreamProcessor struct {
// contains filtered or unexported fields
}
StreamProcessor is the internal implementation of the streaming data source.
This type is exported from internal so that the StreamingDataSourceBuilder tests can verify its configuration. All other code outside of this package should interact with it only via the DataSource interface.
func NewStreamProcessor ¶
func NewStreamProcessor( context subsystems.ClientContext, dataSourceUpdates subsystems.DataSourceUpdates, streamURI string, initialReconnectDelay time.Duration, ) *StreamProcessor
NewStreamProcessor creates the internal implementation of the streaming data source.
func (*StreamProcessor) Close ¶
func (sp *StreamProcessor) Close() error
func (*StreamProcessor) GetBaseURI ¶
func (sp *StreamProcessor) GetBaseURI() string
GetBaseURI returns the configured streaming base URI, for testing.
func (*StreamProcessor) GetInitialReconnectDelay ¶
func (sp *StreamProcessor) GetInitialReconnectDelay() time.Duration
GetInitialReconnectDelay returns the configured reconnect delay, for testing.
func (*StreamProcessor) IsInitialized ¶
func (sp *StreamProcessor) IsInitialized() bool
func (*StreamProcessor) Start ¶
func (sp *StreamProcessor) Start(closeWhenReady chan<- struct{})