shared

package
v0.0.0-...-3e35c70 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: BSD-3-Clause 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",
}
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 Add

type Add interface {
	Sum(a, b int64) (int64, error)
}

type AddGRPCClient

type AddGRPCClient struct {
	// contains filtered or unexported fields
}

func (*AddGRPCClient) Sum

func (a *AddGRPCClient) Sum(x, y int64) (int64, error)

type AddGRPCServer

type AddGRPCServer struct {
	Impl Add
}

func (*AddGRPCServer) Sum

type Counter

type Counter interface {
	Put(key string, value int64, a Add) error
	Get(key string) (int64, error)
}

type CounterGRPCClient

type CounterGRPCClient struct {
	// contains filtered or unexported fields
}

func (*CounterGRPCClient) Get

func (c *CounterGRPCClient) Get(key string) (int64, error)

func (*CounterGRPCClient) Put

func (c *CounterGRPCClient) Put(key string, value int64, a Add) error

type CounterGRPCServer

type CounterGRPCServer struct {
	Impl Counter
	// contains filtered or unexported fields
}

func (*CounterGRPCServer) Get

func (*CounterGRPCServer) Put

func (c *CounterGRPCServer) Put(ctx context.Context, request *proto.PutRequest) (*proto.Empty, error)

type CounterPlugin

type CounterPlugin struct {
	plugin.NetRPCUnsupportedPlugin
	Impl Counter
}

func (*CounterPlugin) GRPCClient

func (c *CounterPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, client *grpc.ClientConn) (interface{}, error)

func (*CounterPlugin) GRPCServer

func (c *CounterPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

Jump to

Keyboard shortcuts

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