version

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodeAgent = Agent{
	Version:         NodeVersion,
	ProtocolVersion: 1,
	OS:              runtime.GOOS,
	Arch:            runtime.GOARCH,
}
View Source
var NodeVersion = Version{
	Major: 1,
	Minor: 1,
	Patch: 7,
	Meta:  "",
}

NodeVersion represents the current version of the node software. It should be updated with each new release, adjusting the Major, Minor, or Patch version numbers as necessary. When a major release occurs, the Meta field should be cleared (set to an empty string). For release candidates, set the Meta field to "rc1", "rc2", and so on. During development, set the Meta field to "beta".

Functions

This section is empty.

Types

type Agent

type Agent struct {
	AppType         string
	Version         Version
	ProtocolVersion uint
	OS              string
	Arch            string
}

func ParseAgent added in v1.1.1

func ParseAgent(agentStr string) (Agent, error)

ParseAgent parses a string into an Agent struct.

func (*Agent) String added in v1.1.1

func (a *Agent) String() string

type Version

type Version struct {
	Major uint   // Major version number
	Minor uint   // Minor version number
	Patch uint   // Patch version number
	Meta  string // Metadata for version (e.g., "beta", "rc1")
}

These struct follow the semantic versioning 2.0.0 spec (http://semver.org/)

func ParseVersion added in v1.1.1

func ParseVersion(versionStr string) (Version, error)

ParseVersion parses a version string into a Version struct. The format should be "Major.Minor.Patch-Meta", where Meta is optional. Returns the parsed Version struct and an error if parsing fails.

func (Version) Compare added in v1.1.1

func (v Version) Compare(other Version) int

Compare compares the current version (v) with another version (other) and returns:

-1 if v < other
 0 if v == other
 1 if v > other

func (Version) String added in v1.1.1

func (v Version) String() string

String returns a string representation of the Version object.

Jump to

Keyboard shortcuts

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