[MM-14576] Add GetBundlePath method to Plugin API (#10466)
* Fix typo * Add GetBundlePath method to Plugin API * Change signature to GetBundlePath() (string, error) * Add test
Этот коммит содержится в:
коммит произвёл
Jesse Hallam
родитель
16a9489bbb
Коммит
030ba52b08
@@ -671,6 +671,34 @@ func (s *apiRPCServer) SavePluginConfig(args *Z_SavePluginConfigArgs, returns *Z
|
||||
return nil
|
||||
}
|
||||
|
||||
type Z_GetBundlePathArgs struct {
|
||||
}
|
||||
|
||||
type Z_GetBundlePathReturns struct {
|
||||
A string
|
||||
B error
|
||||
}
|
||||
|
||||
func (g *apiRPCClient) GetBundlePath() (string, error) {
|
||||
_args := &Z_GetBundlePathArgs{}
|
||||
_returns := &Z_GetBundlePathReturns{}
|
||||
if err := g.client.Call("Plugin.GetBundlePath", _args, _returns); err != nil {
|
||||
log.Printf("RPC call to GetBundlePath API failed: %s", err.Error())
|
||||
}
|
||||
return _returns.A, _returns.B
|
||||
}
|
||||
|
||||
func (s *apiRPCServer) GetBundlePath(args *Z_GetBundlePathArgs, returns *Z_GetBundlePathReturns) error {
|
||||
if hook, ok := s.impl.(interface {
|
||||
GetBundlePath() (string, error)
|
||||
}); ok {
|
||||
returns.A, returns.B = hook.GetBundlePath()
|
||||
} else {
|
||||
return encodableError(fmt.Errorf("API GetBundlePath called but not implemented."))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Z_GetLicenseArgs struct {
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user