sensors

package
v12.96.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package sensors provide methods for collecting sensors information

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	Name        string
	TempSensors []TempSensor
}

Device contains info from different device sensors

func Collect

func Collect() ([]*Device, error)

Collect collects sensors information https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface

func (*Device) Temperature

func (d *Device) Temperature() (float64, float64, float64)

Temperature returns min, max and average temperature

type TempSensor

type TempSensor struct {
	Name string
	Cur  float64
	Min  float64
	Max  float64
	Crit float64
}

TempSensor contains info from temperature sensor

func (TempSensor) String

func (s TempSensor) String() string

String formats sensor data as a string

Jump to

Keyboard shortcuts

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