Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Range ¶
Range represents a range of versions which can be use to validate if a Version is valid for a Range.
func MustNewRange ¶
MustNewRange creates a new instance of a Version; however it will panic if it cannot be created.
func NewRange ¶
NewRange creates an instance of a Range. Valid ranges can consist of multiple comparisons and three/four digit versions:
- "<1.0.0" || "<v1.0.0.0"
- "<=1.0.0" || "<=1.0.0.0"
- ">1.0.0" || ">1.0.0.0"
- ">=1.0.0" || >= 1.0.0.0
- "1.0.0", "=1.0.0", "==1.0.0" || "1.0.0.0", "=1.0.0.0", "==1.0.0.0"
- "!1.0.0", "!=1.0.0" || "!1.0.0.0", "!=1.0.0.0"
A Range can consist of multiple ranges separated by space: Ranges can be linked by logical AND:
- ">1.0.0 <2.0.0" would match between both ranges, so "1.1.1" and "1.8.7" but not "1.0.0" or "2.0.0"
- ">1.0.0 <3.0.0 !2.0.3-beta.2" would match every version between 1.0.0 and 3.0.0 except 2.0.3-beta.2
Four digit versions can be used in ranges with three digit version and linked by logical AND:
- ">1.0.0 <2.0.0.0" would match between both ranges, so "1.0.0.1" and "1.8.7" but not "1.0.0", "2.0.0"
- ">1.0.0 <3.0.0 !2.0.3.0-beta.2" would match every version between 1.0.0 and 3.0.0 except 2.0.3-beta.2 and 2.0.3.0-beta2
Ranges can also be linked by logical OR:
- "<2.0.0 || >=3.0.0" would match "1.x.x" and "3.x.x" but not "2.x.x"
Four digit versions can be used in ranges with three digit version and linked by logical OR:
AND has a higher precedence than OR. It's not possible to use brackets.
Ranges can be combined by both AND and OR:
- ">1.0.0 <2.0.0.0 || >3.0.0 !4.2.1" would match "1.2.3", "1.0.0.1", "1.9.9", "3.1.1", but not "4.2.1", "2.1.1"
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version represents a three or four digit version.
func MustNewVersion ¶
MustNewVersion creates a new instance of a Version; however it will panic if it cannot be created.
func NewVersion ¶
NewVersion creates a new instance of a Version.
func (Version) IsKongGatewayEnterprise ¶
IsKongGatewayEnterprise determines if a Version represents a Kong Gateway enterprise edition.
func (Version) PreRelease ¶
PreRelease returns the pre-release string of Version.