plugin

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 5 Imported by: 10

Documentation

Index

Constants

View Source
const InfoName = "info"

InfoName constant should not be used directly when implementing plugins. It's the registration name for the info plugin, used by the CLI and the cli-plugin-base library (RegisterPlugins function) to register the plugins.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info interface {
	PluginInfo() PluginInfo
}

Info interface needs to be implemented by all plugins to provide basic plugin information.

type InfoPlugin

type InfoPlugin struct {
	Impl Info
}

InfoPlugin is used on the server (CLI) and client (plugin) side to integrate with the plugin system. A plugin should not be using this directly, but instead depend on the cli-plugin-base library to register the plugins.

func (InfoPlugin) Client

func (InfoPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*InfoPlugin) Server

func (p *InfoPlugin) Server(*plugin.MuxBroker) (interface{}, error)

type ParameterInfo

type ParameterInfo struct {
	Name        string
	Description string
	Mandatory   bool
}

ParameterInfo contains the information about a parameter. This is used to inform the CLI user what command-line parameters are expected explicitly for this target (plugin).

func (ParameterInfo) String

func (i ParameterInfo) String() string

type PluginInfo

type PluginInfo struct {
	Name        string
	Description string
	Version     Version
	Parameters  []ParameterInfo
}

PluginInfo represents the information about a plugin.

func (PluginInfo) FullOverview

func (i PluginInfo) FullOverview() string

func (PluginInfo) String

func (i PluginInfo) String() string

type Version

type Version struct {
	Major       int
	Minor       int
	Maintenance int
}

Version contains semantic versioning information of the plugin

func ParseVersion

func ParseVersion(version string) Version

ParseVersion parses the given string version in the form X.Y.Z and returns a Version struct representing it. If the input string is invalid, a 0.0.0 version will be returned

func (Version) String

func (i Version) String() string

Jump to

Keyboard shortcuts

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