hostinfo

package
v0.48.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package hostinfo provides high-level details about the runtime OS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// The platform is a high-level description of the OS. This maps to GOOS.
	Platform string `json:"platform" yaml:"platform"`

	// Arch maps to runtime.
	Arch string `json:"arch" yaml:"arch"`

	// The name of the kernel used by the operating system.
	Kernel string `json:"kernel,omitempty" yaml:"kernel,omitempty"`

	// The specific version of the kernel.
	KernelVersion string `json:"kernel_version,omitempty" yaml:"kernel_version,omitempty"`

	// The variant or distribution of the kernel.
	Variant string `json:"variant,omitempty" yaml:"variant,omitempty"`

	// The version of the variant.
	VariantVersion string `json:"variant_version,omitempty" yaml:"variant_version,omitempty"`
}

Info encapsulates OS info.

func Get

func Get() Info

Get returns system information. At a minimum, Info.Platform and Info.Arch are guaranteed to be populated.

func (Info) LogValue

func (si Info) LogValue() slog.Value

LogValue implements slog.LogValuer.

func (Info) String

func (si Info) String() string

String returns a log-debug friendly representation.

Jump to

Keyboard shortcuts

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