Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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
Click to show internal directories.
Click to hide internal directories.