2016-01-27 21:21:36 +00:00
|
|
|
package telegraf
|
|
|
|
|
2016-05-25 17:38:25 +00:00
|
|
|
import (
|
|
|
|
"github.com/gorilla/mux"
|
|
|
|
)
|
|
|
|
|
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 {
|
|
|
|
// 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
|
|
|
|
|
|
|
|
// Start starts the ServiceInput's service, whatever that may be
|
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()
|
|
|
|
}
|
2016-05-25 17:38:25 +00:00
|
|
|
|
|
|
|
type WebhookInput 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
|
|
|
|
|
|
|
|
// Register
|
|
|
|
Register(*mux.Router, Accumulator) error
|
|
|
|
}
|