shared

package
v0.0.0-...-98f22ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2019 License: MIT Imports: 4 Imported by: 0

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 Echo

type Echo interface {
	Echo(value string) ([]byte, error)
}

Echo echo service

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
}

func (*GRPCClient) Echo

func (c *GRPCClient) Echo(value string) ([]byte, error)

实现 client 端的 echo 接口

type GRPCServer

type GRPCServer struct {
	Impl Echo
}

GRPCServer grpc server

func (*GRPCServer) Echo

Echo impl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL