2019-08-21 23:49:07 +00:00
|
|
|
package telegraf
|
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|
|
|
|
|
2020-06-05 14:43:43 +00:00
|
|
|
// PluginDescriber contains the functions all plugins must implement to describe
|
|
|
|
// themselves to Telegraf
|
|
|
|
type PluginDescriber interface {
|
|
|
|
// SampleConfig returns the default configuration of the Processor
|
|
|
|
SampleConfig() string
|
|
|
|
|
|
|
|
// Description returns a one-sentence description on the Processor
|
|
|
|
Description() string
|
|
|
|
}
|
|
|
|
|
2019-08-21 23:49:07 +00:00
|
|
|
// Logger defines an interface for logging.
|
|
|
|
type Logger interface {
|
|
|
|
// Errorf logs an error message, patterned after log.Printf.
|
|
|
|
Errorf(format string, args ...interface{})
|
|
|
|
// Error logs an error message, patterned after log.Print.
|
|
|
|
Error(args ...interface{})
|
|
|
|
// Debugf logs a debug message, patterned after log.Printf.
|
|
|
|
Debugf(format string, args ...interface{})
|
|
|
|
// Debug logs a debug message, patterned after log.Print.
|
|
|
|
Debug(args ...interface{})
|
|
|
|
// Warnf logs a warning message, patterned after log.Printf.
|
|
|
|
Warnf(format string, args ...interface{})
|
|
|
|
// Warn logs a warning message, patterned after log.Print.
|
|
|
|
Warn(args ...interface{})
|
|
|
|
// Infof logs an information message, patterned after log.Printf.
|
|
|
|
Infof(format string, args ...interface{})
|
|
|
|
// Info logs an information message, patterned after log.Print.
|
|
|
|
Info(args ...interface{})
|
|
|
|
}
|