plugin

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Information

func Information(name string) (string, error)

Information gets the information about an installed plugin

func IsPredefined

func IsPredefined(name string) bool

func List

func List() (string, error)

List gets a list of all installed plugins

func RunWithArgs

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

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