Documentation
¶
Index ¶
- Constants
- Variables
- func CSRFromKeyFile(keyFile, subject string) ([]byte, error)
- func CertPoolFromFiles(files ...string) (*x509.CertPool, []byte, error)
- func Chmod(name string, mode fs.FileMode) error
- func ConcatStringSlice(slices ...[]string) []string
- func CopyFile(src, dst string) error
- func FileExists(path string) bool
- func FileNotExists(path string) bool
- func GeneratePrivateKeyIfNotExists(keyFile string) error
- type CommandArgs
- type CommandResult
Constants ¶
const ( Ok = 0 Warning = 1 Critical = 2 Unknown = 3 Timeout = 124 NotExecutable = 126 NotFound = 127 )
Unified exit codes
Variables ¶
var SmcSensorNames = map[string]string{
"TA0P": "Ambient 1",
"TA1P": "Ambient 2",
"TC0D": "CPU 0 Diode",
"TC0H": "CPU 0 Heatsink",
"TC0P": "CPU 0 Proximity",
"TB0T": "Battery",
"TB1T": "Battery 1",
"TB2T": "Battery 2",
"TB3T": "Battery",
"TG0D": "GPU 0 Diode",
"TG0H": "GPU 0 Heatsink",
"TG0P": "GPU 0 Proximity",
"TH0P": "TH0P Bay 1",
"TM0S": "Memory Module 0",
"TM0P": "Mainboard Proximity",
"TN0H": "Northbridge Heatsink",
"TN0D": "Northbridge Diode",
"TN0P": "Northbridge Proximity",
"TI0P": "Thunderbolt 0",
"TI1P": "Thunderbolt 1",
"TW0P": "Airport Proximity",
}
SmcSensorNames maps the names from the SMC chip to human readable names this list is taken from: https://github.com/shirou/gopsutil/blob/a1e77476b2bb7bbe6130fa1cbc39fe1635ff459c/v3/host/smc_darwin.h#L6-L26 Also a good source is: https://superuser.com/a/967056 or maybe https://github.com/dkorunic/iSMC
Functions ¶
func CSRFromKeyFile ¶
CSRFromKeyFile reads keyFile and generates a csr in PEM format
func CertPoolFromFiles ¶
CertPoolFromFiles reads listed file names and returns the certpool for ca or other usage
func Chmod ¶
On Linux and macOS this is func just calls os.Chmod. This is only important for Windows systems
func ConcatStringSlice ¶
func FileExists ¶
func FileNotExists ¶
func GeneratePrivateKeyIfNotExists ¶
GeneratePrivateKeyIfNotExists checks for keyFile and if it does not exist generates a rsa 4096 bits key
Types ¶
type CommandArgs ¶
type CommandResult ¶
type CommandResult struct { Stdout string `json:"stdout"` RC int `json:"rc"` ExecutionUnixTimestampSec int64 `json:"execution_unix_timestamp_sec"` }
CommandResult to return the information
func RunCommand ¶
func RunCommand(ctx context.Context, commandArgs CommandArgs) (*CommandResult, error)
RunCommand in shell style with timeout on every platform