From 1074a1c7ab0769b0da3525282fcabf961e2ddfce Mon Sep 17 00:00:00 2001 From: Jason Mojica Date: Thu, 25 Oct 2018 17:24:43 +0000 Subject: GH-9612 Add plugin API for GetChannelStats method (#9627) * Add GetChannelStats plugin api * Fix to return channel stats correctly * Add server version; Handle error idiomatically --- plugin/plugintest/api.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'plugin/plugintest') diff --git a/plugin/plugintest/api.go b/plugin/plugintest/api.go index 81462e58d..d24b955ae 100644 --- a/plugin/plugintest/api.go +++ b/plugin/plugintest/api.go @@ -483,6 +483,31 @@ func (_m *API) GetChannelsForTeamForUser(teamId string, userId string, includeDe return r0, r1 } +// GetChannelStats provides a mock function with given fields: channelId +func (_m *API) GetChannelStats(channelId string) (*model.ChannelStats, *model.AppError) { + ret := _m.Called(channelId) + + var r0 *model.ChannelStats + if rf, ok := ret.Get(0).(func(string) *model.ChannelStats); ok { + r0 = rf(channelId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.ChannelStats) + } + } + + var r1 *model.AppError + if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { + r1 = rf(channelId) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.AppError) + } + } + + return r0, r1 +} + // GetConfig provides a mock function with given fields: func (_m *API) GetConfig() *model.Config { ret := _m.Called() -- cgit v1.2.3-1-g7c22