fn build(major int, minor int, patch int) Version
build returns Version structure with given major, minor and patch versions.
fn coerce(input string) ?Version
coerce coerces a given string to a semver if it's possible.
fn from(input string) ?Version
from returns Version structure parsed from input string.
fn is_valid(input string) bool
is_valid checks if a given string is a valid semver.
enum Increment {
major
minor
patch
}
Enum representing type of version increment.
struct Version {
pub:
major int
minor int
patch int
prerelease string
metadata string
}
Structure representing version in semver format.
fn (ver Version) increment(typ Increment) Version
increment returns Version structure with incremented values.
fn (ver Version) satisfies(input string) bool
satisfies checks if the current version satisfies a given input range.
fn (v1 Version) eq(v2 Version) bool
eq checks if the version equals a given input version.
fn (v1 Version) gt(v2 Version) bool
eq checks if the version is greater than a given input version.
fn (v1 Version) lt(v2 Version) bool
eq checks if the version is less than a given input version.
fn (v1 Version) ge(v2 Version) bool
eq checks if the version is greater or equal than a given input version.
fn (v1 Version) le(v2 Version) bool
eq checks if the version is less or equal than a given input version.