plugins

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Directory = "plugins"
)
View Source
const SchemaTypePlugins = "Plugins"

SchemaTypePlugins is the default schemaType value for InstallPluginsSpec resources

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.

View Source
var InstallPluginsSchemaVersion = cnab.SchemaVersion("1.0.0")

InstallPluginsSchemaVersion represents the version associated with the schema plugins configuration documents.

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(c *portercontext.Context, interfaceName string, pluginImplementation plugin.Plugin, version int)

Serve a single named plugin.

func ServeMany

func ServeMany(c *portercontext.Context, pluginMap map[int]plugin.PluginSet)

ServeMany 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

	File string
}

func (*InstallOptions) Validate

func (o *InstallOptions) Validate(args []string, cxt *portercontext.Context) error

type InstallPluginsConfig added in v1.0.5

type InstallPluginsConfig map[string]pkgmgmt.InstallOptions

InstallPluginsConfig is the go representation of plugin installation file format.

type InstallPluginsConfigList added in v1.0.6

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

InstallPluginsConfigList is a sorted list of InstallationFileOption in alphabetical order.

func NewInstallPluginConfigs added in v1.0.5

func NewInstallPluginConfigs(opt InstallPluginsConfig) InstallPluginsConfigList

NewInstallPluginConfigs returns a new instance of InstallPluginConfigs with plugins sorted in alphabetical order using their names.

func (InstallPluginsConfigList) Values added in v1.0.6

Values returns InstallOptions list in alphabetical order.

type InstallPluginsSpec added in v1.0.6

type InstallPluginsSpec struct {
	SchemaType    string               `yaml:"schemaType"`
	SchemaVersion string               `yaml:"schemaVersion"`
	Plugins       InstallPluginsConfig `yaml:"plugins"`
}

InstallPluginsSpec represents the user-defined configuration for plugins installation.

func (InstallPluginsSpec) Validate added in v1.0.6

func (spec InstallPluginsSpec) Validate() 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 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 {
	*portercontext.Context
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(pluginName string) *PluginRunner

func (*PluginRunner) Run

func (r *PluginRunner) Run(ctx context.Context, commandOpts CommandOptions) error

func (*PluginRunner) Validate

func (r *PluginRunner) Validate() error

Directories

Path Synopsis
Package pluggable manages configuring and connecting to Porter's plugins.
Package pluggable manages configuring and connecting to Porter's plugins.

Jump to

Keyboard shortcuts

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