datasourcev2

package
v7.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package datasourcev2 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.

WARNING: This particular implementation supports the upcoming flag delivery v2 format which is not publicly available.

This does not include the file data source, which is in the ldfiledata package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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,
	dataDestination subsystems.DataDestination,
	statusReporter subsystems.DataSourceStatusReporter,
	cfg datasource.PollingConfig,
) *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) GetFilterKey

func (pp *PollingProcessor) GetFilterKey() string

GetFilterKey returns the configured filter key, 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 PollingRequester

type PollingRequester interface {
	Request() (*PollingResponse, error)
	BaseURI() string
	FilterKey() string
}

PollingRequester allows PollingProcessor to delegate fetching data to another component. This is useful for testing the PollingProcessor without needing to set up a test HTTP server.

type PollingResponse

type PollingResponse struct {
	// contains filtered or unexported fields
}

PollingResponse represents the result of a polling request.

func NewCachedPollingResponse

func NewCachedPollingResponse() *PollingResponse

NewCachedPollingResponse indicates that the response has not changed.

func NewPollingResponse

func NewPollingResponse(intent fdv2proto.IntentCode, events []fdv2proto.Event,
	selector *fdv2proto.Selector) *PollingResponse

NewPollingResponse indicates that data was received.

func (*PollingResponse) Cached

func (p *PollingResponse) Cached() bool

Cached returns true if the response was cached, meaning data has not changed.

func (*PollingResponse) Events

func (p *PollingResponse) Events() []fdv2proto.Event

Events returns the events in the response.

func (*PollingResponse) Intent

func (p *PollingResponse) Intent() fdv2proto.IntentCode

Intent returns the server intent code of the response.

func (*PollingResponse) Selector

func (p *PollingResponse) Selector() *fdv2proto.Selector

Selector returns the Selector of the response.

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,
	dataDestination subsystems.DataDestination,
	statusReporter subsystems.DataSourceStatusReporter,
	cfg datasource.StreamConfig,
) *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) GetFilterKey

func (sp *StreamProcessor) GetFilterKey() string

GetFilterKey returns the configured key, 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{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL