Documentation ¶
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{ "counter": &CounterPlugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
This section is empty.
Types ¶
type CounterPlugin ¶
type CounterPlugin struct { plugin.NetRPCUnsupportedPlugin // Concrete implementation, written in Go. This is only used for plugins // that are written in Go. Impl Counter }
This is the implementation of plugin.Plugin so we can serve/consume this. We also implement GRPCPlugin so that this plugin can be served over gRPC.
func (*CounterPlugin) GRPCClient ¶
func (p *CounterPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*CounterPlugin) GRPCServer ¶
func (p *CounterPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type GRPCCounterClient ¶
type GRPCCounterClient struct {
// contains filtered or unexported fields
}
type GRPCCounterServer ¶
type GRPCCounterServer struct { proto.UnimplementedCounterServer Impl Counter // contains filtered or unexported fields }
func (*GRPCCounterServer) Increment ¶
func (m *GRPCCounterServer) Increment(ctx context.Context, req *proto.IncrementRequest) (*proto.IncrementResponse, error)
type GRPCStorageClient ¶
type GRPCStorageClient struct {
// contains filtered or unexported fields
}
type GRPCStorageServer ¶
type GRPCStorageServer struct { proto.UnimplementedStorageServer Impl Storage }
func (*GRPCStorageServer) Get ¶
func (m *GRPCStorageServer) Get(ctx context.Context, req *proto.GetRequest) (*proto.GetResponse, error)
func (*GRPCStorageServer) Put ¶
func (m *GRPCStorageServer) Put(ctx context.Context, req *proto.PutRequest) (*proto.PutResponse, error)
Click to show internal directories.
Click to hide internal directories.