plugins

package
v0.0.0-...-c427923 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package plugins implements an RPP client in Reginald to run plugins.

Index

Constants

View Source
const (
	DefaultHandshakeTimeout  = 5 * time.Second
	DefaultShutdownTimeout   = 15 * time.Second
	DefaultMaxProtocolErrors = 5
)

Default values associated with the plugin client.

Variables

This section is empty.

Functions

func Initialize

func Initialize(ctx context.Context, plugins []*Plugin, cfgs map[string]any) error

Initialize calls the "initialize" method on all plugins.

func ShutdownAll

func ShutdownAll(ctx context.Context, plugins []*Plugin) error

ShutdownAll tries to gracefully shut down all of the plugins.

Types

type Plugin

type Plugin struct {
	rpp.HandshakeResult
	// contains filtered or unexported fields
}

A Plugin represents a plugin that acts as an RPP server and is run from this client.

func Load

func Load(ctx context.Context, files []fspath.Path) ([]*Plugin, error)

Load creates the processes for the plugins, performs the handshakes with them, returns a slice of the valid plugins.

func New

func New(ctx context.Context, path fspath.Path) (*Plugin, error)

New returns a pointer to a newly created Plugin.

func (*Plugin) RunCmd

func (p *Plugin) RunCmd(ctx context.Context, name string) error

RunCmd runs a command with the given name from this plugin.

func (*Plugin) RunTask

func (p *Plugin) RunTask(
	ctx context.Context,
	tt string,
	dir fspath.Path,
	opts taskcfg.Options,
) error

RunTask runs a task with the given type tt from this plugin.

func (*Plugin) SetupCmd

func (p *Plugin) SetupCmd(ctx context.Context, name string, cfg []rpp.ConfigEntry) error

SetupCmd runs the setup for a command with the given name from this plugin.

func (*Plugin) ValidateTask

func (p *Plugin) ValidateTask(ctx context.Context, tt string, opts taskcfg.Options) error

ValidateTask runs the task validation for a task in a plugin with the given task type tt and the given opts which should be validated.

Jump to

Keyboard shortcuts

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