runner.work.semver.semver

build #

fn build(major int, minor int, patch int) Version

build returns Version structure with given major, minor and patch versions.

coerce #

fn coerce(input string) ?Version

coerce coerces a given string to a semver if it's possible.

from #

fn from(input string) ?Version

from returns Version structure parsed from input string.

is_valid #

fn is_valid(input string) bool

is_valid checks if a given string is a valid semver.

Increment #

enum Increment {
	major
	minor
	patch
}

Enum representing type of version increment.

Version #

struct Version {
pub:
	major      int
	minor      int
	patch      int
	prerelease string
	metadata   string
}

Structure representing version in semver format.

Version.increment #

fn (ver Version) increment(typ Increment) Version

increment returns Version structure with incremented values.

Version.satisfies #

fn (ver Version) satisfies(input string) bool

satisfies checks if the current version satisfies a given input range.

Version.eq #

fn (v1 Version) eq(v2 Version) bool

eq checks if the version equals a given input version.

Version.gt #

fn (v1 Version) gt(v2 Version) bool

eq checks if the version is greater than a given input version.

Version.lt #

fn (v1 Version) lt(v2 Version) bool

eq checks if the version is less than a given input version.

Version.ge #

fn (v1 Version) ge(v2 Version) bool

eq checks if the version is greater or equal than a given input version.

Version.le #

fn (v1 Version) le(v2 Version) bool

eq checks if the version is less or equal than a given input version.