Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: "hello-example",
}
Handshake 通用的 handshake
View Source
var PluginMap = map[string]plugin.Plugin{ "echo_grpc": &EchoPlugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
This section is empty.
Types ¶
type EchoPlugin ¶
type EchoPlugin struct { plugin.Plugin Impl Echo }
EchoPlugin echo plugin
func (*EchoPlugin) GRPCClient ¶
func (p *EchoPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*EchoPlugin) GRPCServer ¶
func (p *EchoPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
type GRPCServer ¶
type GRPCServer struct {
Impl Echo
}
GRPCServer grpc server
func (*GRPCServer) Echo ¶
func (s *GRPCServer) Echo(ctx context.Context, req *proto.GetRequest) (*proto.GetResponse, error)
Echo impl
Click to show internal directories.
Click to hide internal directories.