plugin

package
v0.113.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Plugin implements the Updatecli plugin system. It leverages WASM to run plugins in a secure sandboxed environment. It relies on https://github.com/extism/go-sdk

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

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

Plugin represents an Updatecli plugin object

func New

func New(spec interface{}, rootDir, scmID, actionID, path string) (Plugin, error)

func (Plugin) DiscoverManifests

func (p Plugin) DiscoverManifests() ([][]byte, error)

type Spec

type Spec struct {
	// Spec contains the plugin parameters.
	// cfr the plugin documentation.
	Spec map[string]any `yaml:",omitempty"`
	// AllowedPaths is a list of paths to be accessed from inside the plugin sandbox,
	// a path can be either a plain path or a map from HOST_PATH:GUEST_PATH
	//
	// Example:
	//   - .:/mnt
	//   - /var/lib/updatecli:/data
	//
	// Default: [".:/mnt"]
	//
	// Remark:
	//   * Relative paths are considered relative to the Updatecli working directory.
	//     If a scm root directory is set, relative paths are considered relative to the scm root directory.
	//   * By default, the plugin runs from "/mnt"
	AllowedPaths *[]string `yaml:",omitempty"`
	// AllowedHosts hold a list of allowed hosts for HTTP requests from the plugin sandbox
	AllowHosts []string `yaml:",omitempty"`
	// Timeout defines a maximum execution time for the plugin in seconds
	//
	// Default: 300 seconds
	Timeout *uint64 `yaml:",omitempty"`
}

Jump to

Keyboard shortcuts

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