Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { Name string `toml:"name" json:"name"` Path string `toml:"path" json:"path"` Description string `toml:"description" json:"description"` }
Command represents each item defined in the `commands` key of the `plugin.toml` file. It also contains JSON tags for the `dcos plugin list --json` command.
type ExistError ¶
type ExistError struct {
// contains filtered or unexported fields
}
ExistError indicates that a plugin installation failed because it's already installed.
type InstallOpts ¶
type InstallOpts struct { // Name specify the name of the plugin. Name string // Update allows to potentially overwrite an already existing plugin of the same name. Update bool // Checksum represents a CLI plugin resource content hash. Checksum Checksum ProgressBar *mpb.Progress // PostInstall is a hook which can be invoked after plugin installation. // It is invoked right before the plugin is moved to its final location. PostInstall func(fs afero.Fs, pluginDir string) error // contains filtered or unexported fields }
InstallOpts are installation options for plugin resources.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager retrieves the plugins available for the current cluster by navigating into the filesystem.
func NewManager ¶
NewManager returns a new plugin manager.
func (*Manager) Install ¶
func (m *Manager) Install(resource string, installOpts *InstallOpts) (plugin *Plugin, err error)
Install installs a plugin from a resource.
func (*Manager) SetCluster ¶
SetCluster sets the plugin manager's target cluster.
type Plugin ¶
type Plugin struct { Name string `toml:"name" json:"name"` Commands []Command `toml:"commands" json:"commands"` // contains filtered or unexported fields }
Plugin is the structure representation of a `plugin.toml file. It also contains JSON tags for the `dcos plugin list --json` command.
func (*Plugin) CommandNames ¶
CommandNames returns the commands available in the plugin as a sorted list of names.
func (*Plugin) CompletionDir ¶
CompletionDir returns the absolute path to the directory holding the plugin's completion script files