semver

package module
v0.0.0-...-b3f0fce Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: BSD-3-Clause, MIT Imports: 4 Imported by: 1

README

semver

Test and compare semver versioning.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Semver

type Semver struct {
	// contains filtered or unexported fields
}

Semver validator to do checks based on the semver 2.0.0 spec.

func New

func New() (*Semver, error)

New returns a new instance ofSemver.

func (*Semver) GreaterThanOrEqual

func (s *Semver) GreaterThanOrEqual(version string, compare string) (bool, error)

GreaterThanOrEqual checks if the given version is greater than or equal to the compare version.

func (*Semver) InRange

func (s *Semver) InRange(version string, start string, end string) (bool, error)

InRange checks if the version is between the given start and end versions.

func (*Semver) SmallerThanOrEqual

func (s *Semver) SmallerThanOrEqual(version string, compare string) (bool, error)

SmallerThanOrEqual checks if the given version is smaller than or equal to the compare version.

func (*Semver) Valid

func (s *Semver) Valid(version string) bool

Valid checks if the given version is a valid semver format.

type Versioning

type Versioning interface {
	Valid(version string) bool
	InRange(version string, start string, end string) (bool, error)
	GreaterThanOrEqual(version string, compare string) (bool, error)
	SmallerThanOrEqual(version string, compare string) (bool, error)
}

Versioning represents an object that provides validation tools to check a versioning system's versions.

Jump to

Keyboard shortcuts

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