worker

package
v0.0.0-...-8b85951 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckLogger

type CheckLogger struct {
	Check check.Check
	// contains filtered or unexported fields
}

CheckLogger is the object responsible for logging the information generated during the running of the check

func (*CheckLogger) CheckFinished

func (cl *CheckLogger) CheckFinished()

CheckFinished is used to log that the check has completed

func (*CheckLogger) CheckStarted

func (cl *CheckLogger) CheckStarted()

CheckStarted is used to log that the check is about to run

func (*CheckLogger) Debug

func (cl *CheckLogger) Debug(message string)

Debug is used to log a message for a check that may be useful in debugging

func (*CheckLogger) Error

func (cl *CheckLogger) Error(checkErr error)

Error is used to log an error that occurred during the invocation of the check

type Worker

type Worker struct {
	ID   int
	Name string
	// contains filtered or unexported fields
}

Worker is an object that encapsulates the logic to manage a loop of processing checks over the provided `PendingCheckChan`

func NewWorker

func NewWorker(
	senderManager sender.SenderManager,
	haAgent haagent.Component,
	runnerID int,
	ID int,
	pendingChecksChan chan check.Check,
	checksTracker *tracker.RunningChecksTracker,
	shouldAddCheckStatsFunc func(id checkid.ID) bool,
) (*Worker, error)

NewWorker returns an instance of a `Worker` after parameter sanity checks are passed

func (*Worker) Run

func (w *Worker) Run()

Run waits for checks and run them as long as they arrive on the channel

Jump to

Keyboard shortcuts

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