Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var TerminatingMessage = &MonitoringMessage{
Box: "terminating",
Message: "terminating",
}
The terminating message. If this message will be send, the run command will shutdown all other start stop plugins and ends.
Functions ¶
func IsLocalPlugin ¶
func IsLocalPlugin(plugin InstallablePlugin) bool
IsLocalPlugin checks if the given plugin is a plugin that will be installed on the local system or configures the local system. In this case it returns true. Otherwise false.
Types ¶
type InstallablePlugin ¶
type InstallablePlugin interface {
// Must return the name of the plugin. This name will also be used for single commands.
fmt.Stringer
// Installs the tools.
// Should print information about the process.
Install()
// Updates the tools.
// Should print information about the process.
Update()
// Uninstall the tools.
// Should print information about the process.
Uninstall(purge bool)
Phase() Phase
}
InstallablePlugin is a plugin that can install/update/uninstall tools local or within minikube or both.
type InstallablePluginList ¶
type InstallablePluginList []InstallablePlugin
InstallablePluginList is a simple slice which can be sorted by the install Phase.
func (InstallablePluginList) Len ¶
func (l InstallablePluginList) Len() int
func (InstallablePluginList) Less ¶
func (l InstallablePluginList) Less(i, j int) bool
func (InstallablePluginList) Swap ¶
func (l InstallablePluginList) Swap(i, j int)
type InstallablePluginRegistry ¶
type InstallablePluginRegistry interface {
// AddPlugin adds a single plugin to the registry.
AddPlugin(plugin InstallablePlugin)
// AddPlugins adds the given list of plugins to the registry.
AddPlugins(plugins ...InstallablePlugin)
// ListPlugins returns a list of all currently registered plugins in the registry.
ListPlugins() InstallablePluginList
// FindPlugin tries to find and return a plugin with the given name. Otherwise it would return an error.
FindPlugin(name string) (InstallablePlugin, error)
}
InstallablePluginRegistry is the registry which collects all InstallablePlugins and provides easy access to them.
type MonitoringMessage ¶
The message type for notifying the run cli command about new status and monitoring messages from the plugin.
func CloneMonitoringMessage ¶
func CloneMonitoringMessage(message *MonitoringMessage) MonitoringMessage
CloneMonitoringMessage creates a copy of the given MonitoringMessage.
type StartStopPlugin ¶
type StartStopPlugin interface {
// Must return the name of the plugin. This name will also be used for single commands.
fmt.Stringer
// Start the command and sets the channel used to show status and monitoring messages.
// Returns a string that indicates the box name which is also present in the monitoring messages.
Start(chan *MonitoringMessage) (boxName string, err error)
// Stops the plugin for graceful shutdown.
Stop() error
// IsSingleRunnable determs if this plugin can be started using the "run <plugin>" command.
IsSingleRunnable() bool
}
The StartStopPlugin interface defines the interface for all plugins of the "run" command. They uses a channel to send new status updates which are shown by the "run" command.
type StartStopPluginRegistry ¶
type StartStopPluginRegistry interface {
// AddPlugin adds a single plugin to the registry.
AddPlugin(plugin StartStopPlugin)
// AddPlugins adds the given list of plugins to the registry.
AddPlugins(plugins ...StartStopPlugin)
// ListPlugins returns a list of all currently registered plugins in the registry.
ListPlugins() []StartStopPlugin
// FindPlugin tries to find and return a plugin with the given name. Otherwise it would return an error.
FindPlugin(name string) (StartStopPlugin, error)
}
StartStopPluginRegistry is the registry which collects all StartStopPlugins and provides easy access to them.