version

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package version provides version management and compatibility checking for upterm/uptermd.

This package centralizes version handling across the upterm ecosystem, including:

  • Single source of truth for version constants
  • Semantic version parsing and comparison
  • SSH server version extraction and validation
  • Host/server compatibility checking with detailed results

The main entry point is CheckCompatibility() which compares the current host version with a server's SSH version string and returns detailed compatibility information.

Example usage:

result := version.CheckCompatibility("SSH-2.0-uptermd-0.14.3")
if !result.Compatible {
    fmt.Printf("Warning: %s\n", result.Message)
    fmt.Printf("Host: %s, Server: %s\n", result.HostVersion, result.ServerVersion)
}

Index

Constants

View Source
const Version = "0.15.0"

Version is the semantic version of upterm/uptermd This is the single source of truth for both client and server versions

Variables

This section is empty.

Functions

func Current

func Current() *version.Version

Current returns the current version as a parsed version object Panics if Version constant is not a valid semantic version

func Parse

func Parse(v string) (*version.Version, error)

Parse parses a version string using hashicorp's go-version library

func ParseFromSSHVersion

func ParseFromSSHVersion(sshVersion string) (*version.Version, error)

ParseFromSSHVersion extracts version from SSH version strings like "SSH-2.0-uptermd-0.14.3" Uses regex for precise parsing and supports complex semantic versions like "1.0.0-beta.1+build.123"

func ServerSSHVersion

func ServerSSHVersion() string

ServerSSHVersion returns the SSH server version string with embedded version

func String

func String() string

String returns the current version as a string

Types

type CompatibilityResult

type CompatibilityResult struct {
	Compatible    bool
	HostVersion   string
	ServerVersion string
	Message       string
}

CompatibilityResult contains the result of version compatibility checking

func CheckCompatibility

func CheckCompatibility(sshVersion string) *CompatibilityResult

CheckCompatibility checks if the server version is compatible with the current host version Always returns a result - Compatible=false for unparseable server versions to indicate incompatibility

Jump to

Keyboard shortcuts

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