{"modulePath":"code.cloudfoundry.org/cli-sapi","version":"v6.51.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package pluginaction\n\nPackage pluginaction handles all operations related to plugin commands\n\n## Types\n\n```go\ntype Actor struct {\n\t// contains filtered or unexported fields\n}\n```\nActor handles all plugin actions\n\n```go\nfunc NewActor(config Config, client PluginClient) *Actor\n```\nNewActor returns a pluginaction Actor\n\n```go\nfunc (actor Actor) AddPluginRepository(repoName string, repoURL string) error\n```\n\n```go\nfunc (actor Actor) CreateExecutableCopy(path string, tempPluginDir string) (string, error)\n```\nCreateExecutableCopy makes a temporary copy of a plugin binary and makes it executable.\n\nconfig.PluginHome() + /temp is used as the temp dir instead of the system temp for security reasons.\n\n```go\nfunc (actor Actor) DownloadExecutableBinaryFromURL(pluginURL string, tempPluginDir string, proxyReader plugin.ProxyReader) (string, error)\n```\nDownloadExecutableBinaryFromURL fetches a plugin binary from the specified URL, if it exists.\n\n```go\nfunc (actor Actor) FileExists(path string) bool\n```\nFileExists returns true if the file exists. It returns false if the file doesn't exist or there is an error checking.\n\n```go\nfunc (actor Actor) GetAndValidatePlugin(pluginMetadata PluginMetadata, commandList CommandList, path string) (configv3.Plugin, error)\n```\n\n```go\nfunc (actor Actor) GetOutdatedPlugins() ([]OutdatedPlugin, error)\n```\n\n```go\nfunc (actor Actor) GetPlatformString(runtimeGOOS string, runtimeGOARCH string) string\n```\nGetPlatformString exists solely for the purposes of mocking it out for command-layers tests.\n\n```go\nfunc (actor Actor) GetPluginInfoFromRepositoriesForPlatform(pluginName string, pluginRepos []configv3.PluginRepository, platform string) (PluginInfo, []string, error)\n```\nGetPluginInfoFromRepositoriesForPlatform returns the newest version of the specified plugin and all the repositories that contain that version.\n\n```go\nfunc (actor Actor) GetPluginRepository(repositoryName string) (configv3.PluginRepository, error)\n```\n\n```go\nfunc (actor Actor) InstallPluginFromPath(path string, plugin configv3.Plugin) error\n```\n\n```go\nfunc (actor Actor) IsPluginRepositoryRegistered(repositoryName string) bool\n```\n\n```go\nfunc (actor Actor) UninstallPlugin(uninstaller PluginUninstaller, name string) error\n```\n\n```go\nfunc (actor Actor) ValidateFileChecksum(path string, checksum string) bool\n```\n\n```go\ntype CommandList interface {\n\tHasCommand(string) bool\n\tHasAlias(string) bool\n}\n```\n\n```go\ntype Config interface {\n\tAddPlugin(configv3.Plugin)\n\tAddPluginRepository(repoName string, repoURL string)\n\tBinaryVersion() string\n\tGetPlugin(pluginName string) (configv3.Plugin, bool)\n\tPluginHome() string\n\tPluginRepositories() []configv3.PluginRepository\n\tPlugins() []configv3.Plugin\n\tRemovePlugin(string)\n\tWritePluginConfig() error\n}\n```\nConfig is a way of getting basic CF configuration\n\n```go\ntype OutdatedPlugin struct {\n\tName           string\n\tCurrentVersion string\n\tLatestVersion  string\n}\n```\n\n```go\ntype PluginClient interface {\n\tGetPluginRepository(repositoryURL string) (plugin.PluginRepository, error)\n\tDownloadPlugin(pluginURL string, path string, proxyReader plugin.ProxyReader) error\n}\n```\n\n```go\ntype PluginInfo struct {\n\tName     string\n\tVersion  string\n\tURL      string\n\tChecksum string\n}\n```\n\n```go\ntype PluginMetadata interface {\n\tGetMetadata(pluginPath string) (configv3.Plugin, error)\n}\n```\n\n```go\ntype PluginUninstaller interface {\n\tRun(pluginPath string, command string) error\n}\n```\n\n","path":"code.cloudfoundry.org/cli-sapi/actor/pluginaction","name":"pluginaction","synopsis":"Package pluginaction handles all operations related to plugin commands","isRedistributable":true}
