plugin

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Information added in v0.21.3

func Information(name string) (string, error)

Information gets the information about an installed plugin

func IsPredefined added in v0.30.3

func IsPredefined(name string) bool

func List added in v0.21.3

func List() (string, error)

List gets a list of all installed plugins

func RunWithArgs added in v0.30.0

func RunWithArgs(ctx context.Context, url string, args []string) error

RunWithArgs runs the plugin with arguments

func Uninstall

func Uninstall(name string) error

Uninstall installs the plugin

func Update added in v0.21.3

func Update(name string) error

Update updates an existing plugin

Types

type Platform

type Platform struct {
	Selector *Selector
	URI      string
	Bin      string
}

Platform represents where the execution file exists per platform.

type Plugin

type Plugin struct {
	Name        string     `yaml:"name"`
	Repository  string     `yaml:"repository"`
	Version     string     `yaml:"version"`
	Usage       string     `yaml:"usage"`
	Description string     `yaml:"description"`
	Platforms   []Platform `yaml:"platforms"`

	// runtime environment for testability
	GOOS   string `yaml:"_goos"`
	GOARCH string `yaml:"_goarch"`
}

Plugin represents a plugin.

func Install

func Install(ctx context.Context, url string, force bool) (Plugin, error)

Install installs a plugin

func LoadAll

func LoadAll() ([]Plugin, error)

LoadAll loads all plugins

func (Plugin) Run

func (p Plugin) Run(ctx context.Context, args []string) error

Run runs the plugin

type Selector

type Selector struct {
	OS   string
	Arch string
}

Selector represents the environment.

Jump to

Keyboard shortcuts

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