thriftrw: go.uber.org/thriftrw/internal/semver Index | Files

package semver

import "go.uber.org/thriftrw/internal/semver"

Index

Package Files

compat.go range.go semver.go

type Range Uses

type Range struct {
    Begin Version
    End   Version
}

Range is the range of version numbers that lie in [Begin, End).

func CompatibleRange Uses

func CompatibleRange(v Version) (r Range)

CompatibleRange generates the compatibility range for generated code and plugins.

Assuming current Version is 1.2.3-pre we get:

begin >= 1.0.0

end  < 1.3.0-pre

func (*Range) Contains Uses

func (r *Range) Contains(other Version) bool

Contains returns true if the given semver version number is in this range.

type Version Uses

type Version struct {
    Major uint
    Minor uint
    Patch uint
    Pre   []string
    Meta  string
}

Version is a parsed semantic version representation.

func Parse Uses

func Parse(v string) (r Version, err error)

Parse a semantic version string.

func (*Version) Compare Uses

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

Compare returns:

0 if a == b

-1 if a < b +1 if a > b

func (*Version) String Uses

func (v *Version) String() string

Package semver imports 4 packages (graph) and is imported by 2 packages. Updated 2020-01-15. Refresh now. Tools for package owners.