version

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	Epoch    uint
	Version  string
	Revision string
}

Version represents a dpkg version string.

func MustParse

func MustParse(input string) Version

MustParse is like Parse, but panics on error.

func Parse

func Parse(input string) (Version, error)

Parse returns a Version struct filled with the epoch, version and revision specified in input. It verifies the version string as a whole, just like dpkg(1), and even returns roughly the same error messages.

func (Version) Compare

func (a Version) Compare(b Version) int

Compare compares the two provided Debian versions. It returns 0 if a and b are equal, a value < 0 if a is smaller than b and a value > 0 if a is greater than b.

func (*Version) Empty

func (v *Version) Empty() bool

func (*Version) IsNative

func (v *Version) IsNative() bool

func (Version) MarshalText

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

func (Version) String

func (v Version) String() string

func (Version) StringWithoutEpoch

func (v Version) StringWithoutEpoch() string

func (*Version) UnmarshalText

func (version *Version) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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