osbase/logtree: add WithStartPosition option
To allow users to not always request all messages,
we introduce another option to the logtree.LogReader
which allows for starting at a specific global log id.
This, for example, makes implementing scrollback easier.
Change-Id: I1773288f670f476706d94baf3f052fe1e5da9eb0
Reviewed-on: https://review.monogon.dev/c/monogon/+/4452
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/osbase/logtree/logtree_entry.go b/osbase/logtree/logtree_entry.go
index 833081f..a434d08 100644
--- a/osbase/logtree/logtree_entry.go
+++ b/osbase/logtree/logtree_entry.go
@@ -23,6 +23,9 @@
Raw *logbuffer.Line
// DN from which this entry was logged.
DN DN
+ // Position of this entry in the global journal. This is only available
+ // locally and is not set if the entry was obtained via protobuf.
+ Position int
}
// String returns a canonical representation of this payload as a single string