Documentation ¶
Overview ¶
Package version describes a version used for a repository.
The version for an entity is composed of a major version, minor version, and patch. The major and minor version numbers are both integers and dictate the compatibility between two versions. The patch provides extra information that is not part of the compatibility check, but still must be present.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cmp ¶
Cmp compares two Versions. Return 1 if a is greater than b, -1 if a is less than b, and 0 if they are equal. A Version
func Equal ¶
Equal determines if two Version objects are equal. They are equal when major, minor, and patch are all the same
func IsCompatible ¶
IsCompatible determines if the current Version is compatible with the required Version. Version are compatible when the major versions are equal and the current minor version is greater than or equal to the required version. The patches do not need to match.
Types ¶
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version structure contains the major, minor, and patch information.
func ParseVersion ¶
ParseVersion parses a string into a Version object. An error is returned for invalid version string. To be valid, a string must contain a major integer, a minor integer, and a patch string separated by a period.