diff options
author | Elias Nahum <nahumhbl@gmail.com> | 2018-08-20 13:18:25 -0300 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-08-20 09:18:25 -0700 |
commit | 0aa0adb9113455da719877f2a3553df1e0ee0a97 (patch) | |
tree | fadf9e2917c903eaaacb4a4b6b5d227109bad8dd /plugin/plugintest | |
parent | c2f2fda8a19b22453c99d832cca6eaad48a1b964 (diff) | |
download | chat-0aa0adb9113455da719877f2a3553df1e0ee0a97.tar.gz chat-0aa0adb9113455da719877f2a3553df1e0ee0a97.tar.bz2 chat-0aa0adb9113455da719877f2a3553df1e0ee0a97.zip |
Add FileInfo and get file []byte in plugin api (#9269)
* Add FileInfo and get file []byte in plugin api
* Regenerated plugin mocks
* Rename ReadFileAtPath to ReadFile
Diffstat (limited to 'plugin/plugintest')
-rw-r--r-- | plugin/plugintest/api.go | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/plugin/plugintest/api.go b/plugin/plugintest/api.go index cf9ffa6a8..3c2716778 100644 --- a/plugin/plugintest/api.go +++ b/plugin/plugintest/api.go @@ -449,6 +449,31 @@ func (_m *API) GetDirectChannel(userId1 string, userId2 string) (*model.Channel, return r0, r1 } +// GetFileInfo provides a mock function with given fields: fileId +func (_m *API) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) { + ret := _m.Called(fileId) + + var r0 *model.FileInfo + if rf, ok := ret.Get(0).(func(string) *model.FileInfo); ok { + r0 = rf(fileId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.FileInfo) + } + } + + var r1 *model.AppError + if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { + r1 = rf(fileId) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.AppError) + } + } + + return r0, r1 +} + // GetGroupChannel provides a mock function with given fields: userIds func (_m *API) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError) { ret := _m.Called(userIds) @@ -907,6 +932,31 @@ func (_m *API) PublishWebSocketEvent(event string, payload map[string]interface{ _m.Called(event, payload, broadcast) } +// ReadFile provides a mock function with given fields: path +func (_m *API) ReadFile(path string) ([]byte, *model.AppError) { + ret := _m.Called(path) + + var r0 []byte + if rf, ok := ret.Get(0).(func(string) []byte); ok { + r0 = rf(path) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + var r1 *model.AppError + if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { + r1 = rf(path) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.AppError) + } + } + + return r0, r1 +} + // RegisterCommand provides a mock function with given fields: command func (_m *API) RegisterCommand(command *model.Command) error { ret := _m.Called(command) |