facts

package
v0.0.0-...-d58b5d9 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package facts provides facts about the system

Index

Constants

This section is empty.

Variables

View Source
var Facts facts

Facts holds facts about the system

Functions

func DistroAlpine

func DistroAlpine() bool

DistroAlpine - return true if we are on alpine distro

func DistroUbuntu

func DistroUbuntu() bool

DistroUbuntu - return true if we are on a Ubuntu distro

func GetCPUInfo

func GetCPUInfo()

GetCPUInfo - fill in CPUInfo struct

func GetStorageFactsInfo

func GetStorageFactsInfo()

func GetSystemUUID

func GetSystemUUID() string

GetSystemUUID - return/fill in the system UUID TODO if we can't find one, generate our own and store it in our cache dir

Types

type CPUInfoFacts

type CPUInfoFacts struct {
	Arch         string // amd64/etc
	ArchArch     string // x86_64/etc (i.e. the output you'd get from the arch binary)
	FeatureLevel string // v1/v2/v3/v4 equivalent to $GOAMD64 TODO
	Vendor       string
	Model        string
	Cores        int
	Threads      int
	Flags        []string
}

CPUInfoFacts - info about the CPU(s) in the system

type DiskInfo

type DiskInfo struct {
	Name       string // (sda, nvme0, vda, etc)
	MountPoint string // where it's mounted
}

type DistroFacts

type DistroFacts struct {
	Name       string
	Slug       string
	Family     string
	Version    string
	Codename   string
	InitSystem string
}

DistroFacts - holds distro information

type NetworkFacts

type NetworkFacts struct {
	Interfaces []net.Interface
}

NetworkFacts contains facts about the network

type ServiceFacts

type ServiceFacts struct {
	InstalledServices []string
	RunningServices   []string
}

ServiceFacts contains facts about the system services

type StorageFacts

type StorageFacts struct {
	LocalDisks []DiskInfo // list of local disks

}

func (*StorageFacts) GetRoot

func (f *StorageFacts) GetRoot() (*DiskInfo, error)

Jump to

Keyboard shortcuts

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