cversion

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cversion provides utilities for working with Centrify version strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComparisonResult

type ComparisonResult int
const (
	Earlier ComparisonResult = iota - 1
	Equal
	Subsequent
)

type Version

type Version struct {
	Major       int
	Minor       int
	BuildNumber int
	Debug       bool
	NotYet      bool
}

func Parse

func Parse(versionStr string) (Version, error)

Parses version strings into a Version struct. Strings like the following are accepted:

"17.2", "17.2.100", "17.2-100", "17.2.100-NotYet", "17.2-100-NotYet", etc.

Strings like the following are (currently) not accepted:

"", "foo", "17.2.", "17.2-NotYet", etc.

If the build number is missing from the input, it is treated as if it were 0.

func (*Version) Compare

func (version *Version) Compare(otherVersion Version) ComparisonResult

func (*Version) MajorMinorString

func (version *Version) MajorMinorString() string

func (*Version) String

func (version *Version) String() string

Jump to

Keyboard shortcuts

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