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/client_rpc_generated.go | |
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/client_rpc_generated.go')
-rw-r--r-- | plugin/client_rpc_generated.go | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/plugin/client_rpc_generated.go b/plugin/client_rpc_generated.go index 9106f2fad..3fc03ec3f 100644 --- a/plugin/client_rpc_generated.go +++ b/plugin/client_rpc_generated.go @@ -1850,6 +1850,64 @@ func (s *apiRPCServer) CopyFileInfos(args *Z_CopyFileInfosArgs, returns *Z_CopyF return nil } +type Z_GetFileInfoArgs struct { + A string +} + +type Z_GetFileInfoReturns struct { + A *model.FileInfo + B *model.AppError +} + +func (g *apiRPCClient) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) { + _args := &Z_GetFileInfoArgs{fileId} + _returns := &Z_GetFileInfoReturns{} + if err := g.client.Call("Plugin.GetFileInfo", _args, _returns); err != nil { + log.Printf("RPC call to GetFileInfo API failed: %s", err.Error()) + } + return _returns.A, _returns.B +} + +func (s *apiRPCServer) GetFileInfo(args *Z_GetFileInfoArgs, returns *Z_GetFileInfoReturns) error { + if hook, ok := s.impl.(interface { + GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) + }); ok { + returns.A, returns.B = hook.GetFileInfo(args.A) + } else { + return fmt.Errorf("API GetFileInfo called but not implemented.") + } + return nil +} + +type Z_ReadFileArgs struct { + A string +} + +type Z_ReadFileReturns struct { + A []byte + B *model.AppError +} + +func (g *apiRPCClient) ReadFile(path string) ([]byte, *model.AppError) { + _args := &Z_ReadFileArgs{path} + _returns := &Z_ReadFileReturns{} + if err := g.client.Call("Plugin.ReadFile", _args, _returns); err != nil { + log.Printf("RPC call to ReadFile API failed: %s", err.Error()) + } + return _returns.A, _returns.B +} + +func (s *apiRPCServer) ReadFile(args *Z_ReadFileArgs, returns *Z_ReadFileReturns) error { + if hook, ok := s.impl.(interface { + ReadFile(path string) ([]byte, *model.AppError) + }); ok { + returns.A, returns.B = hook.ReadFile(args.A) + } else { + return fmt.Errorf("API ReadFile called but not implemented.") + } + return nil +} + type Z_KVSetArgs struct { A string B []byte |