semanticversion

package
v3.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const INF = "INFINITY"

Variables

This section is empty.

Functions

func CompareVersions

func CompareVersions(v1 string, v2 string) (int, error)

Return 1 if the input version v1 is higher than v2

0 if the input version v1 equals to v2
-1 if the input version v1 is lower than v2
error if v1 or v2 is no a valid sigle version string

func IsVersionExpression

func IsVersionExpression(expr string) bool

Return true if the input version string is a full version expression

func IsVersionString

func IsVersionString(expr string) bool

Return true if the input version string is a valid version according to the version string schema above. A number with leading 0's, for example 1.02.1, is not a valid version string.

Types

type Version_Expression

type Version_Expression struct {
	// contains filtered or unexported fields
}

func Version_Expression_Factory

func Version_Expression_Factory(ver_string string) (*Version_Expression, error)

func (*Version_Expression) ChangeCeiling

func (self *Version_Expression) ChangeCeiling(ceiling_version string, inclusive bool) error

change the ceiling of this version range.

func (*Version_Expression) Get_end_version

func (self *Version_Expression) Get_end_version() string

Return the end version

func (*Version_Expression) Get_expression

func (self *Version_Expression) Get_expression() string

Return the version expression that was used as input to create this object

func (*Version_Expression) Get_start_version

func (self *Version_Expression) Get_start_version() string

Return the start version

func (*Version_Expression) IntersectsWith

func (self *Version_Expression) IntersectsWith(other *Version_Expression) error

make this version equals to the intersection of self and the given version

func (*Version_Expression) Is_within_range

func (self *Version_Expression) Is_within_range(expr string) (bool, error)

Return true if the input version string in a valid version string and if it falls within the boundaries of this object's version range.

func (Version_Expression) String

func (ve Version_Expression) String() string

Jump to

Keyboard shortcuts

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