shared

package
v0.0.0-...-537ab52 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 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{
	"kv_grpc": &KVGRPCPlugin{},
}

Functions

This section is empty.

Types

type KV

type KV interface {
	Put(key string, value []byte) error
	Get(key string) ([]byte, error)
}

type KVGRPCClient

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

func (*KVGRPCClient) Get

func (k *KVGRPCClient) Get(key string) ([]byte, error)

func (*KVGRPCClient) Put

func (k *KVGRPCClient) Put(key string, value []byte) error

type KVGRPCPlugin

type KVGRPCPlugin struct {
	plugin.Plugin
	Impl KV
}

func (*KVGRPCPlugin) GRPCClient

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

func (*KVGRPCPlugin) GRPCServer

func (k *KVGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

type KVGRPCServer

type KVGRPCServer struct {
	Impl KV
}

func (*KVGRPCServer) Get

func (k *KVGRPCServer) Get(ctx context.Context, request *proto.GetRequest) (*proto.GetResponse, error)

func (*KVGRPCServer) Put

func (k *KVGRPCServer) Put(ctx context.Context, request *proto.PutRequest) (*proto.Empty, error)

Jump to

Keyboard shortcuts

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