add basic plugin architecture

This commit is contained in:
2022-11-01 21:15:32 +01:00
parent e0e0290dcf
commit d484d44981
15 changed files with 150 additions and 28 deletions

View File

@@ -1,10 +1,25 @@
package register
import (
"context"
"encoding/json"
)
type PluginServer struct {
Impl Plugin
}
func (ps *PluginServer) About(args any, resp *string) error {
*resp = ps.Impl.About()
r, err := ps.Impl.About(context.Background())
if err != nil {
return err
}
respB, err := json.Marshal(r)
if err != nil {
return err
}
*resp = string(respB)
return nil
}