dmi

package
v0.0.0-...-b79a0d8 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package dmi reads DMI (aka SMBIOS) data via dmidecode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear()

func Dump

func Dump()

Run dmidecode to dump all entries found. Not cached.

func Entries

func Entries(dmiType int) []byte

Return all entries for a given dmi type, same format as produced by 'dmidecode -t <n>'.

func Field

func Field(dmiType int, fieldName string) (field string)

return data for line matching fieldName in given struct type fieldName must be all non-whitespace chars at beginning of desired line, i.e. "SKU Number:". Using "SKU" would result in the returned string beginning with "Number: "

func FieldN

func FieldN(dmiType, entry int, fieldName string) (field string)

Nth entry for a particular type, with N starting at 0

func String

func String(key string) string

Returns the result of 'dmidecode -s <key>'

func TestingMock

func TestingMock(s DmiStrMap, t DmiTypeMap)

effectively mocks this package by pre-populating the cache and only allowing cache lookups

Types

type DmiStrMap

type DmiStrMap map[string]string

type DmiTypeMap

type DmiTypeMap map[int][]byte

Jump to

Keyboard shortcuts

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