Documentation ¶
Index ¶
- func CopyFiles(src string, pluginDir string, bundle PluginFiles) (err error)
- func DownloadFiles(src string, pluginDir string, bundle PluginFiles) (err error)
- type FileItem
- type InstallDataTransferPluginCommand
- func (idtp *InstallDataTransferPluginCommand) CommandName() string
- func (idtp *InstallDataTransferPluginCommand) Run() (err error)
- func (idtp *InstallDataTransferPluginCommand) ServerDetails() (*config.ServerDetails, error)
- func (idtp *InstallDataTransferPluginCommand) SetInstallVersion(installVersion *version.Version) *InstallDataTransferPluginCommand
- func (idtp *InstallDataTransferPluginCommand) SetJFrogHomePath(path string) *InstallDataTransferPluginCommand
- func (idtp *InstallDataTransferPluginCommand) SetLocalPluginFiles(localDir string) *InstallDataTransferPluginCommand
- type PluginFiles
- type PluginInstallManager
- type TransferAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFiles ¶
func CopyFiles(src string, pluginDir string, bundle PluginFiles) (err error)
Copy the plugin files from the given source to the target directory (create path if needed or override existing files)
func DownloadFiles ¶
func DownloadFiles(src string, pluginDir string, bundle PluginFiles) (err error)
Download the plugin files from the given url to the target directory (create path if needed or override existing files)
Types ¶
type FileItem ¶
type FileItem []string
Represents a path to file/directory We represent file 'dir/dir2/file' as FileItem{"dir", "dir2", "file"} We represent directory 'dir/dir2/' as FileItem{"dir", "dir2"}
func (*FileItem) Dirs ¶
Get the directory FileItem representation of the item, removing the last componenet and ignoring empty entries. i.e. for FileItem{"root", "", "dir", "file.ext"} -> FileItem{"root", "dir"}
func (*FileItem) Name ¶
Get the name (last) componenet of the item i.e. for FileItem{"root", "", "dir", "file.ext"} -> "file.ext"
func (*FileItem) SplitNameAndDirs ¶
Split and get the name and directory componenets of the item
type InstallDataTransferPluginCommand ¶
type InstallDataTransferPluginCommand struct {
// contains filtered or unexported fields
}
func NewInstallDataTransferCommand ¶
func NewInstallDataTransferCommand(server *config.ServerDetails) *InstallDataTransferPluginCommand
Create InstallDataTransferCommand
func (*InstallDataTransferPluginCommand) CommandName ¶
func (idtp *InstallDataTransferPluginCommand) CommandName() string
func (*InstallDataTransferPluginCommand) Run ¶
func (idtp *InstallDataTransferPluginCommand) Run() (err error)
func (*InstallDataTransferPluginCommand) ServerDetails ¶
func (idtp *InstallDataTransferPluginCommand) ServerDetails() (*config.ServerDetails, error)
func (*InstallDataTransferPluginCommand) SetInstallVersion ¶
func (idtp *InstallDataTransferPluginCommand) SetInstallVersion(installVersion *version.Version) *InstallDataTransferPluginCommand
Set the plugin version we want to download
func (*InstallDataTransferPluginCommand) SetJFrogHomePath ¶
func (idtp *InstallDataTransferPluginCommand) SetJFrogHomePath(path string) *InstallDataTransferPluginCommand
Set the Jfrog home directory path
func (*InstallDataTransferPluginCommand) SetLocalPluginFiles ¶
func (idtp *InstallDataTransferPluginCommand) SetLocalPluginFiles(localDir string) *InstallDataTransferPluginCommand
Set the local file system directory path that the plugin files will be copied from
type PluginInstallManager ¶
type PluginInstallManager struct {
// contains filtered or unexported fields
}
PluginInstallManager holds all the plugin files and optional plugin directory destinations. We construct the destination path by searching for the existing plugin directory destination from the options and joining the local path of the plugin file with the plugin directory
func NewArtifactoryPluginInstallManager ¶
func NewArtifactoryPluginInstallManager(bundle PluginFiles) *PluginInstallManager
Creates a new Artifactory plugin installation manager
type TransferAction ¶
type TransferAction func(src string, dst string, bundle PluginFiles) error
Transfers the file bundle from src to dst