Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: common/logdog/protocol/butler.pb.go

Issue 1272893004: LogDog: Update protobufs, add support library. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Update types. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: common/logdog/protocol/butler.pb.go
diff --git a/common/logdog/protocol/butler.pb.go b/common/logdog/protocol/butler.pb.go
index 5194d6490f382b2a6001c4084da0dc33aa09f895..506832ecdc1828e4f7e3da1bec693a9e3835e25e 100644
--- a/common/logdog/protocol/butler.pb.go
+++ b/common/logdog/protocol/butler.pb.go
@@ -12,6 +12,68 @@ var _ = proto.Marshal
var _ = math.Inf
//
+// This enumerates the possible contents of published Butler data.
+type ButlerMetadata_ContentType int32
+
+const (
+ // The published data is a ButlerLogBundle protobuf message.
+ ButlerMetadata_ButlerLogBundle ButlerMetadata_ContentType = 1
+)
+
+var ButlerMetadata_ContentType_name = map[int32]string{
+ 1: "ButlerLogBundle",
+}
+var ButlerMetadata_ContentType_value = map[string]int32{
+ "ButlerLogBundle": 1,
+}
+
+func (x ButlerMetadata_ContentType) Enum() *ButlerMetadata_ContentType {
+ p := new(ButlerMetadata_ContentType)
+ *p = x
+ return p
+}
+func (x ButlerMetadata_ContentType) String() string {
+ return proto.EnumName(ButlerMetadata_ContentType_name, int32(x))
+}
+func (x *ButlerMetadata_ContentType) UnmarshalJSON(data []byte) error {
+ value, err := proto.UnmarshalJSONEnum(ButlerMetadata_ContentType_value, data, "ButlerMetadata_ContentType")
+ if err != nil {
+ return err
+ }
+ *x = ButlerMetadata_ContentType(value)
+ return nil
+}
+
+//
+// ButlerMetadata appears as a frame at the beginning of Butler published data
+// to describe the remainder of the contents.
+type ButlerMetadata struct {
+ // This is the type of data in the subsequent frame.
+ Type *ButlerMetadata_ContentType `protobuf:"varint,1,opt,name=type,enum=protocol.ButlerMetadata_ContentType" json:"type,omitempty"`
+ // If true, the content data is compressed.
+ Compressed *bool `protobuf:"varint,2,opt,name=compressed" json:"compressed,omitempty"`
+ XXX_unrecognized []byte `json:"-"`
+}
+
+func (m *ButlerMetadata) Reset() { *m = ButlerMetadata{} }
+func (m *ButlerMetadata) String() string { return proto.CompactTextString(m) }
+func (*ButlerMetadata) ProtoMessage() {}
+
+func (m *ButlerMetadata) GetType() ButlerMetadata_ContentType {
+ if m != nil && m.Type != nil {
+ return *m.Type
+ }
+ return ButlerMetadata_ButlerLogBundle
+}
+
+func (m *ButlerMetadata) GetCompressed() bool {
+ if m != nil && m.Compressed != nil {
+ return *m.Compressed
+ }
+ return false
+}
+
+//
// A message containing log data in transit from the Butler.
//
// The Butler is capable of conserving bandwidth by bundling collected log
@@ -34,9 +96,23 @@ type ButlerLogBundle struct {
//
// This field will be used for debugging and internal accounting.
Timestamp *Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp,omitempty"`
+ //
+ // The log stream's secret value (required).
+ //
+ // The secret is generated by the Butler and unique to this specific log
+ // stream. The Coordinator will record the secret associated with a given
+ // log Prefix/Stream, but will not share the secret with a client.
+ //
+ // The Collector will check the secret prior to ingesting logs. If the
+ // secret doesn't match the value recorded by the Coordinator, the log
+ // will be discarded.
+ //
+ // This ensures that only the Butler instance that generated the log stream
+ // can emit log data for that stream.
+ Secret []byte `protobuf:"bytes,3,opt,name=secret" json:"secret,omitempty"`
// *
// Each Entry is an individual set of log records for a given log stream.
- Entries []*ButlerLogBundle_Entry `protobuf:"bytes,5,rep,name=entries" json:"entries,omitempty"`
+ Entries []*ButlerLogBundle_Entry `protobuf:"bytes,4,rep,name=entries" json:"entries,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
@@ -58,6 +134,13 @@ func (m *ButlerLogBundle) GetTimestamp() *Timestamp {
return nil
}
+func (m *ButlerLogBundle) GetSecret() []byte {
+ if m != nil {
+ return m.Secret
+ }
+ return nil
+}
+
func (m *ButlerLogBundle) GetEntries() []*ButlerLogBundle_Entry {
if m != nil {
return m.Entries
@@ -75,20 +158,6 @@ type ButlerLogBundle_Entry struct {
// Each LogEntry in the "logs" field is shares this common descriptor.
Desc *LogStreamDescriptor `protobuf:"bytes,1,opt,name=desc" json:"desc,omitempty"`
//
- // The log stream's secret value (required).
- //
- // The secret is generated by the Butler and unique to this specific log
- // stream. The Coordinator will record the secret associated with a given
- // log Prefix/Stream, but will not share the secret with a client.
- //
- // The Collector will check the secret prior to ingesting logs. If the
- // secret doesn't match the value recorded by the Coordinator, the log
- // will be discarded.
- //
- // This ensures that only the Butler instance that generated the log stream
- // can emit log data for that stream.
- Secret []byte `protobuf:"bytes,2,opt,name=secret" json:"secret,omitempty"`
- //
// Whether this log entry terminates its stream.
//
// If present and "true", this field declares that this Entry is the last
@@ -101,11 +170,15 @@ type ButlerLogBundle_Entry struct {
// exceeding the terminal log's index will be discarded.
Terminal *bool `protobuf:"varint,3,opt,name=terminal" json:"terminal,omitempty"`
//
+ // If terminal is true, this is the terminal stream index; that is, the last
+ // message index in the stream.
+ TerminalIndex *uint32 `protobuf:"varint,4,opt,name=terminal_index" json:"terminal_index,omitempty"`
+ //
// Log entries attached to this record. These must be sequential and in
// order.
//
// This is the main log entry content.
- Logs []*LogEntry `protobuf:"bytes,4,rep,name=logs" json:"logs,omitempty"`
+ Logs []*LogEntry `protobuf:"bytes,5,rep,name=logs" json:"logs,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
@@ -120,13 +193,6 @@ func (m *ButlerLogBundle_Entry) GetDesc() *LogStreamDescriptor {
return nil
}
-func (m *ButlerLogBundle_Entry) GetSecret() []byte {
- if m != nil {
- return m.Secret
- }
- return nil
-}
-
func (m *ButlerLogBundle_Entry) GetTerminal() bool {
if m != nil && m.Terminal != nil {
return *m.Terminal
@@ -134,6 +200,13 @@ func (m *ButlerLogBundle_Entry) GetTerminal() bool {
return false
}
+func (m *ButlerLogBundle_Entry) GetTerminalIndex() uint32 {
+ if m != nil && m.TerminalIndex != nil {
+ return *m.TerminalIndex
+ }
+ return 0
+}
+
func (m *ButlerLogBundle_Entry) GetLogs() []*LogEntry {
if m != nil {
return m.Logs
@@ -142,4 +215,5 @@ func (m *ButlerLogBundle_Entry) GetLogs() []*LogEntry {
}
func init() {
+ proto.RegisterEnum("protocol.ButlerMetadata_ContentType", ButlerMetadata_ContentType_name, ButlerMetadata_ContentType_value)
}

Powered by Google App Engine
This is Rietveld 408576698