1 // The plugin package exposes functions and helpers for communicating to
2 // plugins which are implemented as standalone binary applications.
4 // plugin.Client fully manages the lifecycle of executing the application,
5 // connecting to it, and returning the RPC client for dispensing plugins.
7 // plugin.Serve fully manages listeners to expose an RPC server from a binary
8 // that plugin.Client can connect to.
15 // Plugin is the interface that is implemented to serve/connect to an
16 // inteface implementation.
17 type Plugin interface {
18 // Server should return the RPC server compatible struct to serve
19 // the methods that the Client calls over net/rpc.
20 Server(*MuxBroker) (interface{}, error)
22 // Client returns an interface implementation for the plugin you're
23 // serving that communicates to the server end of the plugin.
24 Client(*MuxBroker, *rpc.Client) (interface{}, error)