collector

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ClientTypePoll = ClientType(1)
View Source
const ClientTypeStream = ClientType(2)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Poll(timestamp time.Time, resultsChannel chan<- string, pollOffset int) (count int, currentTimestamp time.Time, err error)
	Stream(streamChannel chan<- string) (cancelFunc func(), err error)
	ClientType() ClientType
	Exit() error
}

type ClientType

type ClientType int

type Collector

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

func New

func New(client Client, logger *outputs.TmpWriter, statePath string) (*Collector, error)

func (*Collector) Exit

func (i *Collector) Exit()

func (*Collector) Poll

func (i *Collector) Poll(pollSeconds int, pollOffset int, resultsChannel chan<- string, ctx context.Context)

func (*Collector) Start

func (i *Collector) Start(scheduleTime int, pollOffset int, resultsChannel chan<- string, ctx context.Context)

func (*Collector) Stream

func (i *Collector) Stream(scheduleTime int, resultsChannel chan<- string, ctx context.Context)

type State

type State struct {
	Path string
	Data data
}

func (*State) Load

func (p *State) Load() error

Restore state

func (*State) Save

func (p *State) Save()

Save state

Jump to

Keyboard shortcuts

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