Documentation
¶
Index ¶
- type SortedVersions
- type SpecifierOption
- type Specifiers
- type Version
- func (v Version) BaseVersion() string
- func (v Version) Compare(other Version) int
- func (v Version) Equal(o Version) bool
- func (v Version) GreaterThan(o Version) bool
- func (v Version) GreaterThanOrEqual(o Version) bool
- func (v Version) IsPostRelease() bool
- func (v Version) IsPreRelease() bool
- func (v Version) LessThan(o Version) bool
- func (v Version) LessThanOrEqual(o Version) bool
- func (v Version) Local() string
- func (v Version) Original() string
- func (v Version) Public() string
- func (v Version) String() string
- type WithPreRelease
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SortedVersions ¶
type SortedVersions []Version
func (SortedVersions) Len ¶
func (s SortedVersions) Len() int
func (SortedVersions) Less ¶
func (s SortedVersions) Less(i, j int) bool
func (SortedVersions) Swap ¶
func (s SortedVersions) Swap(i, j int)
type SpecifierOption ¶
type SpecifierOption interface {
// contains filtered or unexported methods
}
type Specifiers ¶
type Specifiers struct {
// contains filtered or unexported fields
}
func NewRSpecifiers ¶
func NewRSpecifiers(v string, sanitizer func(string) string, opts ...SpecifierOption) (Specifiers, error)
NewRSpecifiers parses a given specifier and returns a new instance of Specifiers intended for working with R package versions.
func NewSpecifiers ¶
func NewSpecifiers(v string, opts ...SpecifierOption) (Specifiers, error)
NewSpecifiers parses a given specifier and returns a new instance of Specifiers
func NewSpecifiersWithSanitizer ¶
func NewSpecifiersWithSanitizer(v string, sanitizer func(string) string, opts ...SpecifierOption) (Specifiers, error)
NewSpecifiersWithSanitizer parses a given specifier and returns a new instance of Specifiers it sanitizes the version string before parsing it with the given function.
func (Specifiers) Check ¶
func (ss Specifiers) Check(v Version) bool
Check tests if a version satisfies all the specifiers.
func (Specifiers) String ¶
func (ss Specifiers) String() string
String returns the string format of the specifiers
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version represents a single version.
func (Version) BaseVersion ¶
BaseVersion returns the base version
func (Version) Compare ¶
Compare compares this version to another version. This returns -1, 0, or 1 if this version is smaller, equal, or larger than the other version, respectively.
func (Version) GreaterThan ¶
GreaterThan tests if this version is greater than another version.
func (Version) GreaterThanOrEqual ¶
GreaterThanOrEqual tests if this version is greater than or equal to another version.
func (Version) IsPostRelease ¶
IsPostRelease returns if it is a post-release
func (Version) IsPreRelease ¶
IsPreRelease returns if it is a pre-release
func (Version) LessThanOrEqual ¶
LessThanOrEqual tests if this version is less than or equal to another version.
type WithPreRelease ¶
type WithPreRelease bool