semver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SemVer

type SemVer struct {
	Major         int    `json:"major"`
	Minor         int    `json:"minor"`
	Patch         int    `json:"patch"`
	Prerelease    string `json:"prerelease"`
	BuildMetadata string `json:"buildmetadata"`
}

SemVer represents a well formed semantic version (https://semver.org) with fields for the 5 major components of a version: major, minor, and patch versions, as well as prerelease and build metadata.

func ParseSemver

func ParseSemver(s string) (SemVer, error)

ParseSemver takes in a raw string and converts it to a SemVer struct for easy access to individual components

func (SemVer) Fprint

func (ver SemVer) Fprint(f io.WriteCloser) (int, error)

Fprint prints an output of a semantic version to a specific io.WriteCloser

func (SemVer) Print

func (ver SemVer) Print() (int, error)

Print prints an output of a semantic version to stdout

func (SemVer) Version

func (ver SemVer) Version() string

Version returns a string representation of the semantic version

Jump to

Keyboard shortcuts

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