semantic

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedEcosystem = errors.New("unsupported ecosystem")

Functions

This section is empty.

Types

type CRANVersion added in v0.13.0

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

CRANVersion is the representation of a version of a package that is held in the CRAN ecosystem (https://cran.r-project.org/).

A version is a sequence of at least two non-negative integers separated by either a period or a dash.

See https://astrostatistics.psu.edu/su07/R/html/base/html/package_version.html

func (CRANVersion) Compare added in v0.13.0

func (v CRANVersion) Compare(w CRANVersion) int

func (CRANVersion) CompareStr added in v0.13.0

func (v CRANVersion) CompareStr(str string) int

type Components

type Components []*big.Int

func (*Components) Cmp added in v0.9.0

func (components *Components) Cmp(b Components) int

func (*Components) Fetch

func (components *Components) Fetch(n int) *big.Int

type DebianVersion added in v0.9.0

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

func (DebianVersion) Compare added in v0.9.0

func (v DebianVersion) Compare(w DebianVersion) int

func (DebianVersion) CompareStr added in v0.9.0

func (v DebianVersion) CompareStr(str string) int

type MavenVersion added in v0.9.0

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

func (MavenVersion) Compare added in v0.9.0

func (mv MavenVersion) Compare(w MavenVersion) int

func (MavenVersion) CompareStr added in v0.9.0

func (mv MavenVersion) CompareStr(str string) int

type NuGetVersion added in v0.9.0

type NuGetVersion struct {
	SemverLikeVersion
}

func (NuGetVersion) Compare added in v0.9.0

func (v NuGetVersion) Compare(w NuGetVersion) int

func (NuGetVersion) CompareStr added in v0.9.0

func (v NuGetVersion) CompareStr(str string) int

type PackagistVersion added in v0.9.0

type PackagistVersion struct {
	Original   string
	Components []string
}

func (PackagistVersion) Compare added in v0.9.0

func (v PackagistVersion) Compare(w PackagistVersion) int

func (PackagistVersion) CompareStr added in v0.9.0

func (v PackagistVersion) CompareStr(str string) int

type PyPIVersion added in v0.9.0

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

func (PyPIVersion) Compare added in v0.9.0

func (pv PyPIVersion) Compare(pw PyPIVersion) int

func (PyPIVersion) CompareStr added in v0.9.0

func (pv PyPIVersion) CompareStr(str string) int

type RubyGemsVersion added in v0.9.0

type RubyGemsVersion struct {
	Original string
	Segments []string
}

func (RubyGemsVersion) Compare added in v0.9.0

func (v RubyGemsVersion) Compare(w RubyGemsVersion) int

func (RubyGemsVersion) CompareStr added in v0.9.0

func (v RubyGemsVersion) CompareStr(str string) int

type SemverLikeVersion added in v0.9.0

type SemverLikeVersion struct {
	LeadingV   bool
	Components Components
	Build      string
	Original   string
}

SemverLikeVersion is a version that is _like_ a version as defined by the Semantic Version specification, except with potentially unlimited numeric components and a leading "v"

func ParseSemverLikeVersion added in v0.9.0

func ParseSemverLikeVersion(line string, maxComponents int) SemverLikeVersion

type SemverVersion added in v0.9.0

type SemverVersion struct {
	SemverLikeVersion
}

func (SemverVersion) Compare added in v0.9.0

func (v SemverVersion) Compare(w SemverVersion) int

func (SemverVersion) CompareStr added in v0.9.0

func (v SemverVersion) CompareStr(str string) int

type Version

type Version interface {
	// CompareStr returns an integer representing the sort order of the given string
	// when parsed as the concrete Version relative to the subject Version.
	//
	// The result will be 0 if v == w, -1 if v < w, or +1 if v > w.
	CompareStr(str string) int
}

func MustParse added in v0.9.0

func MustParse(str string, ecosystem internal.Ecosystem) Version

func Parse

func Parse(str string, ecosystem internal.Ecosystem) (Version, error)

Jump to

Keyboard shortcuts

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