ingester

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ingester

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

An Ingester is a mechanism to summarize and send data to server with retry policy

func NewIngester

func NewIngester(sdkInfo *core.SDKInfo, firstExposuresIngestThreshold int) *Ingester

NewIngester creates new instance of ingester

func (*Ingester) Activate added in v3.0.8

func (i *Ingester) Activate(ingestionURL string, config *core.SDKConfig)

Activate activates ingester strategy. Must be the first method called after NewIngester

func (*Ingester) Publish

func (i *Ingester) Publish(entity *core.Entity)

Publish publishes new entity

func (*Ingester) PublishExposure

func (i *Ingester) PublishExposure(exposure *core.Exposure, isNewFlag bool)

PublishExposure adds new exposure to the ingester

func (*Ingester) SendEmptyIngestion added in v3.0.10

func (i *Ingester) SendEmptyIngestion()

SendEmptyIngestion sends empty ingestion to inform a server about sdk usage

func (*Ingester) SetEntity

func (i *Ingester) SetEntity(entity *core.Entity)

SetEntity sets the default entity to the ingester

func (*Ingester) Shutdown

func (i *Ingester) Shutdown(timeout time.Duration) bool

Shutdown shutdowns the ingester return true if existed because of timeout

func (*Ingester) Track

func (i *Ingester) Track(event *core.Event)

Track adds new event to the ingester

type IngestionDataRequest

type IngestionDataRequest struct {
	ID            string           `json:"id"`
	Entities      []*core.Entity   `json:"entities"`
	Exposures     []*core.Exposure `json:"exposures"` // the output of every Flag Function call
	Events        []*core.Event    `json:"events"`    // user generated event
	SDKInfo       *core.SDKInfo    `json:"sdkInfo"`   // Dictionary holding info about the Flagger
	DetectedFlags []string         `json:"detectedFlags"`
}

An IngestionDataRequest is a data object for the ingestion request

type RetryPolicyCallback

type RetryPolicyCallback func(err error)

RetryPolicyCallback is called when retry policy finishes the processing of the ingestion data httpRequest There are 2 possible scenarios: 1) ingestion is successfully sent to the server 2) new ingestion arrive, so the current ingestion is shift from the queue(not enough memory)

Jump to

Keyboard shortcuts

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