char/pkg/register/plugin_client.go

23 lines
297 B
Go
Raw Normal View History

2022-11-01 14:26:54 +01:00
package register
import (
"log"
"net/rpc"
)
type PluginClient struct {
client *rpc.Client
}
var _ Plugin = &PluginClient{}
func (pc *PluginClient) About() string {
var resp string
err := pc.client.Call("Plugin.About", new(any), &resp)
if err != nil {
log.Fatal(err)
}
return resp
}