sysinfo

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0 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

Overview

Package sysinfo is the RemoHop sysinfo service: host handler, client API and CLI.

It answers "what is this machine?" in one request, so an agent or a person can orient themselves on a remote host before running anything else.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(adjust func(*Info)) peer.Handler

Handler is the service with adjust applied to every answer, for a host that knows better than the platform probe: a phone sharing its screen in host mode has no X display or console, yet a desktop to show, and clients open their Desktop tab first where Display is true.

Types

type Info

type Info struct {
	Hostname       string     `json:"hostname"`
	OS             string     `json:"os"`
	Arch           string     `json:"arch"`
	DistroName     string     `json:"distro_name"`
	DistroVersion  string     `json:"distro_version"`
	Kernel         string     `json:"kernel"`
	CPUModel       string     `json:"cpu_model"`
	CPUCores       int        `json:"cpu_cores"`
	MemTotalBytes  uint64     `json:"mem_total_bytes"`
	MemAvailBytes  uint64     `json:"mem_available_bytes"`
	UptimeSeconds  int64      `json:"uptime_seconds"`
	LoadAverage    [3]float64 `json:"load_average"`
	User           string     `json:"user"`
	UID            string     `json:"uid"`
	Home           string     `json:"home"`
	Shell          string     `json:"shell"`
	Cwd            string     `json:"cwd"`
	LocalTime      string     `json:"local_time"`
	Timezone       string     `json:"timezone"`
	RootTotalBytes uint64     `json:"root_total_bytes"`
	RootFreeBytes  uint64     `json:"root_free_bytes"`
	Display        bool       `json:"display"`
	RemoHopVersion string     `json:"remohop_version"`
}

Info describes the machine a host runs on. Fields the platform cannot supply are left zero rather than guessed: the document has the same shape everywhere so agents can parse it without per-OS special cases.

func Get

func Get(ctx context.Context, conn *peer.Conn) (*Info, error)

Get asks the remote host for its description.

Jump to

Keyboard shortcuts

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