rpmver

package
v1.5.49 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package rpmver implements RPM versioning.

In one place, finally.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b *Version) int

Compare is a comparison for Versions.

Types

type Version

type Version struct {
	Name         *string
	Architecture *string
	Epoch        string
	Version      string
	Release      string
}

Version is a type for representing NEVRA, NEVR, EVR, and EVRA strings.

The stringified version is normalized into a minimal EVR string, with "name" and "architecture" added as available. The Version.EVR method provides for getting only the EVR string.

func Parse

func Parse(v string) (Version, error)

Parse returns a Version for the provided string, or an error if it's malformed.

func (*Version) EVR

func (v *Version) EVR() string

EVR returns a formatted EVR string.

func (*Version) IsZero

func (v *Version) IsZero() bool

IsZero reports true if the receiver is a zero-valued Version.

func (*Version) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*Version) String

func (v *Version) String() string

String implements fmt.Stringer.

func (*Version) UnmarshalText

func (v *Version) UnmarshalText(text []byte) (err error)

UnmarshalText implements encoding.TextUnmarshaler.

Jump to

Keyboard shortcuts

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