plugin

package
v0.0.0-...-a4f8eeb Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  sn.ProtoVersion,
	MagicCookieKey:   magicKey,
	MagicCookieValue: magicValue,
}
View Source
var PluginMap = func(timeout time.Duration) map[string]plugin.Plugin {
	return map[string]plugin.Plugin{
		"grpc": &PluginGRPCImpl{
			SkynetTimeout: timeout,
		},
	}
}

Functions

This section is empty.

Types

type GRPCClient

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

func (*GRPCClient) Disable

func (m *GRPCClient) Disable(h PluginHelper) (*PluginError, error)

func (*GRPCClient) Enable

func (m *GRPCClient) Enable(h PluginHelper) (*PluginError, error)

type GRPCPluginHelperClient

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

func (*GRPCPluginHelperClient) Eval

func (m *GRPCPluginHelperClient) Eval(str string) (string, error)

type GRPCPluginHelperServer

type GRPCPluginHelperServer struct {
	proto.UnimplementedPluginHelperServer
	// contains filtered or unexported fields
}

func (*GRPCPluginHelperServer) Eval

type GRPCServer

type GRPCServer struct {
	proto.UnimplementedPluginServer
	// contains filtered or unexported fields
}

func (*GRPCServer) Disable

func (m *GRPCServer) Disable(
	ctx context.Context,
	req *proto.Empty) (*proto.Error, error)

func (*GRPCServer) Enable

func (m *GRPCServer) Enable(
	ctx context.Context,
	req *proto.Empty) (*proto.Error, error)

type PluginAPI

type PluginAPI interface {
	Enable(h PluginHelper) (*PluginError, error)
	Disable(h PluginHelper) (*PluginError, error)
}

type PluginError

type PluginError struct {
	Code proto.ErrorCode
}

type PluginGRPCImpl

type PluginGRPCImpl struct {
	plugin.NetRPCUnsupportedPlugin
	Impl          PluginAPI
	SkynetTimeout time.Duration
	PluginTimeout time.Duration
}

func (*PluginGRPCImpl) GRPCClient

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

func (*PluginGRPCImpl) GRPCServer

func (p *PluginGRPCImpl) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

type PluginHelper

type PluginHelper interface {
	Eval(str string) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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