version

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultVersionFile = "version.txt"

DefaultVersionFile is the default path for the version file

Variables

This section is empty.

Functions

func Write

func Write(v Version) error

Write writes the version to the default version file

func WriteToFile

func WriteToFile(v Version, filepath string) error

WriteToFile writes the version to the specified file path

Types

type Version

type Version struct {
	Major int
	Minor int
	Patch int
}

Version represents the version of a service

func Read

func Read() (Version, error)

Read reads the version from the default version file

func ReadFromFile

func ReadFromFile(filepath string) (Version, error)

ReadFromFile reads the version from the specified file path

func (*Version) Increment

func (v *Version) Increment(level string) error

Increment increments the version

func (Version) String

func (v Version) String() string

String returns the version as a string

Jump to

Keyboard shortcuts

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