summaryrefslogtreecommitdiff
path: root/internal/recordline
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-14 11:37:13 +0300
committerPaul Buetow <paul@buetow.org>2026-04-14 11:37:13 +0300
commit299aa6727025c4f888ec2a38b8945ed39159a99c (patch)
tree8b03f4869f89fb25164f1dcb47213ef7ffeafeb9 /internal/recordline
parenta9a8896a7af324c3588984230d51fe2e15aba30c (diff)
docs: add godoc for exports (ask 04)
Document Record, Open, CreateSchema, ResetRecords, ImportFromDir, LoadRecords in storage; Reporter and reporters in goprecords; Fields and Parse in recordline; Config and Run in daemon. Made-with: Cursor
Diffstat (limited to 'internal/recordline')
-rw-r--r--internal/recordline/recordline.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/recordline/recordline.go b/internal/recordline/recordline.go
index 077fa35..5ff06ab 100644
--- a/internal/recordline/recordline.go
+++ b/internal/recordline/recordline.go
@@ -5,6 +5,7 @@ import (
"strings"
)
+// Fields holds the values parsed from a single uptimed record line.
type Fields struct {
Uptime uint64
BootTime uint64
@@ -13,6 +14,8 @@ type Fields struct {
KernelMajor string
}
+// Parse parses one non-empty line of the form "uptime:boottime:os..." from an
+// uptimed .records file. It returns false if the line is empty or malformed.
func Parse(line string) (Fields, bool) {
line = strings.TrimSpace(line)
if line == "" {