introduce basic fact collection

This commit is contained in:
2025-07-20 23:14:21 -04:00
parent 62336753c6
commit 3a47fa6706
58 changed files with 2801 additions and 107 deletions

26
client/vendor/github.com/zcalusic/sysinfo/util.go generated vendored Normal file
View File

@@ -0,0 +1,26 @@
// Copyright © 2016 Zlatko Čalušić
//
// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
package sysinfo
import (
"os"
"strings"
)
// Read one-liner text files, strip newline.
func slurpFile(path string) string {
data, err := os.ReadFile(path)
if err != nil {
return ""
}
// Trim spaces & \u0000 \uffff
return strings.Trim(string(data), " \r\n\t\u0000\uffff")
}
// Write one-liner text files, add newline, ignore errors (best effort).
func spewFile(path string, data string, perm os.FileMode) {
_ = os.WriteFile(path, []byte(data+"\n"), perm)
}