diff --git a/plugins/inputs/mock_Plugin.go b/plugins/inputs/mock_Plugin.go index 4dec121bc7b6f..7270954dc5f8d 100644 --- a/plugins/inputs/mock_Plugin.go +++ b/plugins/inputs/mock_Plugin.go @@ -9,6 +9,8 @@ import ( // MockPlugin struct should be named the same as the Plugin type MockPlugin struct { mock.Mock + + constructedVariable string } // Description will appear directly above the plugin definition in the config file @@ -21,6 +23,12 @@ func (m *MockPlugin) SampleConfig() string { return ` sampleVar = 'foo'` } +// Init can be implemented to do one-time processing stuff like initializing variables +func (m *MockPlugin) Init() error { + m.constructedVariable = "I'm initialized now." + return nil +} + // Gather defines what data the plugin will gather. func (m *MockPlugin) Gather(_a0 telegraf.Accumulator) error { ret := m.Called(_a0)