version

package
v0.0.0-...-576b6af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2016 License: MIT Imports: 5 Imported by: 387

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AscSorting

type AscSorting []Version

func (AscSorting) Len

func (s AscSorting) Len() int

func (AscSorting) Less

func (s AscSorting) Less(i, j int) bool

func (AscSorting) Swap

func (s AscSorting) Swap(i, j int)

type VerSegComp

type VerSegComp interface {
	Validate() error
	// Compare should panic if incompatible interface is given
	Compare(VerSegComp) int
	AsString() string
}

type VerSegCompInt

type VerSegCompInt struct{ I int }

func NewVerSegCompIntFromString

func NewVerSegCompIntFromString(piece string) (VerSegCompInt, bool, error)

func (VerSegCompInt) AsString

func (i VerSegCompInt) AsString() string

func (VerSegCompInt) Compare

func (i VerSegCompInt) Compare(other VerSegComp) int

func (VerSegCompInt) String

func (i VerSegCompInt) String() string

func (VerSegCompInt) Validate

func (i VerSegCompInt) Validate() error

type VerSegCompStr

type VerSegCompStr struct{ S string }

func NewVerSegCompStrFromString

func NewVerSegCompStrFromString(piece string) (VerSegCompStr, bool)

func (VerSegCompStr) AsString

func (s VerSegCompStr) AsString() string

func (VerSegCompStr) Compare

func (s VerSegCompStr) Compare(other VerSegComp) int

func (VerSegCompStr) String

func (s VerSegCompStr) String() string

func (VerSegCompStr) Validate

func (s VerSegCompStr) Validate() error

type Version

type Version struct {
	Release, PreRelease, PostRelease VersionSegment

	Segments []VersionSegment
}

func MustNewVersionFromString

func MustNewVersionFromString(v string) Version

func NewVersion

func NewVersion(release, preRelease, postRelease VersionSegment) (Version, error)

func NewVersionFromString

func NewVersionFromString(v string) (Version, error)

func (Version) AsString

func (v Version) AsString() string

func (Version) Compare

func (v Version) Compare(other Version) int

func (Version) Empty

func (v Version) Empty() bool

func (Version) IncrementPostRelease

func (v Version) IncrementPostRelease(defaultPostRelease VersionSegment) (Version, error)

func (Version) IncrementRelease

func (v Version) IncrementRelease() (Version, error)

func (Version) IsEq

func (v Version) IsEq(other Version) bool

func (Version) IsGt

func (v Version) IsGt(other Version) bool

func (Version) IsLt

func (v Version) IsLt(other Version) bool

func (Version) String

func (v Version) String() string

type VersionSegment

type VersionSegment struct {
	Components []VerSegComp
}

func MustNewVersionSegmentFromString

func MustNewVersionSegmentFromString(v string) VersionSegment

func NewVersionSegment

func NewVersionSegment(components []VerSegComp) (VersionSegment, error)

func NewVersionSegmentFromString

func NewVersionSegmentFromString(v string) (VersionSegment, error)

func (VersionSegment) AsString

func (s VersionSegment) AsString() string

func (VersionSegment) Compare

func (s VersionSegment) Compare(other VersionSegment) int

func (VersionSegment) Copy

func (s VersionSegment) Copy() VersionSegment

func (VersionSegment) Empty

func (s VersionSegment) Empty() bool

func (VersionSegment) Increment

func (s VersionSegment) Increment() (VersionSegment, error)

func (VersionSegment) IsEq

func (s VersionSegment) IsEq(other VersionSegment) bool

func (VersionSegment) IsGt

func (s VersionSegment) IsGt(other VersionSegment) bool

func (VersionSegment) IsLt

func (s VersionSegment) IsLt(other VersionSegment) bool

func (VersionSegment) String

func (s VersionSegment) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL