version

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodeAgent = Agent{
	Version:         NodeVersion(),
	ProtocolVersion: protocol.ProtocolVersionLatest,
	OS:              runtime.GOOS,
	Arch:            runtime.GOARCH,
}

Functions

This section is empty.

Types

type Agent

type Agent struct {
	AppType         string
	Version         Version
	ProtocolVersion protocol.Version
	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   `json:"major"` // Major version number
	Minor uint   `json:"minor"` // Minor version number
	Patch uint   `json:"patch"` // Patch version number
	Meta  string `json:"meta"`  // Metadata for version (e.g., "beta", "rc1")
	Alias string `json:"alias"` // Alias for version (e.g., "London")
}

Version defines the version of the Pactus software. It follows the Semantic Versioning 2.0.0 spec: http://semver.org/.

Update this struct with each new release by adjusting the Major, Minor, or Patch numbers. For major releases, clear the Meta field (set to an empty string). Use the Meta field to indicate pre-release stages, such as "rc1", "rc2", or "beta" during development.

func NodeVersion added in v1.1.1

func NodeVersion() Version

NodeVersion represents the current version of the node software.

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.

func (Version) StringWithAlias added in v1.2.0

func (v Version) StringWithAlias() string

StringWithAlias returns a string representation of the Version object with the alias.

Jump to

Keyboard shortcuts

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