version

package
v7.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: GPL-3.0 Imports: 10 Imported by: 6

Documentation

Overview

Package version executes and returns the version string for the currently running process.

Index

Constants

View Source
const (
	Phase0 = iota
	Altair
	Bellatrix
	Capella
	Deneb
	Electra
	Fulu
	Gloas
)

Variables

View Source
var ErrUnrecognizedVersionName = errors.New("version name doesn't map to a known value in the enum")

ErrUnrecognizedVersionName means a string does not match the list of canonical version names.

Functions

func All

func All() []int

All returns a list of all supported fork versions.

func BuildData

func BuildData() string

BuildData returns the git tag and commit of the current build.

func FromString

func FromString(name string) (int, error)

FromString translates a canonical version name to the version number.

func GetCommitPrefix added in v7.1.4

func GetCommitPrefix() string

GetCommitPrefix returns the first 4 characters of the git commit. This is used for graffiti generation per the client identification spec. Note: BuildData() must be called before this (happens at startup via Version()).

func GitCommit added in v7.1.4

func GitCommit() string

GitCommit returns the current build commit hash.

func IsUnsupported added in v7.1.0

func IsUnsupported(version int) bool

IsUnsupported reports whether the provided version is currently gate-kept.

func SemanticVersion

func SemanticVersion() string

SemanticVersion returns the Major.Minor.Patch version of this build.

func String

func String(version int) string

String returns the canonical string form of a version. Unrecognized versions won't generate an error and are represented by the string "unknown version".

func Version

func Version() string

Version returns the version string of this build.

Types

This section is empty.

Jump to

Keyboard shortcuts

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