version

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 5 Imported by: 0

README

git.sa-roci.de/oss/go_version

A module with a definition for serialisable basic version strings.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	Major    uint `json:"major"`
	Minor    uint `json:"minor"`
	Revision uint `json:"revision"`
	Build    uint `json:"build"`
}

Version defines a structure describing the version of a program or module.

func ParseVersion

func ParseVersion(text string) (Version, error)

ParseVersion tries to read all available parts of a version string

func (Version) Equal

func (version Version) Equal(comparand Version) bool

Equal verifies, whether two Versions are the same

func (Version) Larger

func (version Version) Larger(comparand Version) bool

Larger verifies, whether the Version is larger than the comparand

func (Version) MarshalJSON

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

MarshalJSON satisfies the json.Marshaler interface

func (Version) MarshalXML

func (version Version) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)

MarshalXML satisfies the xml.Marshaler interface

func (*Version) Parse

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

Parse tries to read all available parts of a version string to the internal variables

func (Version) Smaller

func (version Version) Smaller(comparand Version) bool

Smaller verifies, whether the Version is smaller than the comparand

func (Version) SpecificString

func (version Version) SpecificString(numberOfComponents int) string

SpecificString converts a Version into its string representation with either the specified number of components ([1,4]) or its generic string representation

func (Version) String

func (version Version) String() string

String converts a Version into its generic string representation

func (*Version) UnmarshalJSON

func (version *Version) UnmarshalJSON(data []byte) error

UnmarshalJSON satisfies the json.Unmarshaler interface

func (*Version) UnmarshalXML

func (version *Version) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML satisfies the xml.Unmarshaler interface

Jump to

Keyboard shortcuts

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