hostinfo

package
v0.3.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package hostinfo provides functionality for getting data about the host system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostInfo

type HostInfo struct {
	OS     string
	Arch   string
	Kernel string
}

HostInfo holds the determined host information values.

func Get

func Get(i Input) (HostInfo, error)

Get returns a populated HostInfo, based on the provided Input mappings.

type Input

type Input struct {
	// The name a tool uses for Linux OSes (e.g. "linux", "unknown", etc.)
	OSLinux string
	// The name a tool uses for the Linux kernel (e.g. "linux", "linux-gnu", etc.)
	KernelLinux string
	// The name a tool uses for macOS (e.g. "apple")
	OSMacOS string
	// The name a tool uses for the macOS kernel (e.g. "darwin")
	KernelMacOS string
	// The name a tool uses for AMD64 architectures (e.g. "x86_64", "amd64", etc.)
	ArchAMD64 string
	// The name a tool uses for ARM64 architectures (e.g. "aarch64", "arm64", etc.)
	ArchARM64 string
}

Input allows different tools to specify the different possible values for their host-related information. This is primarily used when downloading a release artifact. This is necessary to provide because different tools use different values for their host info. For example:

  • Some tools use "x86_64" for CPU architecture, while some use "amd64", and others even use "x64"
  • In addition to a kernel ID, some tools additionally specify an OS value (e.g. both "darwin" and "macos")

Jump to

Keyboard shortcuts

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