added basic plugin structure
This commit is contained in:
19
pkg/register/plugin_api.go
Normal file
19
pkg/register/plugin_api.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package register
|
||||
|
||||
import (
|
||||
"net/rpc"
|
||||
|
||||
"github.com/hashicorp/go-plugin"
|
||||
)
|
||||
|
||||
type PluginAPI struct {
|
||||
Impl Plugin
|
||||
}
|
||||
|
||||
func (pa *PluginAPI) Server(*plugin.MuxBroker) (any, error) {
|
||||
return &PluginServer{Impl: pa.Impl}, nil
|
||||
}
|
||||
|
||||
func (*PluginAPI) Client(b *plugin.MuxBroker, c *rpc.Client) (any, error) {
|
||||
return &PluginClient{client: c}, nil
|
||||
}
|
Reference in New Issue
Block a user