Documentation ¶
Overview ¶
Package pluginaction handles all operations related to plugin commands
Index ¶
- type Actor
- func (actor Actor) AddPluginRepository(repoName string, repoURL string) error
- func (actor Actor) CreateExecutableCopy(path string, tempPluginDir string) (string, error)
- func (actor Actor) DownloadExecutableBinaryFromURL(pluginURL string, tempPluginDir string, proxyReader plugin.ProxyReader) (string, error)
- func (actor Actor) FileExists(path string) bool
- func (actor Actor) GetAndValidatePlugin(pluginMetadata PluginMetadata, commandList CommandList, path string) (configv3.Plugin, error)
- func (actor Actor) GetOutdatedPlugins() ([]OutdatedPlugin, error)
- func (actor Actor) GetPlatformString(runtimeGOOS string, runtimeGOARCH string) string
- func (actor Actor) GetPluginInfoFromRepositoriesForPlatform(pluginName string, pluginRepos []configv3.PluginRepository, platform string) (PluginInfo, []string, error)
- func (actor Actor) GetPluginRepository(repositoryName string) (configv3.PluginRepository, error)
- func (actor Actor) InstallPluginFromPath(path string, plugin configv3.Plugin) error
- func (actor Actor) IsPluginRepositoryRegistered(repositoryName string) bool
- func (actor Actor) UninstallPlugin(uninstaller PluginUninstaller, name string) error
- func (actor Actor) ValidateFileChecksum(path string, checksum string) bool
- type CommandList
- type Config
- type OutdatedPlugin
- type PluginClient
- type PluginInfo
- type PluginMetadata
- type PluginUninstaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct {
// contains filtered or unexported fields
}
Actor handles all plugin actions
func NewActor ¶
func NewActor(config Config, client PluginClient) *Actor
NewActor returns a pluginaction Actor
func (Actor) AddPluginRepository ¶
func (Actor) CreateExecutableCopy ¶
CreateExecutableCopy makes a temporary copy of a plugin binary and makes it executable.
config.PluginHome() + /temp is used as the temp dir instead of the system temp for security reasons.
func (Actor) DownloadExecutableBinaryFromURL ¶
func (actor Actor) DownloadExecutableBinaryFromURL(pluginURL string, tempPluginDir string, proxyReader plugin.ProxyReader) (string, error)
DownloadExecutableBinaryFromURL fetches a plugin binary from the specified URL, if it exists.
func (Actor) FileExists ¶
FileExists returns true if the file exists. It returns false if the file doesn't exist or there is an error checking.
func (Actor) GetAndValidatePlugin ¶
func (actor Actor) GetAndValidatePlugin(pluginMetadata PluginMetadata, commandList CommandList, path string) (configv3.Plugin, error)
func (Actor) GetOutdatedPlugins ¶
func (actor Actor) GetOutdatedPlugins() ([]OutdatedPlugin, error)
func (Actor) GetPlatformString ¶
GetPlatformString exists solely for the purposes of mocking it out for command-layers tests.
func (Actor) GetPluginInfoFromRepositoriesForPlatform ¶
func (actor Actor) GetPluginInfoFromRepositoriesForPlatform(pluginName string, pluginRepos []configv3.PluginRepository, platform string) (PluginInfo, []string, error)
GetPluginInfoFromRepositoriesForPlatform returns the newest version of the specified plugin and all the repositories that contain that version.
func (Actor) GetPluginRepository ¶
func (actor Actor) GetPluginRepository(repositoryName string) (configv3.PluginRepository, error)
func (Actor) InstallPluginFromPath ¶
func (Actor) IsPluginRepositoryRegistered ¶
func (Actor) UninstallPlugin ¶
func (actor Actor) UninstallPlugin(uninstaller PluginUninstaller, name string) error
type Config ¶
type Config interface { AddPlugin(configv3.Plugin) AddPluginRepository(repoName string, repoURL string) GetPlugin(pluginName string) (configv3.Plugin, bool) PluginHome() string PluginRepositories() []configv3.PluginRepository Plugins() []configv3.Plugin RemovePlugin(string) WritePluginConfig() error }
Config is a way of getting basic CF configuration
type OutdatedPlugin ¶
type PluginClient ¶
type PluginClient interface { GetPluginRepository(repositoryURL string) (plugin.PluginRepository, error) DownloadPlugin(pluginURL string, path string, proxyReader plugin.ProxyReader) error }