semver

package
v0.0.0-...-2c887f5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownMod = errors.New("unknown version mod")

Functions

func LoadTags

func LoadTags(paths gravel.Paths) (map[string]*Version, error)

func WriteTags

func WriteTags(paths gravel.Paths, versions map[string]*Version) error

Types

type Mod

type Mod byte
const (
	ModPatch Mod = iota // patch
	ModMinor            // minor
	ModMajor            // major
	ModDate             // date
)

func (Mod) MarshalText

func (seg Mod) MarshalText() ([]byte, error)

func (Mod) String

func (i Mod) String() string

func (*Mod) UnmarshalText

func (seg *Mod) UnmarshalText(p []byte) error

type Version

type Version struct {
	Major uint64
	Minor uint64
	Patch uint64
	Extra string
}

func Max

func Max(v1, v2 *Version) *Version

func Parse

func Parse(version string) (*Version, error)

func Update

func Update(version Version, mod Mod) *Version

func Zero

func Zero() *Version

func (Version) MarshalText

func (v Version) MarshalText() ([]byte, error)

func (Version) String

func (v Version) String() string

func (*Version) UnmarshalText

func (v *Version) UnmarshalText(p []byte) error

Jump to

Keyboard shortcuts

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