ingester

package
v0.0.0-...-da1c305 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 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 GroupStrategy

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

func NewGroupStrategy

func NewGroupStrategy(sdkInfo *core.SDKInfo, httpRequest HttpRequest) *GroupStrategy

func (*GroupStrategy) Publish

func (gs *GroupStrategy) Publish(data *IngestionDataRequest)

func (*GroupStrategy) SetConfig

func (gs *GroupStrategy) SetConfig(sdkConfig *core.SDKConfig)

func (*GroupStrategy) SetURL

func (gs *GroupStrategy) SetURL(ingestionURL string)

func (*GroupStrategy) ShutdownWithTimeout

func (gs *GroupStrategy) ShutdownWithTimeout(timeout time.Duration) bool

Important notes, this function - waits for group strategy to be initialized(URL and sdkConfig are set) - waits for current ingestion to finish - waits for the ingestionDataChannel to read all the data - adds all the data in the accumulator, ingest it and waits for the httpRequest to finish returns false if shutdown terminates before the timeout

type HttpRequest

type HttpRequest func(data []byte, ingestionURL string) error

type Ingester

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

func NewIngester

func NewIngester(sdkInfo *core.SDKInfo) *Ingester

NewIngester

func (*Ingester) Publish

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

Publish

func (*Ingester) PublishExposure

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

PublishExposure

func (*Ingester) SetConfig

func (i *Ingester) SetConfig(v *core.SDKConfig)

SetConfig

func (*Ingester) SetEntity

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

SetEntity

func (*Ingester) SetURL

func (i *Ingester) SetURL(ingestionURL string)

SetURL

func (*Ingester) Shutdown

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

Shutdown

func (*Ingester) Track

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

Track

type IngestionDataRequest

type IngestionDataRequest struct {
	Id            string           `json:"id"`
	Entities      []*core.Entity   `json:"entities"`
	Exposures     []*core.Exposure `json:"exposures"` // the output of every single API call
	Events        []*core.Event    `json:"events"`    // user generated event
	SDKInfo       *core.SDKInfo    `json:"sdkInfo"`   // Dictionary holding info about the Flagger version that's sending data back
	DetectedFlags []string         `json:"detectedFlags"`
}

type QueueElement

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

type RetryPolicy

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

func NewRetryPolicy

func NewRetryPolicy() *RetryPolicy

func (*RetryPolicy) SetMaxSize

func (rt *RetryPolicy) SetMaxSize(maxMemorySizeInBytes int64)

not thread safe

type RetryPolicyCallback

type RetryPolicyCallback func(err error)

This callback 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)

type RetryPolicyRequest

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

Jump to

Keyboard shortcuts

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