jx: github.com/jenkins-x/jx/pkg/versionstream Index | Files | Directories

package versionstream

import "github.com/jenkins-x/jx/pkg/versionstream"


Package Files

resolver.go version_data.go


var (
    // Kinds all the version kinds
    Kinds = []VersionKind{

    // KindStrings all the kinds as strings for validating CLI arguments
    KindStrings = []string{

func GitURLToName Uses

func GitURLToName(name string) string

GitURLToName lets trim any URL scheme and trailing .git or / from a git URL

func LoadStableVersionNumber Uses

func LoadStableVersionNumber(wrkDir string, kind VersionKind, name string) (string, error)

LoadStableVersionNumber loads just the stable version number for the given kind and name

func NameFromPath Uses

func NameFromPath(basepath string, path string) (string, error)

NameFromPath converts a path into a name for use with stable versions

func ResolveDockerImage Uses

func ResolveDockerImage(versionsDir, image string) (string, error)

ResolveDockerImage resolves the version of the specified image against the version stream defined in versionsDir. If there is a version defined for the image in the version stream 'image:<version>' is returned, otherwise the passed image name is returned as is.

func SaveQuickStarts Uses

func SaveQuickStarts(dir string, qs *QuickStarts) error

SaveQuickStarts saves the modified quickstarts in the version stream dir

func SaveStableVersion Uses

func SaveStableVersion(wrkDir string, kind VersionKind, name string, stableVersion *StableVersion) error

SaveStableVersion saves the version file

func SaveStableVersionFile Uses

func SaveStableVersionFile(path string, stableVersion *StableVersion) error

SaveStableVersionFile saves the stabe version to the given file name

func UpdateStableVersion Uses

func UpdateStableVersion(dir string, kindStr string, name string, version string) ([]string, error)

UpdateStableVersion applies an update to the stable version file in dir/kindStr/name.yml, updating to version

func UpdateStableVersionFiles Uses

func UpdateStableVersionFiles(globPattern string, version string, excludeFiles ...string) ([]string, error)

UpdateStableVersionFiles applies an update to the stable version files matched by globPattern, updating to version

type Callback Uses

type Callback func(kind VersionKind, name string, version *StableVersion) (bool, error)

Callback a callback function for processing version information. Return true to continue processing or false to terminate the loop

type QuickStart Uses

type QuickStart struct {
    ID             string   `json:"id,omitempty"`
    Owner          string   `json:"owner,omitempty"`
    Name           string   `json:"name,omitempty"`
    Version        string   `json:"version,omitempty"`
    Language       string   `json:"language,omitempty"`
    Framework      string   `json:"framework,omitempty"`
    Tags           []string `json:"tags,omitempty"`
    DownloadZipURL string   `json:"downloadZipURL,omitempty"`

QuickStart the configuration of a quickstart in the version stream

type QuickStarts Uses

type QuickStarts struct {
    QuickStarts  []*QuickStart `json:"quickstarts"`
    DefaultOwner string        `json:"defaultOwner"`

QuickStarts the configuration of a the quickstarts in the version stream

func GetQuickStarts Uses

func GetQuickStarts(dir string) (*QuickStarts, error)

GetQuickStarts loads the quickstarts from the version stream

func (*QuickStarts) DefaultMissingValues Uses

func (qs *QuickStarts) DefaultMissingValues()

DefaultMissingValues defaults any missing values such as ID which is a combination of owner and name

func (*QuickStarts) Sort Uses

func (qs *QuickStarts) Sort()

Sort sorts the quickstarts into name order

type RepositoryPrefixes Uses

type RepositoryPrefixes struct {
    Repositories []RepositoryURLs `json:"repositories"`
    // contains filtered or unexported fields

RepositoryPrefixes maps repository prefixes to URLs

func GetRepositoryPrefixes Uses

func GetRepositoryPrefixes(dir string) (*RepositoryPrefixes, error)

GetRepositoryPrefixes loads the repository prefixes for the version stream

func (*RepositoryPrefixes) PrefixForURL Uses

func (p *RepositoryPrefixes) PrefixForURL(u string) string

PrefixForURL returns the repository prefix for the given URL

func (*RepositoryPrefixes) URLsForPrefix Uses

func (p *RepositoryPrefixes) URLsForPrefix(prefix string) []string

URLsForPrefix returns the repository URLs for the given prefix

type RepositoryURLs Uses

type RepositoryURLs struct {
    Prefix string   `json:"prefix"`
    URLs   []string `json:"urls"`

RepositoryURLs contains the prefix and URLS for a repository

type StableVersion Uses

type StableVersion struct {
    // Version the default version to use
    Version string `json:"version,omitempty"`

    // e.g. for packages we could use: `{ version: "1.10.1", upperLimit: "1.14.0"}` which would mean these
    // versions are all valid `["1.11.5", "1.13.1234"]` but these are invalid `["1.14.0", "1.14.1"]`
    UpperLimit string `json:"upperLimit,omitempty"`
    // GitURL the URL to the source code
    GitURL string `json:"gitUrl,omitempty"`
    // Component is the component inside the git URL
    Component string `json:"component,omitempty"`
    // URL the URL for the documentation
    URL string `json:"url,omitempty"`

StableVersion stores the stable version information

func LoadStableVersion Uses

func LoadStableVersion(wrkDir string, kind VersionKind, name string) (*StableVersion, error)

LoadStableVersion loads the stable version data from the version configuration directory returning an empty object if there is no specific stable version configuration available

func LoadStableVersionFile Uses

func LoadStableVersionFile(path string) (*StableVersion, error)

LoadStableVersionFile loads the stable version data from the given file name

func LoadStableVersionFromData Uses

func LoadStableVersionFromData(data []byte) (*StableVersion, error)

LoadStableVersionFromData loads the stable version data from the given the data

func (*StableVersion) VerifyPackage Uses

func (data *StableVersion) VerifyPackage(name string, currentVersion string, workDir string) error

VerifyPackage verifies the current version of the package is valid

type VersionKind Uses

type VersionKind string

VersionKind represents the kind of version

const (
    // KindChart represents a chart version
    KindChart VersionKind = "charts"

    // KindPackage represents a package version
    KindPackage VersionKind = "packages"

    // KindDocker represents a docker resolveImage version
    KindDocker VersionKind = "docker"

    // KindGit represents a git repository (e.g. for jx boot configuration or a build pack)
    KindGit VersionKind = "git"

type VersionResolver Uses

type VersionResolver struct {
    VersionsDir string

VersionResolver resolves versions of charts, packages or docker images

func (*VersionResolver) GetRepositoryPrefixes Uses

func (v *VersionResolver) GetRepositoryPrefixes() (*RepositoryPrefixes, error)

GetRepositoryPrefixes loads the repository prefixes for the version stream

func (*VersionResolver) ResolveDockerImage Uses

func (v *VersionResolver) ResolveDockerImage(image string) (string, error)

ResolveDockerImage ensures the given docker image has a valid version if there is one in the version stream

func (*VersionResolver) ResolveGitVersion Uses

func (v *VersionResolver) ResolveGitVersion(gitURL string) (string, error)

ResolveGitVersion resolves the version to use for the given git repository using the version stream

func (*VersionResolver) StableVersion Uses

func (v *VersionResolver) StableVersion(kind VersionKind, name string) (*StableVersion, error)

StableVersion returns the stable version of the given kind name

func (*VersionResolver) StableVersionNumber Uses

func (v *VersionResolver) StableVersionNumber(kind VersionKind, name string) (string, error)

StableVersionNumber returns the stable version number of the given kind name

func (*VersionResolver) VerifyPackage Uses

func (v *VersionResolver) VerifyPackage(name string, currentVersion string) error

VerifyPackage verifies the package is of a sufficient version

func (*VersionResolver) VerifyPackages Uses

func (v *VersionResolver) VerifyPackages(packages map[string]string) error

VerifyPackages verifies that the package keys and current version numbers are at the required minimum versions



Package versionstream imports 13 packages (graph) and is imported by 8 packages. Updated 2020-06-03. Refresh now. Tools for package owners.