Documentation
¶
Index ¶
Constants ¶
View Source
const ( ProcessRPCMethodName = "Plugin.Process" InitRPCMethodName = "Plugin.Init" )
View Source
const PluginProcessorKey = "processor"
Variables ¶
View Source
var ( ErrPluginDispense = fmt.Errorf("plugin dispense error") ErrPluginInitialization = fmt.Errorf("plugin initialization error") )
View Source
var HandshakeConfig = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "integration-connector-agent-plugin",
MagicCookieValue: "rpc-plugin",
}
HandshakeConfig are used to just do a basic handshake between a plugin and host. If the handshake fails, a user friendly error is shown. This prevents users from executing bad plugins or executing a plugin directory. It is a UX feature, not a security feature.
Functions ¶
func NewLogAdapter ¶
func NewLogAdapter(log Logger) hclog.Logger
Types ¶
type Config ¶
type Config struct {
ModulePath string `json:"modulePath"`
InitOptions json.RawMessage `json:"initOptions,omitempty"`
}
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) Process ¶
func (p *Plugin) Process(event entities.PipelineEvent) (entities.PipelineEvent, error)
type PluginAdapter ¶
type PluginAdapter struct {
Impl entities.InitializableProcessor
}
func (PluginAdapter) Client ¶
func (PluginAdapter) Client(_ *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
func (*PluginAdapter) Server ¶
func (p *PluginAdapter) Server(*plugin.MuxBroker) (interface{}, error)
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
Client used by the integration connecter agent to call the plugin.
func (*RPCClient) Process ¶
func (g *RPCClient) Process(event entities.PipelineEvent) (entities.PipelineEvent, error)
type RPCServer ¶
type RPCServer struct {
Impl entities.InitializableProcessor
}
Server used by the plugin to invoke the plugin processor when integration connector agent calls the plugin.
Click to show internal directories.
Click to hide internal directories.