coremgt

package
v0.0.0-...-78d25bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2021 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JenkinsRepoURL     = "https://updates.jenkins.io"
	JenkinsRepoVersion = "current"
	JenkinsRepoFile    = "update-center.actual.json"
	JenkinsHistoryFile = "plugin-versions.json" // TODO: Use this to load it so we can identify better version from constraints.
	JenkinsPluginRepo  = "download/plugins"
)

Variables

This section is empty.

Functions

func CheckElement

func CheckElement(fields []string, split func(string, string, string))

CheckElement call split function and ensure a type and a name are given.

func IsUpdated

func IsUpdated(p pluginJson) (_ bool)

IsNewer return true if the element identify a newer version

Types

type Element

type Element interface {
	GetVersion() (ret VersionStruct, err error)
	SetFrom(fields ...string) (err error)
	GetType() string
	Name() string
	ChainElement(context *ElementsType) (*ElementsType, error)
	//GetElementsFromRepo(func (name string) (*Elements, error))
	Merge(context *ElementsType, element Element, policy int) (updated bool, err error)
	CompleteFromContext(context *ElementsType) (err error)
	String() string
	IsFixed() bool
	GetParents() Elements

	GetDependencies() Elements
	GetDependenciesFromContext(context *ElementsType) Elements
	AddDependencyTo(element Element)
	RemoveDependencyTo(element Element)

	SetVersionConstraintFromDepConstraint(context *ElementsType, element Element) error
	IsVersionCandidate(version *goversion.Version) bool
	DefineLatestPossibleVersion(context *ElementsType) (_ error)

	AsNewPluginsStatusDetails(context *ElementsType) (sd *pluginsStatusDetails)
	AsNewGrooviesStatusDetails(context *ElementsType) (sd *GroovyStatusDetails)
}

Element is an interface on Plugin/Groovy/Feature object

func NewElement

func NewElement(elementType string) (_ Element)

NewElement to create a known new element type

type ElementManifest

type ElementManifest struct {
	Version        string `yaml:"Plugin-Version"`
	Name           string `yaml:"Extension-Name"`
	ShortName      string `yaml:"Short-Name"`
	JenkinsVersion string `yaml:"Jenkins-Version"`
	LongName       string `yaml:"Long-Name"`
	Dependencies   string `yaml:"Plugin-Dependencies"`
	Description    string `yaml:"Specification-Title"`
	// contains filtered or unexported fields
}

ElementManifest describe details on elements. By default, it helps reading the MANIFEST.MF from java as a yaml file, clenaed before.

func ExtractFeature

func ExtractFeature(pluginRecord []string) (index string, pluginData *ElementManifest)

func ExtractGroovy

func ExtractGroovy(pluginRecord []string) (index string, pluginData *ElementManifest)

func ExtractPlugin

func ExtractPlugin(pluginRecord []string) (index string, pluginData *ElementManifest)

func NewElementManifest

func NewElementManifest(typ, name string) (ret *ElementManifest)

NewElementManifest return a element manifest with details

func (*ElementManifest) GetVersion

func (e *ElementManifest) GetVersion() (ret VersionStruct, err error)

type Elements

type Elements map[string]Element

Elements represents the list of Elements (plugins, features, etc...)

func (Elements) DisplayDependencies

func (l Elements) DisplayDependencies()

DisplayDependencies display the list of dependencies of that element.

type ElementsType

type ElementsType struct {
	// contains filtered or unexported fields
}

ElementsType is collections of Plugins

func NewElementsType

func NewElementsType() (ret *ElementsType)

NewElementsType creates the collection of plugins

func (*ElementsType) Add

func (e *ElementsType) Add(fields ...string) (_ Element, err error)

Add a new element to a collection type.

func (*ElementsType) AddElement

func (e *ElementsType) AddElement(element Element) (ret Element, err error)

AddElement the new element to the collection, then add their dependencies if noDeps is false.

func (*ElementsType) AddSupport

func (e *ElementsType) AddSupport(elementTypes ...string)

AddSupport register a set function for a data type given

func (*ElementsType) AddSupportContext

func (e *ElementsType) AddSupportContext(elementType, key, value string)

AddSupport register a set function for a data type given

func (*ElementsType) Compare

func (e *ElementsType) Compare(newList *ElementsType) (compare *PluginsStatus, err error)

Compare the current list of plugins with the newList given if the list has *Repository reference, the status will gave the latest boolean value.

func (*ElementsType) DeleteElement

func (e *ElementsType) DeleteElement(element Element)

DeleteElement remove the element from the list and cleanup dependencies

func (*ElementsType) DeterminePluginsVersion

func (e *ElementsType) DeterminePluginsVersion(ref *Repository) (updates *PluginsStatus, _ error)

DeterminePluginsVersion apply the updates repository ref to the list of plugins to set proper version of plugins from rules Rules can change and a rule validation will be executed at the end of the process

func (*ElementsType) ExtractTopElements

func (e *ElementsType) ExtractTopElements() (identified *ElementsType)

ExtractTopElements identifies top plugins (remove all dependencies)

func (*ElementsType) GetElement

func (e *ElementsType) GetElement(elementType, name string) (_ Element)

GetElement return the collection type requested.

func (*ElementsType) GetElements

func (e *ElementsType) GetElements(elementType string) (_ Elements)

GetElements return the collection type requested.

func (*ElementsType) GetRepoPlugin

func (e *ElementsType) GetRepoPlugin(props ...string) (ret Element)

GetRepoPlugin return a plugin information from the updates repository

func (*ElementsType) Length

func (e *ElementsType) Length() (total int)

Length the list of plugins as Simple format

func (*ElementsType) PrintOut

func (e *ElementsType) PrintOut(printDetails func(element Element))

PrintOut loop on plugins to display them

func (*ElementsType) Read

func (e *ElementsType) Read(file string, cols int) (err error)

Read the file given

func (*ElementsType) RefreshDependencies

func (e *ElementsType) RefreshDependencies(curElement, newElement Element)

RefreshDependencies refresh Dependencies between old element list and new element list

func (*ElementsType) Remove

func (e *ElementsType) Remove(elementType, name string)

Remove a named element type.

func (*ElementsType) SetFeaturesPath

func (e *ElementsType) SetFeaturesPath(repoPath string) error

SetFeaturesPath defines where a features repository is located like `jenkins-install-inits`

func (*ElementsType) SetFeaturesRepoURL

func (e *ElementsType) SetFeaturesRepoURL(repoURL string) error

SetFeaturesRepoURL validate and store the repoURL It can be executed several times to store multiple URLs

func (*ElementsType) SetLocal

func (e *ElementsType) SetLocal()

SetLocal set the useLocal to true When set to true, jplugin do not clone a remote repo URL to store on cache

func (*ElementsType) SetRepository

func (e *ElementsType) SetRepository(ref *Repository)

SetRepository set a Repository object to the Elementstype object.

func (*ElementsType) UpdateElement

func (e *ElementsType) UpdateElement(curElement, newElement Element) (updated bool, err error)

UpdateElement the new element to the collection, then add their dependencies if noDeps is false.

func (*ElementsType) WriteSimple

func (e *ElementsType) WriteSimple(file string, cols int) (err error)

WriteSimple the list of plugins as Simple format

type Feature

type Feature struct {
	Version string
	// contains filtered or unexported fields
}

Feature describe details on Feature.

func NewFeature

func NewFeature() (ret *Feature)

NewFeature return a feature object

func (*Feature) AddDependencyTo

func (p *Feature) AddDependencyTo(depElement Element)

func (*Feature) AsNewGrooviesStatusDetails

func (p *Feature) AsNewGrooviesStatusDetails(context *ElementsType) (sd *GroovyStatusDetails)

func (*Feature) AsNewPluginsStatusDetails

func (p *Feature) AsNewPluginsStatusDetails(context *ElementsType) (sd *pluginsStatusDetails)

func (*Feature) ChainElement

func (p *Feature) ChainElement(context *ElementsType) (ret *ElementsType, _ error)

ChainElement load the feature details (groovy and plugins)

func (*Feature) CompleteFromContext

func (p *Feature) CompleteFromContext(_ *ElementsType) (_ error)

CompleteFromContext nothing to complete.

func (*Feature) DefineLatestPossibleVersion

func (p *Feature) DefineLatestPossibleVersion(context *ElementsType) (_ error)

func (*Feature) GetDependencies

func (p *Feature) GetDependencies() (_ Elements)

GetDependencies return the list of features depedencies required by this feature.

func (*Feature) GetDependenciesFromContext

func (p *Feature) GetDependenciesFromContext(*ElementsType) (_ Elements)

GetDependenciesFromContext return the list of features depedencies required by this feature.

func (*Feature) GetParents

func (p *Feature) GetParents() (_ Elements)

GetParents return the list of features which depends on this feature.

func (*Feature) GetType

func (p *Feature) GetType() string

GetType return the internal type string

func (*Feature) GetVersion

func (p *Feature) GetVersion() (_ VersionStruct, _ error)

GetVersion return the plugin Version struct.

func (*Feature) IsFixed

func (p *Feature) IsFixed() (_ bool)

IsFixed indicates if the plugin version is fixed.

func (*Feature) IsVersionCandidate

func (p *Feature) IsVersionCandidate(version *goversion.Version) bool

IsVersionCandidate return true systematically

func (*Feature) Merge

func (p *Feature) Merge(_ *ElementsType, _ Element, _ int) (_ bool, _ error)

Merge execute a merge between 2 features and keep the one corresponding to the constraint given It is based on 3 policies: choose oldest, keep existing and choose newest

func (*Feature) Name

func (p *Feature) Name() string

Name return the Name property

func (*Feature) RemoveDependencyTo

func (p *Feature) RemoveDependencyTo(depElement Element)

func (*Feature) SetFrom

func (p *Feature) SetFrom(fields ...string) (err error)

SetFrom set data from an array of fields

func (*Feature) SetVersionConstraintFromDepConstraint

func (p *Feature) SetVersionConstraintFromDepConstraint(*ElementsType, Element) (_ error)

SetVersionConstraintFromDepConstraint add a constraint to match the dependency version constraints

func (*Feature) String

func (p *Feature) String() string

String return the string representation of the plugin

type Groovy

type Groovy struct {
	Version string

	ShortName    string
	Dependencies string
	Description  string
	CommitID     string
	Md5          string
	// contains filtered or unexported fields
}

Groovy describe details on Groovy.

func NewGroovy

func NewGroovy() (ret *Groovy)

NewGroovy return a Groovy object

func (*Groovy) AddDependencyTo

func (p *Groovy) AddDependencyTo(depElement Element)

func (*Groovy) AsNewGrooviesStatusDetails

func (p *Groovy) AsNewGrooviesStatusDetails(context *ElementsType) (sd *GroovyStatusDetails)

AsNewGrooviesStatusDetails add the current groovy as a NEW groovy in statusDetails

func (*Groovy) AsNewPluginsStatusDetails

func (p *Groovy) AsNewPluginsStatusDetails(context *ElementsType) (sd *pluginsStatusDetails)

AsNewPluginsStatusDetails to be replaced by a renamed version.

func (*Groovy) ChainElement

func (p *Groovy) ChainElement(*ElementsType) (_ *ElementsType, _ error)

ChainElement do nothing for a Groovy object

func (*Groovy) CompleteFromContext

func (p *Groovy) CompleteFromContext(context *ElementsType) (err error)

CompleteFromContext nothing to complete.

func (*Groovy) DefineLatestPossibleVersion

func (p *Groovy) DefineLatestPossibleVersion(context *ElementsType) (_ error)

func (*Groovy) GetDependencies

func (p *Groovy) GetDependencies() (_ Elements)

GetDependencies return the list of features depedencies required by this feature.

func (*Groovy) GetDependenciesFromContext

func (p *Groovy) GetDependenciesFromContext(*ElementsType) (_ Elements)

GetDependenciesFromContext return the list of features depedencies required by this feature.

func (*Groovy) GetParents

func (p *Groovy) GetParents() (_ Elements)

GetParents return the list of features which depends on this feature.

func (*Groovy) GetType

func (p *Groovy) GetType() string

GetType return the internal type string

func (*Groovy) GetVersion

func (p *Groovy) GetVersion() (_ VersionStruct, _ error)

GetVersion return the plugin Version struct.

func (*Groovy) IsFixed

func (p *Groovy) IsFixed() (_ bool)

IsFixed indicates if the groovy version is fixed.

func (*Groovy) IsVersionCandidate

func (p *Groovy) IsVersionCandidate(version *goversion.Version) bool

IsVersionCandidate return true systematically

func (*Groovy) Merge

func (p *Groovy) Merge(_ *ElementsType, _ Element, _ int) (_ bool, _ error)

Merge execute a merge between 2 groovies and keep the one corresponding to the constraint given It is based on 3 policies: choose oldest, keep existing and choose newest

func (*Groovy) Name

func (p *Groovy) Name() string

Name return the Name property

func (*Groovy) RemoveDependencyTo

func (p *Groovy) RemoveDependencyTo(depElement Element)

func (*Groovy) SetFrom

func (p *Groovy) SetFrom(fields ...string) (err error)

SetFrom set data from an array of fields

func (*Groovy) SetVersionConstraintFromDepConstraint

func (p *Groovy) SetVersionConstraintFromDepConstraint(*ElementsType, Element) (_ error)

SetVersionConstraintFromDepConstraint add a constraint to match the dependency version constraints

func (*Groovy) String

func (p *Groovy) String() string

String return the string representation of the plugin

type GroovyStatusDetails

type GroovyStatusDetails struct {
	// contains filtered or unexported fields
}

GroovyStatusDetails contains groovy update status

type JenkinsHome

type JenkinsHome struct {
	// contains filtered or unexported fields
}

JenkinsHome represents the Jenkins home where we install or identify plugins

func NewJenkinsHome

func NewJenkinsHome(jenkinsHomePath string) (ret *JenkinsHome)

NewJenkinsHome creates a new JenkinsHome object

func (*JenkinsHome) GetPlugins

func (j *JenkinsHome) GetPlugins() (elements *ElementsType, _ error)

GetPlugins read the list of plugins in Jenkins and load them in a Plugins object

func (*JenkinsHome) Install

func (j *JenkinsHome) Install(elements *ElementsType, featureRepoPath string) error

Install execute an installation of plugins/groovies to the right path.

func (*JenkinsHome) IsValid

func (j *JenkinsHome) IsValid() bool

IsValid is true if Jenkins home and sub

type Plugin

type Plugin struct {
	Version        string `yaml:"Plugin-Version"`
	ExtensionName  string `yaml:"Extension-Name"`
	ShortName      string `yaml:"Short-Name"`
	JenkinsVersion string `yaml:"Jenkins-Version"`
	LongName       string `yaml:"Long-Name"`
	Dependencies   string `yaml:"Plugin-Dependencies"`
	Description    string `yaml:"Specification-Title"`
	// contains filtered or unexported fields
}

Plugin describe details on Plugin element. By default, it helps reading the MANIFEST.MF from java as a yaml file, cleaned before.

func NewPlugin

func NewPlugin() (ret *Plugin)

NewPlugin return a plugin object

func (*Plugin) AddDependencyTo

func (p *Plugin) AddDependencyTo(depElement Element)

AddDependencyTo creates the bi-directionnel dependency

func (*Plugin) AsNewGrooviesStatusDetails

func (p *Plugin) AsNewGrooviesStatusDetails(context *ElementsType) (sd *GroovyStatusDetails)

AsNewGrooviesStatusDetails to be removed.

func (*Plugin) AsNewPluginsStatusDetails

func (p *Plugin) AsNewPluginsStatusDetails(context *ElementsType) (sd *pluginsStatusDetails)

AsNewPluginsStatusDetails return a PluginsStatusDetails object from this plugin, considered as new.

func (*Plugin) ChainElement

func (p *Plugin) ChainElement(context *ElementsType) (ret *ElementsType, _ error)

ChainElement load plugins dependency tree from the repo

The constraint is added as expected, but the version is the highest possible. (latest)

func (*Plugin) CompleteFromContext

func (p *Plugin) CompleteFromContext(context *ElementsType) (err error)

CompleteFromContext update the plugin information from repo DB if found

func (*Plugin) DefineLatestPossibleVersion

func (p *Plugin) DefineLatestPossibleVersion(context *ElementsType) (_ error)

DefineLatestPossibleVersion check on version history which latest version is possible from version rules given.

func (*Plugin) GetDependencies

func (p *Plugin) GetDependencies() Elements

GetDependencies return the list of plugins depedencies required by this plugin.

func (*Plugin) GetDependenciesFromContext

func (p *Plugin) GetDependenciesFromContext(context *ElementsType) Elements

GetDependenciesFromContext return the list of plugins depedencies required by this plugin. Required when elements were simply listed by ChainElements to update their dependencies

func (*Plugin) GetParents

func (p *Plugin) GetParents() Elements

GetParents return the list of plugins which depends on this plugin.

func (*Plugin) GetType

func (p *Plugin) GetType() string

GetType return the internal type string

func (*Plugin) GetVersion

func (p *Plugin) GetVersion() (ret VersionStruct, err error)

GetVersion return the plugin Version struct.

func (*Plugin) GetVersionString

func (p *Plugin) GetVersionString() string

GetVersionString return the plugin value as string.

func (*Plugin) IsFixed

func (p *Plugin) IsFixed() (_ bool)

IsFixed indicates if the plugin version is fixed.

func (*Plugin) IsVersionCandidate

func (p *Plugin) IsVersionCandidate(version *goversion.Version) bool

IsVersionCandidate return true if version given respect the rule

func (*Plugin) Merge

func (p *Plugin) Merge(context *ElementsType, element Element, policy int) (updated bool, err error)

Merge execute a merge between 2 plugins and keep the one corresponding to the constraint given It is based on 3 policies: choose oldest, keep existing and choose newest

func (*Plugin) Name

func (p *Plugin) Name() string

Name return the Name property

func (*Plugin) RemoveDependencyTo

func (p *Plugin) RemoveDependencyTo(depElement Element)

RemoveDependencyTo remove a bi-directionnel dependency

func (*Plugin) SetFrom

func (p *Plugin) SetFrom(fields ...string) (err error)

SetFrom set data from an array of fields If the version is given, it will be interpreted as a constraint

func (*Plugin) SetVersionConstraintFromDepConstraint

func (p *Plugin) SetVersionConstraintFromDepConstraint(context *ElementsType, depElement Element) (err error)

SetVersionConstraintFromDepConstraint add a constraint to match the dependency version constraints on plugins parent dependencies

This function check parent plugin of the dependency given to change version constraint if needed.

func (*Plugin) String

func (p *Plugin) String() string

String return the string representation of the plugin

type Plugins

type Plugins struct {
	// contains filtered or unexported fields
}

Plugins contains a collection of plugins manifest. (see ElementManifest)

func NewPlugins

func NewPlugins() (ret *Plugins)

NewPlugins creates a Plugins struct

func (*Plugins) Add

func (p *Plugins) Add(fields ...string) (_ error)

func (*Plugins) AddSupport

func (p *Plugins) AddSupport(name string, set func(data []string) (string, *ElementManifest))

AddSupport register a set function for a data type given

func (*Plugins) AddSupportGroovy

func (p *Plugins) AddSupportGroovy()

AddSupportGroovy define how groovy type data is extracted

func (*Plugins) AddSupportPlugin

func (p *Plugins) AddSupportPlugin(repoGet func(name string) (*RepositoryPlugin, bool))

AddSupportPlugin define how plugin type data is extracted.

func (*Plugins) ExtractTopElements

func (p *Plugins) ExtractTopElements() (identified *Plugins)

ExtractTopElements identifies top plugins (remove all dependencies)

func (*Plugins) Length

func (p *Plugins) Length() (_ int)

Length returns the number of plugins list

func (*Plugins) PrintOut

func (p *Plugins) PrintOut(printDetails func(element *ElementManifest))

PrintOut loop on plugins to display them

func (*Plugins) Read

func (p *Plugins) Read(file string, cols int) (err error)

Read the file given

func (*Plugins) WriteSimple

func (p *Plugins) WriteSimple(file string, cols int) (err error)

WriteSimple the list of plugins as Simple format

type PluginsExport

type PluginsExport struct {
	// contains filtered or unexported fields
}

func NewPluginsExport

func NewPluginsExport(exportFile, templateFile string, size int) (ret *PluginsExport)

func (*PluginsExport) DoItOn

func (e *PluginsExport) DoItOn(list *PluginsStatus) (err error)

type PluginsStatus

type PluginsStatus struct {
	PluginsStatus map[string]*pluginsStatusDetails
	// contains filtered or unexported fields
}

PluginsStatus represents the jenkins update status

func NewPluginsStatus

func NewPluginsStatus(installed *ElementsType, ref *Repository) (pluginsCompared *PluginsStatus)

NewPluginsStatus creates an a plugin update status with a Ref repository

func (*PluginsStatus) AddElement

func (s *PluginsStatus) AddElement(element Element, old bool) (err error)

AddElement register an element version (plugin or groovy) as an old or new element

TODO: replace switch by Element interface.

func (*PluginsStatus) AddGroovyStatus

func (s *PluginsStatus) AddGroovyStatus(groovy *Groovy, old bool) (_ error)

AddGroovyStatus register the groovy commitID as an old or new groovy commit

TODO: replace switch by Element interface.

func (*PluginsStatus) AddPluginStatus

func (s *PluginsStatus) AddPluginStatus(plugin *Plugin, old bool) (_ error)

AddPluginStatus register the plugin version as an old or new plugin

TODO: replace switch by Element interface.

func (*PluginsStatus) CheckElementLine

func (s *PluginsStatus) CheckElementLine(line string, split func(string, string, string))

CheckElementLine analyzes a line and split with the split function.

func (*PluginsStatus) CheckFeature

func (s *PluginsStatus) CheckFeature(name string) (_ error)

func (*PluginsStatus) CheckGroovy

func (s *PluginsStatus) CheckGroovy(name, groovyPath string) error

func (*PluginsStatus) CheckMinDep

func (s *PluginsStatus) CheckMinDep() (_ bool)

func (*PluginsStatus) CheckPlugin

func (s *PluginsStatus) CheckPlugin(name, versionConstraints string, parentDependency *pluginsStatusDetails) error

func (*PluginsStatus) Compare

func (s *PluginsStatus) Compare() (_ error)

Compare only plugins against repository. TODO: Compare groovies

func (*PluginsStatus) DefinePluginsVersion

func (s *PluginsStatus) DefinePluginsVersion() (_ bool)

DefinePluginsVersion will apply latest version of each plugin except if jplugins.lst or *.desc apply a constraints

func (*PluginsStatus) DisplayUpdates

func (s *PluginsStatus) DisplayUpdates() (_ bool)

DisplayUpdates show updates as result

func (*PluginsStatus) ImportInstalled

func (s *PluginsStatus) ImportInstalled(elements *ElementsType)

ImportInstalled import a list of plugins considered as pre-installed It stores the list of plugins and constraints '>=' in the structure, so those plugins are installed at minimum to that list.

func (*PluginsStatus) NewInstall

func (s *PluginsStatus) NewInstall()

NewInstall consider the installed list as newly installed. So, the display updates will display it all when we newly install it.

func (*PluginsStatus) PluginsLength

func (s *PluginsStatus) PluginsLength() int

PluginsLength return the number of plugins candidate for updates

func (*PluginsStatus) SetFeaturesPath

func (s *PluginsStatus) SetFeaturesPath(repoPath string) error

SetFeaturesPath defines where a features repository is located like `jenkins-install-inits`

func (*PluginsStatus) SetFeaturesRepoURL

func (s *PluginsStatus) SetFeaturesRepoURL(repoURL string) error

SetFeaturesRepoURL validate and store the repoURL It can be executed several times to store multiple URLs

func (*PluginsStatus) SetLocal

func (s *PluginsStatus) SetLocal()

SetLocal set the useLocal to true When set to true, jplugin do not clone a remote repo URL to store on cache

func (*PluginsStatus) WriteSimple

func (s *PluginsStatus) WriteSimple(file string) (err error)

WriteSimple write list of plugins and groovies in a simple file format.

type Repository

type Repository struct {
	RepositoryPlugins // Loaded from json with LoadFromURL and JenkinsRepoFile
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository() (ret *Repository)

func (*Repository) Compare

func (r *Repository) Compare(elements *ElementsType) (updates *PluginsStatus)

Compare creates a PluginsStatus which store old and new version of each elements.

func (*Repository) Get

func (r *Repository) Get(pluginRequested ...string) (plugin *RepositoryPlugin, found bool)

Get return the plugin requested (name with or without version) as described by Jenkins updates.

If the version is defined but not found, it will return the closest higher version matching this unknown version

func (*Repository) GetOrderedVersions

func (r *Repository) GetOrderedVersions(name string) (ret goversion.Collection)

GetOrderedVersions return the list of a plugin version for a given plugin ordered from latest to oldest.

func (*Repository) GetVersions

func (r *Repository) GetVersions(name string) (_ map[string]*RepositoryPlugin)

GetVersions return the list of a plugin version for a given plugin

func (*Repository) LoadFromURL

func (r *Repository) LoadFromURL() (_ bool)

LoadFromURL read an URL file containing the Jenkins updates repository data as json.

type RepositoryDependencies

type RepositoryDependencies []RepositoryDependency

RepositoryDependencies is a array of dependencies

func (RepositoryDependencies) GetVersion

func (r RepositoryDependencies) GetVersion(name string) *goversion.Version

GetVersion return the dependency version of a given plugin name.

type RepositoryDependency

type RepositoryDependency struct {
	Name     string
	Optional bool
	Version  string
}

type RepositoryPlugin

type RepositoryPlugin struct {
	Dependencies   RepositoryDependencies
	Name           string
	Version        string
	Title          string
	Description    string `json:"excerpt"`
	JenkinsVersion string `json:"requiredCore"`
	Sha256Version  string `json:"sha256"`
	// contains filtered or unexported fields
}

RepositoryPlugin define the plugin from the referenced repository

func (*RepositoryPlugin) DetermineVersion

func (p *RepositoryPlugin) DetermineVersion(plugin *pluginsStatusDetails) (version VersionStruct, latest bool, err error)

DetermineVersion select the appropriate version of a plugin depending on constraints.

func (*RepositoryPlugin) GetVersion

func (p *RepositoryPlugin) GetVersion() (ret VersionStruct, err error)

GetVersion returns a version struct of the plugin.

type RepositoryPlugins

type RepositoryPlugins struct {
	Plugins map[string]*RepositoryPlugin
}

type RepositoryPluginsHistory

type RepositoryPluginsHistory struct {
	Plugins map[string]map[string]*RepositoryPlugin
}

RepositoryHistory is the plugin-versions.json data representation

type VersionStruct

type VersionStruct struct {
	// contains filtered or unexported fields
}

func (VersionStruct) Get

func (v VersionStruct) Get() (ret *goversion.Version)

func (*VersionStruct) Set

func (v *VersionStruct) Set(value string) (err error)

func (VersionStruct) String

func (v VersionStruct) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL