Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HandshakeConfig = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: "hello",
}
handshakeConfigs 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 ¶
This section is empty.
Types ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient is an implementation of Greeter that talks over RPC.
func (*GRPCClient) DoMath ¶
func (m *GRPCClient) DoMath(x, y int64) int64
type GRPCServer ¶
type GRPCServer struct {
mather.UnimplementedMatherServer
// This is the real implementation
Impl Mather
}
Here is the gRPC server that GRPCClient talks to.
func (*GRPCServer) DoMath ¶
func (m *GRPCServer) DoMath( ctx context.Context, req *mather.MathRequest, ) (*mather.MathResponse, error)
type MatherGRPCPlugin ¶
type MatherGRPCPlugin struct {
// GRPCPlugin must still implement the Plugin interface
plugin.Plugin
// Concrete implementation, written in Go. This is only used for plugins
// that are written in Go.
Impl Mather
}
This is the implementation of plugin.GRPCPlugin so we can serve/consume this.
func (*MatherGRPCPlugin) GRPCClient ¶
func (p *MatherGRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*MatherGRPCPlugin) GRPCServer ¶
func (p *MatherGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
Click to show internal directories.
Click to hide internal directories.