Emmanuel BENOîT
1a29325c34
A "program" was in fact a plugin, while a "plugin" represented the plugin's results.
20 lines
685 B
Go
20 lines
685 B
Go
package plugin // import nocternity.net/gomonop/pkg/plugin
|
|
|
|
import "nocternity.net/gomonop/pkg/results"
|
|
|
|
// Plugin represents the interface to a monitoring plugin.
|
|
type Plugin interface {
|
|
// Results accesses the results of the monitoring plugin.
|
|
Results() *results.Results
|
|
|
|
// CheckArguments ensures that the arguments that were passed to the plugin
|
|
// actually make sense. Errors should be stored in the plugin's results.
|
|
CheckArguments() bool
|
|
|
|
// RunCheck actually runs whatever checks are implemented by the plugin and
|
|
// updates the results accordingly.
|
|
RunCheck()
|
|
}
|
|
|
|
// Builder is a function that can be called in order to instantiate a plugin.
|
|
type Builder func() Plugin
|