collector

package
v0.0.0-...-065eb90 Latest Latest
Warning

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

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

Documentation

Overview

Package collector defines the collector component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoneModule

func NoneModule() fxutil.Module

NoneModule return a None optional type for Component.

This helper allows code that needs a disabled Optional type for the collector to get it. The helper is split from the implementation to avoid linking with the implementation.

Types

type Component

type Component interface {
	// RunCheck sends a Check in the execution queue
	RunCheck(inner check.Check) (checkid.ID, error)
	// StopCheck halts a check and remove the instance
	StopCheck(id checkid.ID) error
	// MapOverChecks call the callback with the list of checks locked.
	MapOverChecks(cb func([]check.Info))
	// GetChecks copies checks
	GetChecks() []check.Check
	// GetAllInstanceIDs returns the ID's of all instances of a check
	GetAllInstanceIDs(checkName string) []checkid.ID
	// ReloadAllCheckInstances completely restarts a check with a new configuration and returns a list of killed check IDs
	ReloadAllCheckInstances(name string, newInstances []check.Check) ([]checkid.ID, error)
	// AddEventReceiver adds a callback to the collector to be called each time a check is added or removed.
	AddEventReceiver(cb EventReceiver)
}

Component is the component type.

type EventReceiver

type EventReceiver func(checkid.ID, EventType)

EventReceiver represents a function to receive notification from the collector when running or stopping checks.

type EventType

type EventType uint32

EventType represents the type of events emitted by the collector

const (
	// CheckRun is emitted when a check is added to the collector
	CheckRun EventType = iota
	// CheckStop is emitted when a check is stopped and removed from the collector
	CheckStop
)

Directories

Path Synopsis
Package collectorimpl provides the implementation of the collector component.
Package collectorimpl provides the implementation of the collector component.

Jump to

Keyboard shortcuts

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