added basic plugin structure
This commit is contained in:
22
pkg/register/plugin_client.go
Normal file
22
pkg/register/plugin_client.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user