plugins

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHostDown = errors.New("host is \"down\"")

ErrHostDown represents a condition where the Host is functionally "down" so menshen-agent shouldn't send a heartbeat This could be any number of conditions, including too many connected clients, resource overloading, etc.

Functions

This section is empty.

Types

type Plugin

type Plugin[H models.ModelsBridge | models.ModelsGateway] interface {
	// Transform takes a Host model and returns a transformed Host model
	// Returning an ErrHostDown error here will cause the menshen-agent to not send a heartbeat, representing a condition
	// where the host is effectively "down"
	// All other errors will be logged and sent to the errorChan, but the heartbeat will still be sent.
	Transform(H) (H, error)
}

A "plugin" is essentially a transform function. This allows the consumer of our library to specify arbitrary functionality which can transform the data sent in the heartbeat For example: a CPU monitoring plugin could `cat /proc/stat`, interpret the data there, and conditionally set the `Overloaded` property

Source Files

  • plugins.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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