collector

package
v2.6.20 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 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 Collector

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

Collector is responsible for fetching storage/retrieval records from external Powergate instances, and merging them in a unified database.

func New

func New(store *store.Store, opts ...Option) (*Collector, error)

New returns a new Collector.

func (*Collector) Close

func (c *Collector) Close() error

Close closes the Collector.

func (*Collector) Subscribe

func (c *Collector) Subscribe() <-chan struct{}

Subscribe returns a notification channel that will get pushed signales whenever a new batch of records was imported. This is useful for interested parties knowing about new record's data might be available.

type Option

type Option func(*config)

Option parametrizes a collector configuration.

func WithFetchLimit

func WithFetchLimit(limit int) Option

WithFetchLimit indicates the maximum record batch size to be fetched from targets.

func WithFetchTimeout

func WithFetchTimeout(timeout time.Duration) Option

WithFetchTimeout indicates the maximum amount of time that fetching from a target can take.

func WithFrequency

func WithFrequency(freq time.Duration) Option

WithFrequency indicates the frequency for the collector daemon.

func WithRunOnStart

func WithRunOnStart(enabled bool) Option

WithRunOnStart indicates if a collection should be fired on start.

Jump to

Keyboard shortcuts

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