bundle

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Release

type Release []bsemver.PRVersion

func NewRelease

func NewRelease(relStr string) (Release, error)

NewRelease parses a release string into a Release. The release string should be a dot-separated sequence of non-empty identifiers, where each identifier contains only ASCII alphanumerics and hyphens [0-9A-Za-z-]. Numeric identifiers (those containing only digits) must not have leading zeros. An empty string returns a nil Release. Returns an error if any segment is invalid.

func (Release) Compare

func (r Release) Compare(other Release) int

Compare compares two Release values. It returns:

-1 if r < other
 0 if r == other
+1 if r > other

Comparison is done segment by segment from left to right. Numeric segments are compared numerically, and alphanumeric segments are compared lexically in ASCII sort order. A shorter release is considered less than a longer release if all corresponding segments are equal.

type VersionRelease

type VersionRelease struct {
	Version bsemver.Version
	Release Release
}

func NewLegacyRegistryV1VersionRelease

func NewLegacyRegistryV1VersionRelease(vStr string) (*VersionRelease, error)

NewLegacyRegistryV1VersionRelease parses a registry+v1 bundle version string and returns a VersionRelease. Some registry+v1 bundles utilize the build metadata field of the semver version as release information (a semver spec violation maintained for backward compatibility). When the bundle version includes build metadata that is parsable as a release, the returned VersionRelease has the build metadata extracted into the Release field, and the Version field has its Build metadata cleared. When the bundle version includes build metadata that is NOT parseable as a release, the returned VersionRelease has its Version set to the full semver version (with build metadata) and its Release left empty.

func (*VersionRelease) AsLegacyRegistryV1Version

func (vr *VersionRelease) AsLegacyRegistryV1Version() bsemver.Version

AsLegacyRegistryV1Version converts a VersionRelease into a standard semver version. If the VersionRelease's Release field is set, the returned semver version's build metadata is set to the VersionRelease's Release. Otherwise, the build metadata is set to the VersionRelease's Version field's build metadata.

func (*VersionRelease) Compare

func (vr *VersionRelease) Compare(other VersionRelease) int

Compare compares two VersionRelease values. It returns:

-1 if vr < other
 0 if vr == other
+1 if vr > other

Comparison is done first by Version, then by Release if versions are equal.

Jump to

Keyboard shortcuts

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