v0.25.2 Latest Latest

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 6 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type DataExporterScheduler

type DataExporterScheduler struct {
	// contains filtered or unexported fields

DataExporterScheduler is the struct that handle the data collection.

func NewDataExporterScheduler

func NewDataExporterScheduler(ctx context.Context, flushInterval time.Duration, maxEventInMemory int64,
	exporter Exporter, logger *log.Logger,
) *DataExporterScheduler

NewDataExporterScheduler allows to create a new instance of DataExporterScheduler ready to be used to export data.

func (*DataExporterScheduler) AddEvent

func (dc *DataExporterScheduler) AddEvent(event ffexporter.FeatureEvent)

AddEvent allow to add an event to the local cache and to call the exporter if we reach the maximum number of events that can be present in the cache.

func (*DataExporterScheduler) Close

func (dc *DataExporterScheduler) Close()

Close will stop the daemon and send the data still in the cache

func (*DataExporterScheduler) StartDaemon

func (dc *DataExporterScheduler) StartDaemon()

StartDaemon will start a goroutine to check every X seconds if we should send the data. The daemon is started only if we have a bulk exporter.

type Exporter

type Exporter interface {
	// Export will send the data to the exporter.
	Export(context.Context, *log.Logger, []ffexporter.FeatureEvent) error

	// IsBulk return false if we should directly send the data as soon as it is produce
	// and true if we collect the data to send them in bulk.
	IsBulk() bool

Exporter is an interface to describe how a exporter looks like.

Jump to

Keyboard shortcuts

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