version

package
v0.0.0-...-8989b1e Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package version provides a VersionComparison method to make comparing versions easy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApproxGreaterThan

func ApproxGreaterThan(ver string, compareTo string) bool

func MatchConstraint

func MatchConstraint(ver string, constraint string) bool

Types

type ConstraintType

type ConstraintType int
const (
	NoMatch ConstraintType = iota
	BeEqualTo
	BeGreaterThan
	BeLessThan
	BeGreaterThanOrEqual
	BeLessThanOrEqual
	BeApproxGreaterThan
)

Version Constrain Type

func GetConstraintType

func GetConstraintType(verConstraint string) ConstraintType

type VersionComparison

type VersionComparison int
const (
	GreaterThan VersionComparison = iota
	LessThan
	EqualTo
)

Version Comparison

func Compare

func Compare(ver string, compTo string) VersionComparison

VersionCompare takes a version and compares it to another version. It returns GreaterThan, LessThan, or EqualTo

Jump to

Keyboard shortcuts

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