models

package
v0.5.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Wildcard = "*"

Variables

This section is empty.

Functions

func GetBuildMetadata

func GetBuildMetadata(v string) string

func GetPrerelease

func GetPrerelease(v string) string

func GetRelease

func GetRelease(v string) string

func GetVersionComponents

func GetVersionComponents(v string) (release, prerelease, buildMetadata string)

func IncrementVersion

func IncrementVersion(versionList []Version, i Increment, targetStream VersionPattern) error

func SplitVersions

func SplitVersions(stringVersions string) (versionStringSlice []string)

SplitVersions splits a string of versions into a slice of strings separated by commas or spaces

Types

type BuildIdentifier

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

func ParseBuildIdentifier

func ParseBuildIdentifier(v string) (BuildIdentifier, error)

ParseBuildIdentifier parses a string into a BuildIdentifier

func (*BuildIdentifier) Set

func (i *BuildIdentifier) Set(v string) error

Set sets the BuildIdentifier value It returns an error if the value is empty or contains characters other than alphanumerics and hyphens

func (*BuildIdentifier) String

func (i *BuildIdentifier) String() string

String returns the BuildIdentifier value

type BuildIdentifierPattern

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

func (*BuildIdentifierPattern) Set

func (i *BuildIdentifierPattern) Set(pattern string) error

func (BuildIdentifierPattern) Value

func (p BuildIdentifierPattern) Value() string

type BuildMetadata

type BuildMetadata struct {
	Identifiers []BuildIdentifier
}

func ParseBuildMetadata

func ParseBuildMetadata(metadata string) (BuildMetadata, error)

func (*BuildMetadata) String

func (bm *BuildMetadata) String() string

type BuildMetadataPattern

type BuildMetadataPattern struct {
	Identifiers []BuildIdentifierPattern
}

type EmptyVersionListError

type EmptyVersionListError struct{}

func (*EmptyVersionListError) Error

func (e *EmptyVersionListError) Error() string

type Increment

type Increment string
const (
	Major Increment = "major"
	Minor Increment = "minor"
	Patch Increment = "patch"
	None  Increment = "none"
)

func (Increment) IsHigherThan

func (i Increment) IsHigherThan(comparedTo Increment) bool

func (Increment) ValidateIncrement

func (i Increment) ValidateIncrement() error

type PRIdentifier

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

func ParsePrIdentifier

func ParsePrIdentifier(v string) (PRIdentifier, error)

ParsePrIdentifier parses a string into a PRIdentifier

func (PRIdentifier) IsEqualTo

func (i PRIdentifier) IsEqualTo(identifierB PRIdentifier) bool

IsEqualTo compares two PRIdentifiers and returns true if they are equal

func (PRIdentifier) IsHigherThan

func (i PRIdentifier) IsHigherThan(identifierB PRIdentifier) bool

IsHigherThan compares two PRIdentifiers and returns true if the first identifier is higher than the second according to the Semver specification

func (*PRIdentifier) Set

func (i *PRIdentifier) Set(v string) error

Set sets the PRIdentifier value It returns an error if the value is empty, contains leading zeros, or contains characters other than alphanumerics and hyphens

func (PRIdentifier) Value

func (i PRIdentifier) Value() string

type PRIdentifierPattern

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

func (*PRIdentifierPattern) Set

func (i *PRIdentifierPattern) Set(pattern string) error

func (PRIdentifierPattern) Value

func (p PRIdentifierPattern) Value() string

type PRVersion

type PRVersion struct {
	Identifiers []PRIdentifier
}

func ParsePRVersion

func ParsePRVersion(rawPrerelease string) (PRVersion, error)

func (PRVersion) IsEqualTo

func (pr PRVersion) IsEqualTo(prB PRVersion) bool

func (*PRVersion) IsHigherThan

func (pr *PRVersion) IsHigherThan(prB PRVersion) bool

func (PRVersion) LastID

func (pr PRVersion) LastID() PRIdentifier

func (*PRVersion) String

func (pr *PRVersion) String() string

type PRVersionPattern

type PRVersionPattern struct {
	Identifiers []PRIdentifierPattern
}

type Pattern

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

type Release

type Release struct {
	Major ReleaseDigit
	Minor ReleaseDigit
	Patch ReleaseDigit
}

func ParseRelease

func ParseRelease(v string) (Release, error)

func (Release) IsEqualTo

func (r Release) IsEqualTo(releaseB Release) bool

IsEqualTo compares two Releases and returns true if they are equal

func (Release) IsHigherThan

func (r Release) IsHigherThan(rB Release) bool

func (*Release) String

func (r *Release) String() string

type ReleaseDigit

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

func (ReleaseDigit) GT

func (r ReleaseDigit) GT(cmp ReleaseDigit) bool

func (*ReleaseDigit) Increment

func (r *ReleaseDigit) Increment()

func (ReleaseDigit) LT

func (r ReleaseDigit) LT(cmp ReleaseDigit) bool

func (*ReleaseDigit) Set

func (r *ReleaseDigit) Set(d uint64)

func (ReleaseDigit) String

func (r ReleaseDigit) String() string

func (ReleaseDigit) Value

func (r ReleaseDigit) Value() uint64

type ReleaseDigitPattern

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

func (ReleaseDigitPattern) Value

func (m ReleaseDigitPattern) Value() string

type ReleasePattern

type ReleasePattern struct {
	Major ReleaseDigitPattern
	Minor ReleaseDigitPattern
	Patch ReleaseDigitPattern
}

func (ReleasePattern) IsStrict

func (r ReleasePattern) IsStrict() bool

func (ReleasePattern) String

func (r ReleasePattern) String() string

type Version

type Version struct {
	Release       Release
	Prerelease    PRVersion
	BuildMetadata BuildMetadata
}

func ParseVersion

func ParseVersion(v string) (Version, error)

func StringToVersions

func StringToVersions(stringVersions string) ([]Version, error)

func (*Version) IsEqualTo

func (v *Version) IsEqualTo(versionB Version) bool

IsEqualTo compares two Versions and returns true if they are equal Build metadata is ignored in the comparison as per the Semver specification

func (Version) IsHigherThan

func (v Version) IsHigherThan(versionB Version) bool

IsHigherThan compares two Versions and returns true if the first version is higher than the second according to the Semver specification

func (Version) IsRelease

func (v Version) IsRelease() bool

func (*Version) String

func (v *Version) String() string

type VersionPattern

type VersionPattern struct {
	Release    ReleasePattern
	Prerelease PRVersionPattern
	Build      BuildMetadataPattern
}

func ParseVersionPattern

func ParseVersionPattern(pattern string) (VersionPattern, error)

func (VersionPattern) FirstBuildMetadata

func (v VersionPattern) FirstBuildMetadata() BuildMetadata

func (VersionPattern) FirstPrerelease

func (v VersionPattern) FirstPrerelease() PRVersion

func (VersionPattern) FirstRelease

func (v VersionPattern) FirstRelease() (FirstRelease Release)

func (VersionPattern) FirstVersion

func (v VersionPattern) FirstVersion() (firstVersion Version)

func (VersionPattern) IsEmpty

func (v VersionPattern) IsEmpty() bool

func (VersionPattern) IsPRPattern

func (v VersionPattern) IsPRPattern() bool

func (VersionPattern) IsReleaseOnlyPattern

func (v VersionPattern) IsReleaseOnlyPattern() bool

type VersionSlice

type VersionSlice []Version

func ParseVersions

func ParseVersions(vList string) (VersionSlice, error)

func (VersionSlice) String

func (vs VersionSlice) String() string

Jump to

Keyboard shortcuts

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