utils

package
v0.4.6-beta.6 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindRuntimeVersionDir

func FindRuntimeVersionDir(base string, entries []os.DirEntry, version string) (string, error)

get a runtime version directory

func FormatName

func FormatName(s string) string

func GetDataDir

func GetDataDir() string

func GetRuntimePath

func GetRuntimePath(runtime, version string, tools ...string) (map[string]string, error)

getRuntimePath finds the runtime binary in ~/.version-fox/cache/<runtime>

func GetVfox

func GetVfox() (string, error)

finds vfox executable

func PrintColoredLogLine

func PrintColoredLogLine(line, colorReset, colorRed, colorYellow, colorBlue, colorGray, colorGreen string)

Types

type BlockDevice

type BlockDevice struct {
	Name        string   `json:"name"`
	Size        string   `json:"size"`
	Type        string   `json:"type"`
	Mountpoints []string `json:"mountpoints,omitempty"`
}

type BuildInfo

type BuildInfo struct {
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	BuildDate string `json:"build_date"`
	GoVersion string `json:"go_version"`
}

type DiskUsage

type DiskUsage struct {
	Filesystem string `json:"filesystem"`
	Size       string `json:"size"`
	Used       string `json:"used"`
	Available  string `json:"available"`
	UsePercent string `json:"use_percent"`
	Mountpoint string `json:"mountpoint"`
}

type HardwareInfo

type HardwareInfo struct {
	OS        string  `json:"os"`
	Arch      string  `json:"arch"`
	Kernel    *string `json:"kernel,omitempty"`
	Hostname  *string `json:"hostname,omitempty"`
	CPUCount  int     `json:"cpu_count"`
	MemTotal  *string `json:"mem_total,omitempty"`
	MemUsed   *string `json:"mem_used,omitempty"`
	MemFree   *string `json:"mem_free,omitempty"`
	SwapTotal *string `json:"swap_total,omitempty"`
	SwapUsed  *string `json:"swap_used,omitempty"`
}

type StorageInfo

type StorageInfo struct {
	Partitions []DiskUsage   `json:"partitions,omitempty"`
	Devices    []BlockDevice `json:"devices,omitempty"`
}

type SystemInfo

type SystemInfo struct {
	Build   BuildInfo    `json:"build"`
	HW      HardwareInfo `json:"hardware"`
	Storage StorageInfo  `json:"storage"`
}

func GetSystemInfo

func GetSystemInfo() (SystemInfo, error)

Jump to

Keyboard shortcuts

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