plugin

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "nodeProcess"
)

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  2,
	MagicCookieKey:   "NODE_PROCESS_PLUGIN",
	MagicCookieValue: "dynamic",
}
View Source
var PluginMap = map[string]plugin.Plugin{
	Name: &AppPlugin{},
}

PluginMap is the map of plugins we can dispense.

Functions

func Exec

func Exec(path string, args []string, forwardIO bool) (app.App, *plugin.Client, error)

Types

type AppPlugin

type AppPlugin struct {
	plugin.NetRPCUnsupportedPlugin
	// contains filtered or unexported fields
}

AppPlugin is can be served/consumed with the hashicorp plugin library. Plugin implements plugin.GRPCPlugin

func New

func New(app app.App) *AppPlugin

func (*AppPlugin) GRPCClient

func (p *AppPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

GRPCClient returns a new GRPC client

func (*AppPlugin) GRPCServer

func (p *AppPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer registers a new GRPC server.

type Client

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

func NewClient

func NewClient(node pluginproto.NodeClient) *Client

NewServer returns an app instance connected to a remote app instance

func (*Client) ExitCode

func (c *Client) ExitCode() (int, error)

func (*Client) Start

func (c *Client) Start() error

func (*Client) Stop

func (c *Client) Stop() error

type Server

type Server struct {
	pluginproto.UnimplementedNodeServer
	// contains filtered or unexported fields
}

Server wraps a node so it can be served with the hashicorp plugin harness

func NewServer

func NewServer(app app.App) *Server

func (*Server) ExitCode

func (*Server) Start

func (*Server) Stop

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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