telegraf/plugins/inputs/mock_Plugin.go

32 lines
706 B
Go
Raw Permalink Normal View History

2016-01-07 20:39:43 +00:00
package inputs
import (
"github.com/influxdata/telegraf"
"github.com/stretchr/testify/mock"
)
2016-08-08 22:06:03 +00:00
// MockPlugin struct should be named the same as the Plugin
type MockPlugin struct {
mock.Mock
}
2016-08-08 22:06:03 +00:00
// Description will appear directly above the plugin definition in the config file
func (m *MockPlugin) Description() string {
return `This is an example plugin`
}
// SampleConfig will populate the sample configuration portion of the plugin's configuration
func (m *MockPlugin) SampleConfig() string {
return ` sampleVar = 'foo'`
}
// Gather defines what data the plugin will gather.
func (m *MockPlugin) Gather(_a0 telegraf.Accumulator) error {
ret := m.Called(_a0)
r0 := ret.Error(0)
return r0
}