mirror of
https://github.com/wahyd4/telegraf.git
synced 2026-08-16 16:16:37 +10:00
This will basically make the root directory a place for storing the major telegraf interfaces, which will make telegraf's godoc looks quite a bit nicer. And make it easier for contributors to lookup the few data types that they actually care about. closes #564
32 lines
881 B
Go
32 lines
881 B
Go
package telegraf
|
|
|
|
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
|
|
Start() error
|
|
|
|
// Stop stops the services and closes any necessary channels and connections
|
|
Stop()
|
|
}
|