with handling for do

This commit is contained in:
2022-11-05 23:05:41 +01:00
parent fd826827f6
commit 52f44f7c2e
8 changed files with 77 additions and 15 deletions

View File

@@ -9,6 +9,19 @@ type PluginServer struct {
Impl Plugin
}
func (ps *PluginServer) Do(args *string, resp *string) error {
var doReq DoRequest
if err := json.Unmarshal([]byte(*args), &doReq); err != nil {
return err
}
if err := ps.Impl.Do(context.Background(), doReq.CommandName, doReq.Args); err != nil {
return err
}
return nil
}
func (ps *PluginServer) About(args any, resp *string) error {
r, err := ps.Impl.About(context.Background())
if err != nil {