version

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const BuiltForAPIVersion = "v0.531.4"

BuiltForAPIVersion is the server API version this client was built against. Update this constant when updating response structs and command signatures to match a new server API version.

Verification status (see docs/superpowers/specs/2026-07-08-api-drift-audit-findings.md): command coverage is verified and guarded against drift by pkg/game.TestServerCommandsCoveredByClient. Response-struct verification is partial — fields the client reads are verified for every response with a live sample in data/game-api/latest/, but structs lacking a live sample (openapi is an incomplete superset) remain unverified and are itemized in the findings doc.

The v0.473.0 -> v0.495.1 bump (2026-07-13) was driven by a full path- and field-level diff of the openapi snapshots rather than a struct re-audit: it added the espionage command, dropped the removed ShipClass price/ required_skills fields, and picked up the new additive fields. The pre-v0.473.0 drift called out in the findings doc remains unaudited.

The v0.495.1 -> v0.531.4 bump (2026-07-19) added the /shipping freight-carrier client (serverapi shipping structs + GameClient methods). The value tracks server_docs/openapi.20260719.json (x-gameserver-version v0.531.4), the openapi snapshot the shipping structs were built from; the server_docs/openapi.json symlink still points at the older v0.501.0 snapshot (a stale-symlink follow-up, not this constant).

Variables

This section is empty.

Functions

This section is empty.

Types

type SemVer

type SemVer struct {
	Major int
	Minor int
	Patch int
}

SemVer represents a semantic version (Major.Minor.Patch)

func GetDocVersion

func GetDocVersion() (SemVer, error)

GetDocVersion reads and parses the version from server_docs/api.md

func ParseSemVer

func ParseSemVer(s string) (SemVer, error)

ParseSemVer parses a semantic version string like "v0.43.6" or "0.43.6"

func (SemVer) Compare

func (v SemVer) Compare(other SemVer) int

Compare compares two versions and returns the difference Positive values mean v is greater than other, negative means v is less than other

func (SemVer) MinorDiff

func (v SemVer) MinorDiff(other SemVer) int

MinorDiff returns the difference in minor versions

func (SemVer) String

func (v SemVer) String() string

String returns the string representation of the SemVer

type VersionCheck

type VersionCheck struct {
	ServerVersion   SemVer
	ExpectedVersion SemVer
	MajorMismatch   bool
	MinorDiff       int // Difference in minor versions (0 if major differs)
	WarningMessage  string
	ErrorMessage    string
}

VersionCheck holds the result of a version compatibility check

func CheckVersion

func CheckVersion(serverVersionStr string) (*VersionCheck, error)

CheckVersion compares the server version against the version this client was built for. Uses the BuiltForAPIVersion constant, not the server_docs files (which may be newer).

func (*VersionCheck) Banner

func (vc *VersionCheck) Banner() string

Banner returns a multi-line banner for version warnings

func (*VersionCheck) Check

func (vc *VersionCheck) Check() bool

Check returns true if versions are compatible (no major mismatch, minor diff <= 10)

Jump to

Keyboard shortcuts

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