machine

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetActiveHddSerial

func GetActiveHddSerial() (string, error)

GetActiveHddSerial get active hard disk serial

func GetBiosId

func GetBiosId() (string, error)

GetBiosId get bios id

func GetCPUModel

func GetCPUModel() ([]cpu.InfoStat, error)

GetCPUModel return cpu model

func UniqueHwID

func UniqueHwID() (string, error)

UniqueHwID generates unique hardware id

Types

type CPU

type CPU struct {
	Cores []float64
	Total float64
}

CPU cpu information

func GetCPU

func GetCPU(interval time.Duration) (CPU, error)

GetCPU return cpu usage

type DiskDrive

type DiskDrive struct {
	Caption      string `json:"name"`
	DeviceID     string `json:"device_id"`
	Model        string `json:"model"`
	Partitions   uint   `json:"partitions"`
	Size         uint64 `json:"size"`
	SerialNumber string `json:"serial_number"`
	Active       bool   `json:"active"`
}

DiskDrive disk drive info struct

func GetActiveHardDisk

func GetActiveHardDisk() DiskDrive

GetActiveHardDisk get active hard disk

func GetHardDisks

func GetHardDisks() ([]DiskDrive, error)

GetHardDisks get list of hard disks

type Memory

type Memory struct {
	Total       uint64
	Free        uint64
	Used        uint64
	UsedPercent float64
}

Memory memory information

func GetMemory

func GetMemory() (Memory, error)

GetMemory get memory information

type Partition

type Partition struct {
	Name               string  `json:"name" csv:"DeviceID"`
	FileSystem         string  `json:"file_system"`
	Size               uint64  `json:"size"`
	FreeSpace          uint64  `json:"free_space"`
	UsedSpace          uint64  `json:"used_space"`
	FreeSpacePercent   float64 `json:"free_space_percent"`
	VolumeSerialNumber string  `json:"volume_serial_number"`
	Active             bool    `json:"active"`
}

Partition partition info struct

func GetActivePartition

func GetActivePartition() (Partition, error)

GetActivePartition get active partition

func GetPartitions

func GetPartitions() ([]Partition, error)

GetPartitions get list of partitions

Jump to

Keyboard shortcuts

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