Back to godoc.org
github.com/blang/semver

Package semver

v1.1.0
Latest Go to latest

The latest major version is v4.

Published: Dec 8, 2014 | License: MIT | Module: github.com/blang/semver

Index

Variables

var SPEC_VERSION = Version{
	Major: 2,
	Minor: 0,
	Patch: 0,
}

Latest fully supported spec version

func NewBuildVersion

func NewBuildVersion(s string) (string, error)

Creates a new valid build version

type PRVersion

type PRVersion struct {
	VersionStr string
	VersionNum uint64
	IsNum      bool
}

PreRelease Version

func NewPRVersion

func NewPRVersion(s string) (*PRVersion, error)

Creates a new valid prerelease version

func (PRVersion) Compare

func (v PRVersion) Compare(o *PRVersion) int

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

func (v PRVersion) IsNumeric() bool

Is pre release version numeric?

func (PRVersion) String

func (v PRVersion) String() string

PreRelease version to string

type Version

type Version struct {
	Major uint64
	Minor uint64
	Patch uint64
	Pre   []*PRVersion
	Build []string //No Precendence
}

func New

func New(s string) (*Version, error)

Alias for Parse, parses version string and returns a validated Version or error

func Parse

func Parse(s string) (*Version, error)

Parses version string and returns a validated Version or error

func (Version) Compare

func (v Version) Compare(o *Version) int

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) GT

func (v Version) GT(o *Version) bool

Checks if v is greater than o.

func (Version) GTE

func (v Version) GTE(o *Version) bool

Checks if v is greater than or equal to o.

func (Version) LT

func (v Version) LT(o *Version) bool

Checks if v is less than o.

func (Version) LTE

func (v Version) LTE(o *Version) bool

Checks if v is less than or equal to o.

func (*Version) Scan

func (v *Version) Scan(src interface{}) (err error)

Scan implements the database/sql.Scanner interface.

func (Version) String

func (v Version) String() string

Version to string

func (Version) Validate

func (v Version) Validate() error

Validates v and returns error in case

func (Version) Value

func (s Version) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier