Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrProgramNotSupported = errors.New("program not supported")
)
Functions ¶
func CompareSemverVersions ¶
func CompareSemverVersions(a, b SemverVersion) int
func GetProgramName ¶
GetProgramName returns the name of the given Program.
func Satisfies ¶
Satisfies returns true if the version matches the semver. version is the version of the program, and requirement is a semver requirement. The semver requirement is a string that follows the conventions in https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html.
Examples (version is on the left, requirement is on the right): - 1.2.3 matches 1.2.3 - 1.2.3 matches ^1.2.3 - 1.2.3 does not match 1.2 - 1.2.3 matches ~1.2.3 - 1.2.3 matches ~1.2 - 1.2.3 matches ~1 - 1.2.3 does not match ~2
Types ¶
type Program ¶
type Program int
enum for Programs that we can identify
func GetProgram ¶
GetProgram returns the Program for the given name, if found.
type Requirement ¶
type Requirement struct {
Type RequirementType
Version SemverVersion
MaxVersion *SemverVersion
}
func NewRequirement ¶
func NewRequirement(s string) (*Requirement, error)
type RequirementType ¶
type RequirementType int
const ( Exact RequirementType = iota Caret Tilde SingleConditionEqual SingleConditionGreaterThan SingleConditionLessThan SingleConditionGreaterThanOrEqual SingleConditionLessThanOrEqual )
type SemverVersion ¶
func ParseVersion ¶
func ParseVersion(s string) (*SemverVersion, error)
Click to show internal directories.
Click to hide internal directories.