2016-01-27 21:21:36 +00:00
|
|
|
package telegraf
|
|
|
|
|
2019-06-14 22:12:27 +00:00
|
|
|
// Initializer is an interface that all plugin types: Inputs, Outputs,
|
|
|
|
// Processors, and Aggregators can optionally implement to initialize the
|
|
|
|
// plugin.
|
|
|
|
type Initializer interface {
|
|
|
|
// Init performs one time setup of the plugin and returns an error if the
|
|
|
|
// configuration is invalid.
|
|
|
|
Init() error
|
|
|
|
}
|
|
|
|
|
2016-01-27 21:21:36 +00:00
|
|
|
type Input interface {
|
|
|
|
// SampleConfig returns the default configuration of the Input
|
|
|
|
SampleConfig() string
|
|
|
|
|
|
|
|
// Description returns a one-sentence description on the Input
|
|
|
|
Description() string
|
|
|
|
|
|
|
|
// Gather takes in an accumulator and adds the metrics that the Input
|
|
|
|
// gathers. This is called every "interval"
|
|
|
|
Gather(Accumulator) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceInput interface {
|
2018-11-05 21:34:28 +00:00
|
|
|
Input
|
2016-01-27 21:21:36 +00:00
|
|
|
|
2018-11-05 21:34:28 +00:00
|
|
|
// Start the ServiceInput. The Accumulator may be retained and used until
|
|
|
|
// Stop returns.
|
2016-02-16 00:21:38 +00:00
|
|
|
Start(Accumulator) error
|
2016-01-27 21:21:36 +00:00
|
|
|
|
|
|
|
// Stop stops the services and closes any necessary channels and connections
|
|
|
|
Stop()
|
|
|
|
}
|