Documentation ¶
Index ¶
- Variables
- func NewBuildVersion(s string) (string, error)
- func Sort(versions []Version)
- type PRVersion
- type Version
- func (v Version) Compare(o Version) int
- func (v Version) EQ(o Version) bool
- func (v Version) Equals(o Version) bool
- func (v Version) GE(o Version) bool
- func (v Version) GT(o Version) bool
- func (v Version) GTE(o Version) bool
- func (v Version) LE(o Version) bool
- func (v Version) LT(o Version) bool
- func (v Version) LTE(o Version) bool
- func (v Version) MarshalJSON() ([]byte, error)
- func (v Version) NE(o Version) bool
- func (v *Version) Scan(src interface{}) (err error)
- func (v Version) String() string
- func (v *Version) UnmarshalJSON(data []byte) (err error)
- func (v Version) Validate() error
- func (v Version) Value() (driver.Value, error)
- type Versions
Constants ¶
This section is empty.
Variables ¶
var SpecVersion = Version{
Major: 2,
Minor: 0,
Patch: 0,
}
SpecVersion is the latest fully supported spec version of semver
Functions ¶
func NewBuildVersion ¶
NewBuildVersion creates a new valid build version
Types ¶
type PRVersion ¶
PRVersion represents a PreRelease Version
func NewPRVersion ¶
NewPRVersion creates a new valid prerelease version
func (PRVersion) Compare ¶
Compare compares two PreRelease Versions v and o: -1 == v is less than o 0 == v is equal to o 1 == v is greater than o
type Version ¶
type Version struct { Major uint64 Minor uint64 Patch uint64 Pre []PRVersion Build []string //No Precendence }
Version represents a semver compatible version
func Make ¶
Make is an alias for Parse, parses version string and returns a validated Version or error
func New ¶
New is an alias for Parse and returns a pointer, parses version string and returns a validated Version or error
func (Version) Compare ¶
Compare compares Versions v to o: -1 == v is less than o 0 == v is equal to o 1 == v is greater than o
func (Version) MarshalJSON ¶
MarshalJSON implements the encoding/json.Marshaler interface.
func (*Version) UnmarshalJSON ¶
UnmarshalJSON implements the encoding/json.Unmarshaler interface.