Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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
ParseAgent parses a string into an Agent struct.
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
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
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
String returns a string representation of the Version object.
func (Version) StringWithAlias ¶ added in v1.2.0
StringWithAlias returns a string representation of the Version object with the alias.