Documentation ¶
Overview ¶
Package shared contains shared data between the host and plugins.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: "hello",
}
Handshake is a common handshake that is shared by plugin and host.
View Source
var PluginMap = map[string]plugin.Plugin{ "greeter_grpc": &GreeterGRPCPlugin{}, "greeter": &GreeterPlugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
This section is empty.
Types ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient is an implementation of KV that talks over RPC.
type GRPCServer ¶
type GRPCServer struct { // This is the real implementation Impl Greeter }
Here is the gRPC server that GRPCClient talks to.
func (*GRPCServer) Get ¶
func (m *GRPCServer) Get( ctx context.Context, req *proto.GetRequest) (*proto.GetResponse, error)
func (*GRPCServer) Put ¶
func (m *GRPCServer) Put( ctx context.Context, req *proto.PutRequest) (*proto.Empty, error)
type GreeterGRPCPlugin ¶
type GreeterGRPCPlugin 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 Greeter }
This is the implementation of plugin.GRPCPlugin so we can serve/consume this.
func (*GreeterGRPCPlugin) GRPCClient ¶
func (p *GreeterGRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*GreeterGRPCPlugin) GRPCServer ¶
func (p *GreeterGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type GreeterPlugin ¶
type GreeterPlugin struct { // Concrete implementation, written in Go. This is only used for plugins // that are written in Go. Impl Greeter }
This is the implementation of plugin.Plugin so we can serve/consume this.
func (*GreeterPlugin) Client ¶
func (*GreeterPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
func (*GreeterPlugin) Server ¶
func (p *GreeterPlugin) Server(*plugin.MuxBroker) (interface{}, error)
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
RPCClient is an implementation of KV that talks over RPC.
Click to show internal directories.
Click to hide internal directories.