eventcollector

package
v0.143.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Syncing state means that the collector has just started and need to immediately do a fetch to catchup
	Syncing state = "sync"
	// Scheduled means that we have caught up with latest events and are scheduled to run again later in Schedule time
	Scheduled state = "waiting"
	// Collecting means the collector thinks it probably has more to collect but is rate limited by MinWaitTime
	Collecting state = "collecting"
)
View Source
const (
	DefaultSchedule = time.Duration(15 * time.Minute)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Schedule        time.Duration
	MinWaitTime     time.Duration
	InitialWaitTime time.Duration
	Logger          lager.Logger
	Fetcher         eventio.EventFetcher
	Store           eventio.EventStore
}

type EventCollector

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

EventCollector periodically fetches events via the given EventFetcher and stores them to the given EventStore

func New

func New(cfg Config) *EventCollector

func (*EventCollector) Run

func (c *EventCollector) Run(ctx context.Context) error

Run executes collect periodically the rate is dictated by Schedule and MinWaitTime

Jump to

Keyboard shortcuts

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