metropolis/proto: move log-related types to common
Having them in API is kinda weird, especially as we're
generating/parsing them from a few libraries already.
Change-Id: I87b4b51f151443c60b87e3e50753c395fcf6e845
Reviewed-on: https://review.monogon.dev/c/monogon/+/1437
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/pkg/logbuffer/linebuffer.go b/metropolis/pkg/logbuffer/linebuffer.go
index 6fd9a62..16f7b1a 100644
--- a/metropolis/pkg/logbuffer/linebuffer.go
+++ b/metropolis/pkg/logbuffer/linebuffer.go
@@ -22,7 +22,7 @@
"strings"
"sync"
- apb "source.monogon.dev/metropolis/proto/api"
+ cpb "source.monogon.dev/metropolis/proto/common"
)
// 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() *apb.LogEntry_Raw {
- return &apb.LogEntry_Raw{
+func (l *Line) ProtoLog() *cpb.LogEntry_Raw {
+ return &cpb.LogEntry_Raw{
Data: l.Data,
OriginalLength: int64(l.OriginalLength),
}
}
// LineFromLogProto converts a Logging-specific protobuf message back into a Line.
-func LineFromLogProto(raw *apb.LogEntry_Raw) (*Line, error) {
+func LineFromLogProto(raw *cpb.LogEntry_Raw) (*Line, error) {
if raw.OriginalLength < int64(len(raw.Data)) {
return nil, fmt.Errorf("original_length smaller than length of data")
}