Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HandshakeConfig = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: "hello",
}
HandshakeConfig is a common handshake that is shared by plugin and host.
Functions ¶
This section is empty.
Types ¶
type SayerPlugin ¶
type SayerPlugin struct {
Impl Sayer
}
This is the implementation of plugin.Plugin so we can serve/consume this
This has two methods: Server must return an RPC server for this plugin type. We construct a SayerRPCServer for this.
Client must return an implementation of our interface that communicates over an RPC client. We return SayerRPC for this.
Ignore MuxBroker. That is used to create more multiplexed streams on our plugin connection and is a more advanced use case.
type SayerRPC ¶
type SayerRPC struct {
// contains filtered or unexported fields
}
Here is an implementation that talks over RPC
type SayerRPCServer ¶
type SayerRPCServer struct {
// This is the real implementation
Impl Sayer
}
Here is the RPC server that SayerRPC talks to, conforming to the requirements of net/rpc
func (*SayerRPCServer) Says ¶
func (s *SayerRPCServer) Says(args interface{}, resp *string) error
Click to show internal directories.
Click to hide internal directories.