version

package
v0.99.99-test-ignore Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2021 License: BSD-3-Clause Imports: 4 Imported by: 126

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser interface {
	Parse(string) (Version, error)
}

Parser defines the interface of a version parser

func NewDefaultParser

func NewDefaultParser() Parser

NewDefaultParser returns a new parser with the default separators

func NewParser

func NewParser(appSeparator string, versionSeparator string) Parser

NewParser returns a new parser

type Version

type Version interface {
	fmt.Stringer

	App() string
	Major() int
	Minor() int
	Patch() int

	Compatible(Version) error
	Before(Version) bool
}

Version defines what is needed to describe a version

func NewDefaultVersion

func NewDefaultVersion(
	app string,
	major int,
	minor int,
	patch int,
) Version

NewDefaultVersion returns a new version with default separators

func NewVersion

func NewVersion(
	app string,
	appSeparator string,
	versionSeparator string,
	major int,
	minor int,
	patch int,
) Version

NewVersion returns a new version

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL