Documentation ¶
Index ¶
- Constants
- func ApplyDynamicStrategy(targetVersion, existingVersion string) (string, error)
- func ApplyRangeStrategy(targetVersion, existingVersion string) (string, error)
- func ApplyVersionStrategy(strategy Strategy, targetVersion string, existingVersion string) (string, error)
- func ConvertToExactVersion(version string) (string, error)
- func ConvertToRangeVersion(version string) (string, error)
- func DecideVersionOrRange(oldIsVer bool, oldVer *semver.Version, oldRange *semver.Constraints, ...) string
- func ExpandTerraformTildeArrow(version string) string
- func NormalizeVersionString(version string) string
- func ParseVersionOrRange(input string) (bool, *semver.Version, *semver.Constraints, error)
- func RangesOverlap(a, b *semver.Constraints) bool
- type Strategy
Constants ¶
View Source
const ( MAX_MAJOR = 20 MAX_MINOR = 50 MAX_PATCH = 50 )
Variables ¶
This section is empty.
Functions ¶
func ApplyDynamicStrategy ¶
func ApplyRangeStrategy ¶ added in v0.1.3
func ApplyVersionStrategy ¶
func ApplyVersionStrategy(strategy Strategy, targetVersion string, existingVersion string) (string, error)
ApplyVersionStrategy applies the specified strategy to convert between version formats
func ConvertToExactVersion ¶
func ConvertToRangeVersion ¶
func DecideVersionOrRange ¶
func DecideVersionOrRange( oldIsVer bool, oldVer *semver.Version, oldRange *semver.Constraints, oldInput string, newIsVer bool, newVer *semver.Version, newRange *semver.Constraints, newInput string, ) string
DecideVersionOrRange does "keep old if it fits new, otherwise new."
func ExpandTerraformTildeArrow ¶
ExpandTerraformTildeArrow scans for "~>" => ">=X.Y.Z,<X+1.0.0"
func NormalizeVersionString ¶ added in v0.1.2
NormalizeVersionString ensures consistent formatting of version strings
func ParseVersionOrRange ¶
ParseVersionOrRange tries single version (e.g. "1.2.3") first; if that fails, tries a range with "~>" expansions.
func RangesOverlap ¶
func RangesOverlap(a, b *semver.Constraints) bool
RangesOverlap tries some sample versions from 0.0.0..(MAX_MAJOR,MAX_MINOR,MAX_PATCH).
Types ¶
Click to show internal directories.
Click to hide internal directories.