version

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 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

This section is empty.

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 documented API version

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