versioned

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 2 Imported by: 0

README

Versioned Go

A simple version interface for Go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	// contains filtered or unexported fields
}

Versioned is an interface for versioned objects

func NewVersion

func NewVersion(s string) *Version

NewVersion creates a new version from a string

func (*Version) Compare

func (v *Version) Compare(v2 *Version) int

Compare compares two versions and returns 1 if v is greater than v2, -1 if v is less than v2, and 0 if they are equal

func (*Version) Decrement

func (v *Version) Decrement()

Decrement decrements the version by 1

func (*Version) Increment

func (v *Version) Increment()

Increment increments the version by 1

func (*Version) Int

func (v *Version) Int() int

Int returns the integer representation of the version

func (*Version) String

func (v *Version) String() string

String returns the string representation of the version

Jump to

Keyboard shortcuts

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