plugins

package
v1.0.0-alpha.14 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Directory = "plugins"
)

Variables

View Source
var HandshakeConfig = plugin.HandshakeConfig{
	MagicCookieKey:   "PORTER",
	MagicCookieValue: "bbc2dd71-def4-4311-906e-e98dc27208ce",
}

HandshakeConfig is common handshake config between Porter and its plugins.

Functions

func NewTestPluginProvider

func NewTestPluginProvider() *client.TestPackageManager

NewTestPluginProvider helps us test Porter.Plugins in our unit tests without actually hitting any real plugins on the file system.

func Serve

func Serve(interfaceName string, pluginImplementation plugin.Plugin)

Serve a single named plugin.

func ServeMany

func ServeMany(pluginMap map[string]plugin.Plugin)

Serve many plugins that the client will select by named interface.

Types

type CommandOptions

type CommandOptions struct {
	Command string
}

type Implementation

type Implementation struct {
	Type string `json:"type" yaml:"type"`
	Name string `json:"implementation" yaml:"name"`
}

Implementation stores implementation type (e.g. storage) and its name (e.g. s3, mongo)

type InstallOptions

type InstallOptions struct {
	pkgmgmt.InstallOptions
}

func (*InstallOptions) Validate

func (o *InstallOptions) Validate(args []string) error

type Metadata

type Metadata struct {
	pkgmgmt.Metadata `json:",inline" yaml:",inline"`
	Implementations  []Implementation `json:"implementations" yaml:"implementations"`
}

Metadata about an installed plugin.

type PackageManager

type PackageManager struct {
	*client.FileSystem
}

func NewPackageManager

func NewPackageManager(c *config.Config) *PackageManager

type Plugin

type Plugin interface {
	// Connect establishes a connection to the plugin.
	// Safe to call multiple times, the existing connection is reused.
	Connect() error

	// Close the connection to the plugin.
	// Safe to call multiple times.
	Close() error
}

Plugin is a general interface for interacting with Porter plugins.

type PluginKey

type PluginKey struct {
	Binary         string
	Interface      string
	Implementation string
	IsInternal     bool
}

func ParsePluginKey

func ParsePluginKey(value string) (PluginKey, error)

func (PluginKey) String

func (k PluginKey) String() string

type PluginProvider

type PluginProvider interface {
	pkgmgmt.PackageManager
}

PluginProvider manages Porter's plugins: installing, listing, upgrading and general communication.

type PluginRunner

type PluginRunner struct {
	*context.Context
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(pluginName string) *PluginRunner

func (*PluginRunner) Run

func (r *PluginRunner) Run(commandOpts CommandOptions) error

func (*PluginRunner) Validate

func (r *PluginRunner) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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