plugin

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HandshakeConfig = go_plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "COFIDECTL_PLUGIN",
	MagicCookieValue: "config",
}

HandshakeConfig is a common handshake that is shared by plugin and host.

View Source
var PluginServeArgs []string = []string{"plugin", "serve"}

PluginServeArgs contains the arguments passed to plugins when executing them as a gRPC plugin.

Functions

func GetPluginDir

func GetPluginDir() (string, error)

func GetPluginPath

func GetPluginPath(name string) (string, error)

func IsPluginServeCmd added in v0.5.0

func IsPluginServeCmd(args []string) bool

IsPluginServeCmd returns whether the provided command line arguments indicate that a plugin should serve gRPC plugins.

func PluginExists

func PluginExists(name string) (bool, error)

Types

type CliPlugin

type CliPlugin struct {
	BinaryName string
	Args       []string
}

func NewCliPlugin

func NewCliPlugin(binary string, args []string) *CliPlugin

func (*CliPlugin) Execute

func (cp *CliPlugin) Execute() error

Execute executes a CLI plugin by exec'ing into it, replacing the current process. This may change to execute the plugin as a subprocess, but Exec keeps things simple for now (no signal handling etc.)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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