plugin

package
v0.1.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginName             = "plugin"
	DefaultProtocolVersion = 1
)

Variables

View Source
var Handshake = p.HandshakeConfig{
	ProtocolVersion: DefaultProtocolVersion,

	MagicCookieKey:   "RUN_PLUGIN_MAGIC_COOKIE",
	MagicCookieValue: "iaafij5485d5utqh",
}

Handshake ...

View Source
var VersionedPlugins = map[int]p.PluginSet{
	1: {
		"plugin": &GRPCTaskPlugin{},
	},
}

Functions

func Serve

func Serve(opts *ServeOpts)

Serve ...

Types

type ExecuteRequest

type ExecuteRequest struct {
	Vars      map[string]string
	Arguments []string
}

ExecuteRequest ...

type ExecuteResponse

type ExecuteResponse struct {
}

ExecuteResponse ...

type Factory

type Factory func() (Plugin, error)

Factory ...

type GRPCPlugin

type GRPCPlugin struct {
	PluginClient *p.Client
	// contains filtered or unexported fields
}

GRPCPlugin ...

func (*GRPCPlugin) Close

func (p *GRPCPlugin) Close() error

Start ...

func (*GRPCPlugin) Execute

func (p *GRPCPlugin) Execute(req ExecuteRequest) (ExecuteResponse, error)

Execute ...

type GRPCPluginFunc

type GRPCPluginFunc func() proto.PluginServer

GRPCPluginFunc ...

type GRPCTaskPlugin

type GRPCTaskPlugin struct {
	p.Plugin
	GRPCPlugin func() proto.PluginServer
}

GRPCTaskPlugin ...

func (*GRPCTaskPlugin) GRPCClient

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

GRPCClient ...

func (*GRPCTaskPlugin) GRPCServer

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

type Meta

type Meta struct {
	// Path ...
	Path string
	// Arguments ...
	Arguments []string
}

Meta ...

func (*Meta) ExecutableFile

func (m *Meta) ExecutableFile() (string, error)

ExecutableFile ...

func (*Meta) Factory

func (m *Meta) Factory(ctx context.Context) Factory

type Plugin

type Plugin interface {
	// Execute ...
	Execute(ExecuteRequest) (ExecuteResponse, error)
	// Close ...
	Close() error
}

Plugin ...

type ServeOpts

type ServeOpts struct {
	GRPCPluginFunc GRPCPluginFunc
}

ServeOpts ...

Jump to

Keyboard shortcuts

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