Documentation ¶
Index ¶
- func PrepareCheckUpdate(roundTripper *mhttp.MockRoundTripper, rootURL, user, password string)
- func PrepareDownloadPlugin(roundTripper *mhttp.MockRoundTripper) (response *http.Response)
- func PrepareForChangeUpdateCenterSite(roundTripper *mhttp.MockRoundTripper, ...)
- func PrepareForOneInstalledPlugin(roundTripper *mhttp.MockRoundTripper, rootURL string) (request *http.Request, response *http.Response)
- func PrepareForOneInstalledPluginWithPluginName(roundTripper *mhttp.MockRoundTripper, rootURL, pluginName string) (request *http.Request, response *http.Response)
- func PrepareForOneInstalledPluginWithPluginNameAndVer(roundTripper *mhttp.MockRoundTripper, rootURL, pluginName, version string) (request *http.Request, response *http.Response)
- func PrepareForSetMirrorCertificate(roundTripper *mhttp.MockRoundTripper, rootURL, user, password string, ...)
- func PrepareOnePluginInfo(roundTripper *mhttp.MockRoundTripper, pluginName string)
- func PrepareOnePluginWithDep(roundTripper *mhttp.MockRoundTripper, pluginName string)
- func PrepareOnePluginWithOptionalDep(roundTripper *mhttp.MockRoundTripper, pluginName string)
- func PrepareShowPlugins(roundTripper *mhttp.MockRoundTripper, keyword string) (response *http.Response)
- func PrepareShowTrend(roundTripper *mhttp.MockRoundTripper, keyword string) (response *http.Response)
- type API
- type AvailablePlugin
- type AvailablePluginList
- type CenterPlugin
- type CenterSite
- type Dependency
- type Info
- type InfoStats
- type InstallStates
- type InstallStatesData
- type InstallStatesJob
- type InstallationInfo
- type InstallationJob
- type InstallationJobStatus
- type InstalledPlugin
- type InstalledPluginList
- type Manager
- func (p *Manager) CheckUpdate(handle func(*http.Response)) (err error)
- func (p *Manager) DownloadPluginWithVersion(nameWithVer string) error
- func (p *Manager) FindInstalledPlugin(name string) (targetPlugin *InstalledPlugin, err error)
- func (p *Manager) GetAvailablePlugins() (pluginList *AvailablePluginList, err error)
- func (p *Manager) GetPlugins(depth int) (pluginList *InstalledPluginList, err error)
- func (p *Manager) GetPluginsFormula(data interface{}) (err error)
- func (p *Manager) InstallPlugin(names []string) (err error)
- func (p *Manager) UninstallPlugin(name string) (err error)
- func (p *Manager) Upload(pluginFile string) (err error)
- type Plugin
- type Plugins
- type SecurityWarning
- type UpdateCenter
- type UpdateCenterJob
- type UpdateCenterManager
- func (u *UpdateCenterManager) ChangeUpdateCenterSite(name, updateCenterURL string) (err error)
- func (u *UpdateCenterManager) DownloadJenkins() (err error)
- func (u *UpdateCenterManager) GetJenkinsWarURL() (warURL string)
- func (u *UpdateCenterManager) GetSite() (site *CenterSite, err error)
- func (u *UpdateCenterManager) SetMirrorCertificate(enable bool) (err error)
- func (u *UpdateCenterManager) Status() (status *UpdateCenter, err error)
- func (u *UpdateCenterManager) Upgrade() (err error)
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrepareCheckUpdate ¶
func PrepareCheckUpdate(roundTripper *mhttp.MockRoundTripper, rootURL, user, password string)
PrepareCheckUpdate only for test
func PrepareDownloadPlugin ¶
func PrepareDownloadPlugin(roundTripper *mhttp.MockRoundTripper) (response *http.Response)
PrepareDownloadPlugin only for test
func PrepareForChangeUpdateCenterSite ¶
func PrepareForChangeUpdateCenterSite(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name, updateCenterURL string)
PrepareForChangeUpdateCenterSite only for test
func PrepareForOneInstalledPlugin ¶
func PrepareForOneInstalledPlugin(roundTripper *mhttp.MockRoundTripper, rootURL string) ( request *http.Request, response *http.Response)
PrepareForOneInstalledPlugin only for test
func PrepareForOneInstalledPluginWithPluginName ¶
func PrepareForOneInstalledPluginWithPluginName(roundTripper *mhttp.MockRoundTripper, rootURL, pluginName string) ( request *http.Request, response *http.Response)
PrepareForOneInstalledPluginWithPluginName only for test
func PrepareForOneInstalledPluginWithPluginNameAndVer ¶
func PrepareForOneInstalledPluginWithPluginNameAndVer(roundTripper *mhttp.MockRoundTripper, rootURL, pluginName, version string) ( request *http.Request, response *http.Response)
PrepareForOneInstalledPluginWithPluginNameAndVer only for test
func PrepareForSetMirrorCertificate ¶
func PrepareForSetMirrorCertificate(roundTripper *mhttp.MockRoundTripper, rootURL, user, password string, enable bool)
PrepareForSetMirrorCertificate only for test
func PrepareOnePluginInfo ¶
func PrepareOnePluginInfo(roundTripper *mhttp.MockRoundTripper, pluginName string)
PrepareOnePluginInfo only for test
func PrepareOnePluginWithDep ¶
func PrepareOnePluginWithDep(roundTripper *mhttp.MockRoundTripper, pluginName string)
PrepareOnePluginWithDep only for test
func PrepareOnePluginWithOptionalDep ¶
func PrepareOnePluginWithOptionalDep(roundTripper *mhttp.MockRoundTripper, pluginName string)
PrepareOnePluginWithOptionalDep only for test
func PrepareShowPlugins ¶
func PrepareShowPlugins(roundTripper *mhttp.MockRoundTripper, keyword string) ( response *http.Response)
PrepareShowPlugins only for test
func PrepareShowTrend ¶
func PrepareShowTrend(roundTripper *mhttp.MockRoundTripper, keyword string) ( response *http.Response)
PrepareShowTrend only for test
Types ¶
type API ¶
type API struct { SkipDependency bool SkipOptional bool UseMirror bool ShowProgress bool MirrorURL string DownloadDir string RoundTripper http.RoundTripper // contains filtered or unexported fields }
API represents a plugin API
func (*API) BatchSearchPlugins ¶
BatchSearchPlugins will batch search plugins
func (*API) DownloadPlugins ¶
DownloadPlugins will download those plugins from update center
type AvailablePlugin ¶
type AvailablePlugin struct { Plugin // for the available list Name string Installed bool Website string Title string }
AvailablePlugin represetns a available plugin
type AvailablePluginList ¶
type AvailablePluginList struct { Data []AvailablePlugin Status string }
AvailablePluginList represents a list of available plugins
type CenterPlugin ¶
type CenterPlugin struct { CompatibleWithInstalledVersion bool Excerpt string Installed InstalledPlugin MinimumJavaVersion string Name string RequiredCore string SourceID string Title string URL string Version string Wiki string }
CenterPlugin represents the all plugin from UpdateCenter
type CenterSite ¶
type CenterSite struct { AvailablesPlugins []CenterPlugin `json:"availables"` ConnectionCheckURL string `json:"connectionCheckUrl"` DataTimestamp int64 `json:"dataTimestamp"` HasUpdates bool `json:"hasUpdates"` ID string `json:"id"` UpdatePlugins []CenterPlugin `json:"updates"` URL string `json:"url"` }
CenterSite represents the site of update center
type Dependency ¶
type Dependency struct { Name string `json:"name"` Implied bool `json:"implied"` Optional bool `json:"optional"` Title string `json:"title"` Version string `json:"version"` ShortName string `json:"shortName"` }
Dependency represents a plugin dependency
type Info ¶
type Info struct { BuildDate string `json:"buildDate"` Dependencies []Dependency `json:"dependencies"` Excerpt string `json:"excerpt"` FirstRelease string `json:"firstRelease"` Gav string `json:"gav"` Name string `json:"name"` PreviousTimestamp string `json:"previousTimestamp"` PreviousVersion string `json:"previousVersion"` ReleaseTimestamp string `json:"releaseTimestamp"` RequireCore string `json:"RequireCore"` Title string `json:"title"` URL string `json:"url"` Version string `json:"version"` SecurityWarnings []SecurityWarning `json:"securityWarnings"` Stats InfoStats }
Info hold the info of a plugin
type InfoStats ¶
type InfoStats struct { CurrentInstalls int Installations []InstallationInfo InstallationsPerVersion []InstallationInfo InstallationsPercentage []InstallationInfo InstallationsPercentagePerVersion []InstallationInfo Trend int }
InfoStats is the plugin info stats
type InstallStates ¶
type InstallStates struct { Data InstallStatesData Status string }
InstallStates is the installation states
type InstallStatesData ¶
type InstallStatesData struct { Jobs InstallStatesJob State string }
InstallStatesData is the installation state data
type InstallStatesJob ¶
type InstallStatesJob struct { InstallStatus string Name string RequiresRestart string Title string Version string }
InstallStatesJob is the installation state job
type InstallationInfo ¶
InstallationInfo represents the plugin installation info
type InstallationJob ¶
type InstallationJob struct { UpdateCenterJob Name string Status InstallationJobStatus }
InstallationJob represents the installation job
type InstallationJobStatus ¶
InstallationJobStatus represents the installation job status
type InstalledPlugin ¶
type InstalledPlugin struct { Plugin Enable bool ShortName string LongName string Version string URL string HasUpdate bool Pinned bool RequiredCoreVesion string MinimumJavaVersion string SupportDynamicLoad string BackVersion string Dependencies []Dependency }
InstalledPlugin represent the installed plugin from Jenkins
type InstalledPluginList ¶
type InstalledPluginList struct {
Plugins []InstalledPlugin
}
InstalledPluginList represent a list of plugins
type Manager ¶
type Manager struct { core.JenkinsCore UseMirror bool MirrorURL string ShowProgress bool }
Manager is the client of plugin manager
func (*Manager) CheckUpdate ¶
CheckUpdate fetch the latest plugins from update center site
func (*Manager) DownloadPluginWithVersion ¶
DownloadPluginWithVersion downloads a plugin with name and version
func (*Manager) FindInstalledPlugin ¶
func (p *Manager) FindInstalledPlugin(name string) (targetPlugin *InstalledPlugin, err error)
FindInstalledPlugin find the exist plugin by name
func (*Manager) GetAvailablePlugins ¶
func (p *Manager) GetAvailablePlugins() (pluginList *AvailablePluginList, err error)
GetAvailablePlugins get the aviable plugins from Jenkins
func (*Manager) GetPlugins ¶
func (p *Manager) GetPlugins(depth int) (pluginList *InstalledPluginList, err error)
GetPlugins get installed plugins
func (*Manager) GetPluginsFormula ¶
GetPluginsFormula get the plugin list with Jenkins formula format
func (*Manager) InstallPlugin ¶
InstallPlugin install a plugin by name
func (*Manager) UninstallPlugin ¶
UninstallPlugin uninstall a plugin by name
type Plugins ¶
type Plugins struct { Limit int `json:"limit"` Page int `json:"page"` Pages int `json:"pages"` Total int `json:"total"` Plugins []Info `json:"plugins"` }
Plugins represents multi PluginInfo
type SecurityWarning ¶
SecurityWarning represents the plugin security-warining info
type UpdateCenter ¶
type UpdateCenter struct { Availables []Plugin Jobs []InstallationJob RestartRequiredForCompletion bool Sites []CenterSite }
UpdateCenter represents the update center of Jenkins
type UpdateCenterJob ¶
UpdateCenterJob represents the job for updateCenter which execute a task
type UpdateCenterManager ¶
type UpdateCenterManager struct { core.JenkinsCore MirrorSite string LTS bool Version string Output string Formula string Thread int ShowProgress bool }
UpdateCenterManager manages the UpdateCenter
func (*UpdateCenterManager) ChangeUpdateCenterSite ¶
func (u *UpdateCenterManager) ChangeUpdateCenterSite(name, updateCenterURL string) (err error)
ChangeUpdateCenterSite updates the update center address
func (*UpdateCenterManager) DownloadJenkins ¶
func (u *UpdateCenterManager) DownloadJenkins() (err error)
DownloadJenkins download Jenkins
func (*UpdateCenterManager) GetJenkinsWarURL ¶
func (u *UpdateCenterManager) GetJenkinsWarURL() (warURL string)
GetJenkinsWarURL returns a URL of Jenkins war file
func (*UpdateCenterManager) GetSite ¶
func (u *UpdateCenterManager) GetSite() (site *CenterSite, err error)
GetSite is get Available Plugins and Updated Plugins from UpdateCenter
func (*UpdateCenterManager) SetMirrorCertificate ¶
func (u *UpdateCenterManager) SetMirrorCertificate(enable bool) (err error)
SetMirrorCertificate take the mirror certificate file or not
func (*UpdateCenterManager) Status ¶
func (u *UpdateCenterManager) Status() (status *UpdateCenter, err error)
Status returns the status of Jenkins
func (*UpdateCenterManager) Upgrade ¶
func (u *UpdateCenterManager) Upgrade() (err error)
Upgrade the Jenkins core