package semver
import "github.com/blang/semver"
Index ¶
- Variables
- func NewBuildVersion(s string) (string, error)
- func Sort(versions []Version)
- type PRVersion
- func NewPRVersion(s string) (PRVersion, error)
- func (v PRVersion) Compare(o PRVersion) int
- func (v PRVersion) IsNumeric() bool
- func (v PRVersion) String() string
- type Version
- func MustParse(s string) Version
- func New(s string) (Version, error)
- func Parse(s string) (Version, error)
- 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 (s Version) Value() (driver.Value, error)
- type Versions
Variables ¶
var SPEC_VERSION = Version{ Major: 2, Minor: 0, Patch: 0, }
Latest fully supported spec version
Functions ¶
func NewBuildVersion ¶
Creates a new valid build version
func Sort ¶
func Sort(versions []Version)
Sort sorts a slice of versions
Types ¶
type PRVersion ¶
PreRelease Version
func NewPRVersion ¶
Creates a new valid prerelease version
func (PRVersion) Compare ¶
Compares PreRelease Versions v to o: -1 == v is less than o 0 == v is equal to o 1 == v is greater than o
func (PRVersion) IsNumeric ¶
Is pre release version numeric?
func (PRVersion) String ¶
PreRelease version to string
type Version ¶
type Version struct { Major uint64 Minor uint64 Patch uint64 Pre []PRVersion Build []string //No Precendence }
func MustParse ¶
MustParse is like Parse but panics if the version cannot be parsed.
func New ¶
Alias for Parse, parses version string and returns a validated Version or error
func Parse ¶
Parses version string and returns a validated Version or error
func (Version) 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) EQ ¶
Checks if v is equal to o.
func (Version) Equals ¶
Checks if v is equal to o.
func (Version) GE ¶
Checks if v is greater than or equal to o.
func (Version) GT ¶
Checks if v is greater than o.
func (Version) GTE ¶
Checks if v is greater than or equal to o.
func (Version) LE ¶
Checks if v is less than or equal to o.
func (Version) LT ¶
Checks if v is less than o.
func (Version) LTE ¶
Checks if v is less than or equal to o.
func (Version) MarshalJSON ¶
MarshalJSON implements the encoding/json.Marshaler interface.
func (Version) NE ¶
Checks if v is not equal to o.
func (*Version) Scan ¶
Scan implements the database/sql.Scanner interface.
func (Version) String ¶
Version to string
func (*Version) UnmarshalJSON ¶
UnmarshalJSON implements the encoding/json.Unmarshaler interface.
func (Version) Validate ¶
Validates v and returns error in case
func (Version) Value ¶
Value implements the database/sql/driver.Valuer interface.
type Versions ¶
type Versions []Version
func (Versions) Len ¶
func (Versions) Less ¶
func (Versions) Swap ¶
Source Files ¶
json.go semver.go sort.go sql.go
Directories ¶
Path | Synopsis |
---|---|
examples |
- Version
- v2.2.0+incompatible (latest)
- Published
- Feb 26, 2015
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 1 day ago –
Tools for package owners.