Documentation
¶
Index ¶
- 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) MarshalText() ([]byte, error)
- func (v Version) Original() string
- func (v Version) Public() string
- func (v Version) String() string
- func (v *Version) UnmarshalText(data []byte) error
- type WithPreRelease
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SpecifierOption ¶
type SpecifierOption interface {
// contains filtered or unexported methods
}
type Specifiers ¶
type Specifiers struct {
// contains filtered or unexported fields
}
func NewSpecifiers ¶
func NewSpecifiers(v string, opts ...SpecifierOption) (Specifiers, error)
NewSpecifiers parses a given specifier and returns a new instance of Specifiers
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.
func (Version) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (Version) Original ¶
Original returns the original parsed version as-is, including any potential whitespace, `v` prefix, etc.
func (Version) String ¶
String returns the full version string included pre-release and metadata information.
func (*Version) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type WithPreRelease ¶
type WithPreRelease bool