Documentation ¶
Index ¶
- Variables
- func DecodeCharPtr(ptr unsafe.Pointer, len int) string
- func LockMutex()
- func StartsWithLower(str string, substr string) bool
- func UnlockMutex()
- type HWiNFOShMem
- type Header
- func (header *Header) NumReadingElements() int
- func (header *Header) NumSensorElements() int
- func (header *Header) OffsetOfReadingSection() int
- func (header *Header) OffsetOfSensorSection() int
- func (header *Header) PollTime() uint64
- func (header *Header) Revision() int
- func (header *Header) Signature() string
- func (header *Header) SizeOfReadingElement() int
- func (header *Header) SizeOfSensorElement() int
- func (header *Header) Version() int
- type Reading
- func (r *Reading) ID() int32
- func (r *Reading) LabelOrig() string
- func (r *Reading) LabelUser() string
- func (r *Reading) ReadingID() uint64
- func (r *Reading) SensorIndex() uint64
- func (r *Reading) Type() ReadingType
- func (r *Reading) Unit() string
- func (r *Reading) Value() float64
- func (r *Reading) ValueAvg() float64
- func (r *Reading) ValueMax() float64
- func (r *Reading) ValueMin() float64
- type ReadingType
- type Sensor
- type SensorType
- type UnknownError
Constants ¶
This section is empty.
Variables ¶
var ErrFileNotFound = errors.New("could not find HWiNFO shared memory file, is HWiNFO running with Shared Memory Support enabled?")
ErrFileNotFound Windows error
var ErrInvalidHandle = errors.New("could not read HWiNFO shared memory file, is HWiNFO running with Shared Memory Support enabled?")
ErrInvalidHandle Windows error
Functions ¶
func DecodeCharPtr ¶
DecodeCharPtr decodes ISO8859_1 string to UTF-8
func StartsWithLower ¶
Types ¶
type HWiNFOShMem ¶
type HWiNFOShMem struct {
// contains filtered or unexported fields
}
func Read ¶
func Read() (*HWiNFOShMem, error)
func (*HWiNFOShMem) Header ¶
func (shmem *HWiNFOShMem) Header() *Header
func (*HWiNFOShMem) Readings ¶
func (shmem *HWiNFOShMem) Readings() []Reading
func (*HWiNFOShMem) Sensors ¶
func (shmem *HWiNFOShMem) Sensors() []Sensor
func (*HWiNFOShMem) Version ¶
func (shmem *HWiNFOShMem) Version() string
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
func ReadHeader ¶
func (*Header) NumReadingElements ¶
NumReadingElements number of Reading elements
func (*Header) NumSensorElements ¶
NumSensorElements number of sensor elements
func (*Header) OffsetOfReadingSection ¶
OffsetOfReadingSection offset of the Reading section from beginning of HWiNFO_SENSORS_SHARED_MEM2
func (*Header) OffsetOfSensorSection ¶
OffsetOfSensorSection offset of the Sensor section from beginning of HWiNFO_SENSORS_SHARED_MEM2
func (*Header) SizeOfReadingElement ¶
SizeOfReadingElement size of each Reading element = sizeof( HWiNFO_SENSORS_READING_ELEMENT )
func (*Header) SizeOfSensorElement ¶
SizeOfSensorElement size of each sensor element = sizeof( HWiNFO_SENSORS_SENSOR_ELEMENT )
type Reading ¶
type Reading struct {
// contains filtered or unexported fields
}
Reading element (e.g. usage, power, mhz...)
func ReadReadings ¶
func (*Reading) SensorIndex ¶
SensorIndex this is the index of sensor in the Sensors[] array to which this reading belongs to
type ReadingType ¶
type ReadingType int
ReadingType enum of value/unit type for reading
const ( // ReadingTypeNone no type ReadingTypeNone ReadingType = iota // ReadingTypeTemp temperature in celsius ReadingTypeTemp // ReadingTypeVolt voltage ReadingTypeVolt // ReadingTypeFan RPM ReadingTypeFan // ReadingTypeCurrent amps ReadingTypeCurrent // ReadingTypePower watts ReadingTypePower // ReadingTypeClock Mhz ReadingTypeClock // ReadingTypeUsage e.g. MBs ReadingTypeUsage // ReadingTypeOther other ReadingTypeOther )
func (ReadingType) String ¶
func (t ReadingType) String() string
type Sensor ¶
type Sensor struct {
// contains filtered or unexported fields
}
Sensor element (e.g. motherboard, cpu, gpu...)
func ReadSensors ¶
func (*Sensor) SensorInst ¶
SensorInst the instance of the sensor (together with SensorID forms a unique ID)
func (*Sensor) SensorType ¶
func (s *Sensor) SensorType() SensorType
TODO I wish there was a better way to do this, ideally something provided explicitly bw HWiNFO A dynamic value computed by looking at other fields of the sensor
type SensorType ¶
type SensorType string
Type of sensor (the kind of hardware, i.e. cpu, gpu, drive)
const ( System SensorType = "system" CPU SensorType = "cpu" SMART SensorType = "smart" Drive SensorType = "drive" GPU SensorType = "gpu" Network SensorType = "network" Windows SensorType = "windows" MemoryTimings SensorType = "memory-timings" Unknown SensorType = "unknown" )
type UnknownError ¶
type UnknownError struct {
Code uint64
}
UnknownError unhandled Windows error
func (UnknownError) Error ¶
func (e UnknownError) Error() string