metropolis/pkg/logtree: move logtree protobuf definition to logtree pkg
Before this change we had the LogEntry message inside the metropolis
common proto file. This splits it out into the logtree package to make
it standalone in a future change.
Change-Id: Idb26a829d6174efa946a6c4ce0f1b984cb2f18a2
Reviewed-on: https://review.monogon.dev/c/monogon/+/3080
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/pkg/logbuffer/linebuffer.go b/metropolis/pkg/logbuffer/linebuffer.go
index 92b70e9..3892e0c 100644
--- a/metropolis/pkg/logbuffer/linebuffer.go
+++ b/metropolis/pkg/logbuffer/linebuffer.go
@@ -22,7 +22,7 @@
"strings"
"sync"
- cpb "source.monogon.dev/metropolis/proto/common"
+ lpb "source.monogon.dev/metropolis/pkg/logtree/proto"
)
// Line is a line stored in the log buffer - a string, that has been perhaps
@@ -47,15 +47,15 @@
}
// ProtoLog returns a Logging-specific protobuf structure.
-func (l *Line) ProtoLog() *cpb.LogEntry_Raw {
- return &cpb.LogEntry_Raw{
+func (l *Line) ProtoLog() *lpb.LogEntry_Raw {
+ return &lpb.LogEntry_Raw{
Data: l.Data,
OriginalLength: int64(l.OriginalLength),
}
}
// LineFromLogProto converts a Logging-specific protobuf message back into a Line.
-func LineFromLogProto(raw *cpb.LogEntry_Raw) (*Line, error) {
+func LineFromLogProto(raw *lpb.LogEntry_Raw) (*Line, error) {
if raw.OriginalLength < int64(len(raw.Data)) {
return nil, fmt.Errorf("original_length smaller than length of data")
}