plugin

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Uninstall

func Uninstall(name string) error

Uninstall installs the 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