poller

package
v3.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache contains raw split data as well as the data in serialized format

type Fetcher

type Fetcher interface {
	Start()
	Stop()
	GetSerializedData(splitNames []string) string
}

Fetcher is an interface contains GetSerializedData, Start and Stop functions

type Poller

type Poller struct {
	Error chan error
	// contains filtered or unexported fields
}

Poller implements Fetcher and contains cache pointer, splitio, and required info to interact with aplitio api

func NewPoller

func NewPoller(splitioAPIKey string, pollingRateSeconds int, serializeSegments bool, splitio api.Splitio) *Poller

NewPoller returns a new Poller

func (*Poller) GetSerializedData

func (poller *Poller) GetSerializedData(splitNames []string) string

GetSerializedData returns serialized data cache results

func (*Poller) Start

func (poller *Poller) Start()

Start creates a goroutine and keep tracking until it stops

func (*Poller) Stop

func (poller *Poller) Stop()

Stop sets quit to true in order to stop the loop

type SplitCachePreload

type SplitCachePreload struct {
	Since              int64
	UsingSegmentsCount int
	SplitsData         string
	SegmentsData       string
}

SplitCachePreload contains the same information as SplitData but in string format

type SplitData

type SplitData struct {
	Splits             map[string]dtos.SplitDTO
	Since              int64
	Segments           map[string]dtos.SegmentChangesDTO
	UsingSegmentsCount int
}

SplitData contains Splits and Segments which is supposed to be updated periodically

Jump to

Keyboard shortcuts

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