From 04d3492b7e51313b06b80228e7b4fbd0d36ca4d6 Mon Sep 17 00:00:00 2001 From: Dan Sexton Date: Tue, 20 Dec 2022 13:03:05 -0500 Subject: [PATCH] fix: added examples and fixes for maps --- .../templates/fieldsnippets.tmpl | 50 +- ...ogo_permessage_example_allthemaps.pb.fm.go | 92 +- .../googlev1_permessage_example.pb.go | 2 +- ...ev1_permessage_example_allthemaps.pb.fm.go | 92 +- .../googlev2_permessage_example.pb.go | 4 +- ...ev2_permessage_example_allthemaps.pb.fm.go | 92 +- .../googlev1/googlev1_proto2_example.pb.go | 2 +- .../googlev2/googlev2_proto2_example.pb.go | 4 +- .../googlev1/googlev1_proto3_example.pb.go | 2 +- .../googlev2/googlev2_proto3_example.pb.fm.go | 1127 +++++++++++++++++ .../googlev2/googlev2_proto3_example.pb.go | 740 ++++++++--- .../googlev2/googlev2_proto3_example.proto | 30 +- 12 files changed, 1914 insertions(+), 323 deletions(-) diff --git a/cmd/protoc-gen-fastmarshal/templates/fieldsnippets.tmpl b/cmd/protoc-gen-fastmarshal/templates/fieldsnippets.tmpl index 045918c..42a754b 100644 --- a/cmd/protoc-gen-fastmarshal/templates/fieldsnippets.tmpl +++ b/cmd/protoc-gen-fastmarshal/templates/fieldsnippets.tmpl @@ -145,14 +145,19 @@ // size of key (always has an internal tag of 1) {{ if eq (.Kind | string) "int32" "int64" "uint32" "uint64" -}} keySize := 1 + csproto.SizeOfVarint(uint64(k)) + {{- else if eq (.Kind | string) "bool" -}} + _ = k + keySize := 1 + 1 {{- else if eq (.Kind | string) "string" -}} l = len(k) keySize := 1 + csproto.SizeOfVarint(uint64(l)) + l {{- else if eq (.Kind | string) "sint32" "sint64" -}} keySize := 1 + csproto.SizeOfZigZag(uint64(k)) {{- else if eq (.Kind | string) "fixed32" "sfixed32" -}} + _ = k keySize := 5 {{- else if eq (.Kind | string) "fixed64" "sfixed64" -}} + _ = k keySize := 9 {{- else -}} panic(fmt.Errorf("unknown/unsupported Protobuf field kind '{{.Kind | string}}' for map key for field {{$mapField.Name}} (tag={{$mapDesc.Number}})")) @@ -163,6 +168,10 @@ {{ if eq (.Kind | string) "int32" "int64" "uint32" "uint64" "enum" -}} valueSize := 1 + csproto.SizeOfVarint(uint64(v)) sz += csproto.SizeOfTagKey({{$mapDesc.Number}}) + csproto.SizeOfVarint(uint64(keySize + valueSize)) + keySize + valueSize + {{- else if eq (.Kind | string) "bool" -}} + _ = v + valueSize := 1 + 1 + sz += csproto.SizeOfTagKey({{$mapDesc.Number}}) + csproto.SizeOfVarint(uint64(keySize + valueSize)) + keySize + valueSize {{- else if eq (.Kind | string) "string" "bytes" -}} l = len(v) valueSize := 1 + csproto.SizeOfVarint(uint64(l)) + l @@ -490,12 +499,14 @@ {{- $mapKeyKind := (.Desc.MapKey.Kind | string) -}} {{- $mapValueKind := (.Desc.MapValue.Kind | string) -}} for k, v := range m.{{.GoName | getSafeFieldName}} { - var l int {{ if eq $mapValueKind "int32" "int64" "uint32" "uint64" "enum" -}} itemSize := 1 + csproto.SizeOfVarint(uint64(v)) + {{- else if eq $mapValueKind "bool" -}} + _ = v + itemSize := 1 + 1 {{- else if eq $mapValueKind "string" "bytes" -}} - l = len(v) - itemSize := 1 + csproto.SizeOfVarint(uint64(l)) + l + valueSize := len(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize {{- else if eq $mapValueKind "sint32" "sint64" -}} itemSize := 1 + csproto.SizeOfZigZag(uint64(v)) {{- else if eq $mapValueKind "fixed32" "sfixed32" "float" -}} @@ -506,16 +517,19 @@ if v == nil { continue } - l = csproto.Size(v) - itemSize := 1 + csproto.SizeOfVarint(uint64(l)) + l + valueSize := csproto.Size(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize {{- else -}} panic(fmt.Errorf("unknown/unsupported Protobuf field kind '{{$mapValueKind}}' for map value for field {{$mapField.Desc.Name}} (tag={{$mapField.Desc.Number}})")) {{- end }} {{ if eq $mapKeyKind "int32" "int64" "uint32" "uint64" "enum" -}} itemSize += 1 + csproto.SizeOfVarint(uint64(k)) + {{- else if eq $mapKeyKind "bool" -}} + _ = k + itemSize += 1 + 1 + l {{- else if eq $mapKeyKind "string" -}} - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize {{- else if eq $mapKeyKind "sint32" "sint64" -}} itemSize += 1 + csproto.SizeOfZigZag(uint64(k)) {{- else if eq $mapKeyKind "fixed32" "sfixed32" -}} @@ -528,15 +542,19 @@ enc.EncodeMapEntryHeader({{$mapField.Desc.Number}}, itemSize) {{ if eq $mapKeyKind "int32" "int64" "uint32" "uint64" -}} enc.EncodeUInt64(1, uint64(k)) + {{- else if eq $mapKeyKind "bool" -}} + enc.EncodeBool(1, k) {{- else if eq $mapKeyKind "string" -}} enc.EncodeString(1, k) {{- else if eq $mapKeyKind "sint32" "sint64" -}} enc.EncodeSInt{{$mapKeyKind | trunc -2}}(1, k) {{- else if eq $mapKeyKind "fixed32" "sfixed32" "fixed64" "sfixed64" -}} - enc.EncodeFixed{{$mapKeyKind | trunc -2}}(uint{{$mapKeyKind | trunc -2}}(1, k)) + enc.EncodeFixed{{$mapKeyKind | trunc -2}}(1, uint{{$mapKeyKind | trunc -2}}(k)) {{- end }} {{ if eq $mapValueKind "int32" "int64" "uint32" "uint64" "enum" -}} enc.EncodeUInt64(2, uint64(v)) + {{- else if eq $mapValueKind "bool" -}} + enc.EncodeBool(2, v) {{- else if eq $mapValueKind "string" "bytes" -}} enc.Encode{{$mapValueKind | upperFirst}}(2, v) {{- else if eq $mapValueKind "sint32" "sint64" -}} @@ -1047,7 +1065,7 @@ if ewt != csproto.WireTypeVarint { return fmt.Errorf("incorrect wire type %v for map key for field '{{.Desc.Name}}' (tag={{.Desc.Number}}), expected 0 (varint)", ewt) } - if entryKey, err = dec.DecodeUint{{$mapKeyKind | trunc -2}}(); err != nil { + if entryKey, err = dec.DecodeUInt{{$mapKeyKind | trunc -2}}(); err != nil { return err } {{- else if eq $mapKeyKind "sint32" "sint64" -}} @@ -1057,7 +1075,17 @@ if entryKey, err = dec.DecodeSInt{{$mapKeyKind | trunc -2}}(); err != nil { return err } - {{- else if eq $mapKeyKind "fixed32" "sfixed32" "fixed64" "sfixed64" -}} + {{- else if eq $mapKeyKind "sfixed32" "sfixed64" -}} + {{- $bitSize := $mapKeyKind | trunc -2 -}} + if ewt != csproto.WireTypeFixed{{$bitSize}} { + return fmt.Errorf("incorrect wire type %v for map key for field '{{.Desc.Name}}' (tag={{.Desc.Number}}), expected {{if eq $bitSize "32"}}5{{else}}1{{end}} (fixed{{$bitSize}})", ewt) + } + if sv, err := dec.DecodeFixed{{$bitSize}}(); err != nil { + return err + } else { + entryKey = int{{$bitSize}}(sv) + } + {{- else if eq $mapKeyKind "fixed32" "fixed64" -}} {{- $bitSize := $mapKeyKind | trunc -2 -}} if ewt != csproto.WireTypeFixed{{$bitSize}} { return fmt.Errorf("incorrect wire type %v for map key for field '{{.Desc.Name}}' (tag={{.Desc.Number}}), expected {{if eq $bitSize "32"}}5{{else}}1{{end}} (fixed{{$bitSize}})", ewt) @@ -1328,7 +1356,7 @@ if wt != csproto.WireTypeLengthDelimited { return fmt.Errorf("incorrect wire type %v for tag field '{{.Desc.Name}}' (tag={{.Desc.Number}}), expected 2 (length-delimited)", wt) } - var mm_{{.Desc.Name}} {{.Message.GoIdent.GoName | getSafeFieldName}} + var mm_{{.Desc.Name}} {{.Message | getImportPrefix}}{{.Message.GoIdent.GoName | getSafeFieldName}} if err = dec.DecodeNested(&mm_{{.Desc.Name}}); err != nil { return fmt.Errorf("unable to decode message value for field '{{.Desc.Name}}' (tag={{.Desc.Number}}): %w", err) } else { diff --git a/example/permessage/gogo/gogo_permessage_example_allthemaps.pb.fm.go b/example/permessage/gogo/gogo_permessage_example_allthemaps.pb.fm.go index 8521c25..cbe9945 100644 --- a/example/permessage/gogo/gogo_permessage_example_allthemaps.pb.fm.go +++ b/example/permessage/gogo/gogo_permessage_example_allthemaps.pb.fm.go @@ -221,10 +221,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToInt32 (1,map) for k, v := range m.ToInt32 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(1, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -232,10 +231,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToInt64 (2,map) for k, v := range m.ToInt64 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(2, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -243,10 +241,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToUInt32 (3,map) for k, v := range m.ToUInt32 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(3, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -254,10 +251,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToUInt64 (4,map) for k, v := range m.ToUInt64 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(4, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -265,11 +261,10 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToString (5,map) for k, v := range m.ToString { - var l int - l = len(v) - itemSize := 1 + csproto.SizeOfVarint(uint64(l)) + l - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + valueSize := len(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(5, itemSize) enc.EncodeString(1, k) enc.EncodeString(2, v) @@ -277,11 +272,10 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToBytes (6,map) for k, v := range m.ToBytes { - var l int - l = len(v) - itemSize := 1 + csproto.SizeOfVarint(uint64(l)) + l - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + valueSize := len(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(6, itemSize) enc.EncodeString(1, k) enc.EncodeBytes(2, v) @@ -289,10 +283,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSInt32 (7,map) for k, v := range m.ToSInt32 { - var l int itemSize := 1 + csproto.SizeOfZigZag(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(7, itemSize) enc.EncodeString(1, k) enc.EncodeSInt32(2, v) @@ -300,10 +293,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSInt64 (8,map) for k, v := range m.ToSInt64 { - var l int itemSize := 1 + csproto.SizeOfZigZag(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(8, itemSize) enc.EncodeString(1, k) enc.EncodeSInt64(2, v) @@ -311,10 +303,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToFixed32 (9,map) for k, v := range m.ToFixed32 { - var l int itemSize := 5 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(9, itemSize) enc.EncodeString(1, k) enc.EncodeFixed32(2, uint32(v)) @@ -322,10 +313,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSFixed32 (10,map) for k, v := range m.ToSFixed32 { - var l int itemSize := 5 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(10, itemSize) enc.EncodeString(1, k) enc.EncodeFixed32(2, uint32(v)) @@ -333,10 +323,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToFixed64 (11,map) for k, v := range m.ToFixed64 { - var l int itemSize := 9 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(11, itemSize) enc.EncodeString(1, k) enc.EncodeFixed64(2, uint64(v)) @@ -344,10 +333,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSFixed64 (12,map) for k, v := range m.ToSFixed64 { - var l int itemSize := 9 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(12, itemSize) enc.EncodeString(1, k) enc.EncodeFixed64(2, uint64(v)) @@ -355,10 +343,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToFloat (13,map) for k, v := range m.ToFloat { - var l int itemSize := 5 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(13, itemSize) enc.EncodeString(1, k) enc.EncodeFloat32(2, v) @@ -366,10 +353,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToDouble (14,map) for k, v := range m.ToDouble { - var l int itemSize := 9 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(14, itemSize) enc.EncodeString(1, k) enc.EncodeFloat64(2, v) @@ -377,14 +363,13 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToMessage (15,map) for k, v := range m.ToMessage { - var l int if v == nil { continue } - l = csproto.Size(v) - itemSize := 1 + csproto.SizeOfVarint(uint64(l)) + l - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + valueSize := csproto.Size(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(15, itemSize) enc.EncodeString(1, k) enc.EncodeNested(2, v) @@ -392,10 +377,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToEnum (16,map) for k, v := range m.ToEnum { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(16, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) diff --git a/example/permessage/googlev1/googlev1_permessage_example.pb.go b/example/permessage/googlev1/googlev1_permessage_example.pb.go index 714f8f3..80629d6 100644 --- a/example/permessage/googlev1/googlev1_permessage_example.pb.go +++ b/example/permessage/googlev1/googlev1_permessage_example.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.21.2 +// protoc v3.21.12 // source: googlev1_permessage_example.proto package googlev1 diff --git a/example/permessage/googlev1/googlev1_permessage_example_allthemaps.pb.fm.go b/example/permessage/googlev1/googlev1_permessage_example_allthemaps.pb.fm.go index 7db83af..6b44bc3 100644 --- a/example/permessage/googlev1/googlev1_permessage_example_allthemaps.pb.fm.go +++ b/example/permessage/googlev1/googlev1_permessage_example_allthemaps.pb.fm.go @@ -221,10 +221,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToInt32 (1,map) for k, v := range m.ToInt32 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(1, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -232,10 +231,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToInt64 (2,map) for k, v := range m.ToInt64 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(2, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -243,10 +241,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToUInt32 (3,map) for k, v := range m.ToUInt32 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(3, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -254,10 +251,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToUInt64 (4,map) for k, v := range m.ToUInt64 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(4, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -265,11 +261,10 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToString (5,map) for k, v := range m.ToString { - var l int - l = len(v) - itemSize := 1 + csproto.SizeOfVarint(uint64(l)) + l - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + valueSize := len(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(5, itemSize) enc.EncodeString(1, k) enc.EncodeString(2, v) @@ -277,11 +272,10 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToBytes (6,map) for k, v := range m.ToBytes { - var l int - l = len(v) - itemSize := 1 + csproto.SizeOfVarint(uint64(l)) + l - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + valueSize := len(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(6, itemSize) enc.EncodeString(1, k) enc.EncodeBytes(2, v) @@ -289,10 +283,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSInt32 (7,map) for k, v := range m.ToSInt32 { - var l int itemSize := 1 + csproto.SizeOfZigZag(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(7, itemSize) enc.EncodeString(1, k) enc.EncodeSInt32(2, v) @@ -300,10 +293,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSInt64 (8,map) for k, v := range m.ToSInt64 { - var l int itemSize := 1 + csproto.SizeOfZigZag(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(8, itemSize) enc.EncodeString(1, k) enc.EncodeSInt64(2, v) @@ -311,10 +303,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToFixed32 (9,map) for k, v := range m.ToFixed32 { - var l int itemSize := 5 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(9, itemSize) enc.EncodeString(1, k) enc.EncodeFixed32(2, uint32(v)) @@ -322,10 +313,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSFixed32 (10,map) for k, v := range m.ToSFixed32 { - var l int itemSize := 5 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(10, itemSize) enc.EncodeString(1, k) enc.EncodeFixed32(2, uint32(v)) @@ -333,10 +323,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToFixed64 (11,map) for k, v := range m.ToFixed64 { - var l int itemSize := 9 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(11, itemSize) enc.EncodeString(1, k) enc.EncodeFixed64(2, uint64(v)) @@ -344,10 +333,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSFixed64 (12,map) for k, v := range m.ToSFixed64 { - var l int itemSize := 9 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(12, itemSize) enc.EncodeString(1, k) enc.EncodeFixed64(2, uint64(v)) @@ -355,10 +343,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToFloat (13,map) for k, v := range m.ToFloat { - var l int itemSize := 5 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(13, itemSize) enc.EncodeString(1, k) enc.EncodeFloat32(2, v) @@ -366,10 +353,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToDouble (14,map) for k, v := range m.ToDouble { - var l int itemSize := 9 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(14, itemSize) enc.EncodeString(1, k) enc.EncodeFloat64(2, v) @@ -377,14 +363,13 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToMessage (15,map) for k, v := range m.ToMessage { - var l int if v == nil { continue } - l = csproto.Size(v) - itemSize := 1 + csproto.SizeOfVarint(uint64(l)) + l - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + valueSize := csproto.Size(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(15, itemSize) enc.EncodeString(1, k) enc.EncodeNested(2, v) @@ -392,10 +377,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToEnum (16,map) for k, v := range m.ToEnum { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(16, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) diff --git a/example/permessage/googlev2/googlev2_permessage_example.pb.go b/example/permessage/googlev2/googlev2_permessage_example.pb.go index a5df939..52b18a8 100644 --- a/example/permessage/googlev2/googlev2_permessage_example.pb.go +++ b/example/permessage/googlev2/googlev2_permessage_example.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.21.2 +// protoc-gen-go v1.28.1 +// protoc v3.21.12 // source: googlev2_permessage_example.proto package googlev2 diff --git a/example/permessage/googlev2/googlev2_permessage_example_allthemaps.pb.fm.go b/example/permessage/googlev2/googlev2_permessage_example_allthemaps.pb.fm.go index 026d693..491d513 100644 --- a/example/permessage/googlev2/googlev2_permessage_example_allthemaps.pb.fm.go +++ b/example/permessage/googlev2/googlev2_permessage_example_allthemaps.pb.fm.go @@ -221,10 +221,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToInt32 (1,map) for k, v := range m.ToInt32 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(1, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -232,10 +231,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToInt64 (2,map) for k, v := range m.ToInt64 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(2, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -243,10 +241,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToUInt32 (3,map) for k, v := range m.ToUInt32 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(3, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -254,10 +251,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToUInt64 (4,map) for k, v := range m.ToUInt64 { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(4, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) @@ -265,11 +261,10 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToString (5,map) for k, v := range m.ToString { - var l int - l = len(v) - itemSize := 1 + csproto.SizeOfVarint(uint64(l)) + l - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + valueSize := len(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(5, itemSize) enc.EncodeString(1, k) enc.EncodeString(2, v) @@ -277,11 +272,10 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToBytes (6,map) for k, v := range m.ToBytes { - var l int - l = len(v) - itemSize := 1 + csproto.SizeOfVarint(uint64(l)) + l - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + valueSize := len(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(6, itemSize) enc.EncodeString(1, k) enc.EncodeBytes(2, v) @@ -289,10 +283,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSInt32 (7,map) for k, v := range m.ToSInt32 { - var l int itemSize := 1 + csproto.SizeOfZigZag(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(7, itemSize) enc.EncodeString(1, k) enc.EncodeSInt32(2, v) @@ -300,10 +293,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSInt64 (8,map) for k, v := range m.ToSInt64 { - var l int itemSize := 1 + csproto.SizeOfZigZag(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(8, itemSize) enc.EncodeString(1, k) enc.EncodeSInt64(2, v) @@ -311,10 +303,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToFixed32 (9,map) for k, v := range m.ToFixed32 { - var l int itemSize := 5 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(9, itemSize) enc.EncodeString(1, k) enc.EncodeFixed32(2, uint32(v)) @@ -322,10 +313,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSFixed32 (10,map) for k, v := range m.ToSFixed32 { - var l int itemSize := 5 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(10, itemSize) enc.EncodeString(1, k) enc.EncodeFixed32(2, uint32(v)) @@ -333,10 +323,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToFixed64 (11,map) for k, v := range m.ToFixed64 { - var l int itemSize := 9 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(11, itemSize) enc.EncodeString(1, k) enc.EncodeFixed64(2, uint64(v)) @@ -344,10 +333,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToSFixed64 (12,map) for k, v := range m.ToSFixed64 { - var l int itemSize := 9 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(12, itemSize) enc.EncodeString(1, k) enc.EncodeFixed64(2, uint64(v)) @@ -355,10 +343,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToFloat (13,map) for k, v := range m.ToFloat { - var l int itemSize := 5 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(13, itemSize) enc.EncodeString(1, k) enc.EncodeFloat32(2, v) @@ -366,10 +353,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToDouble (14,map) for k, v := range m.ToDouble { - var l int itemSize := 9 - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(14, itemSize) enc.EncodeString(1, k) enc.EncodeFloat64(2, v) @@ -377,14 +363,13 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToMessage (15,map) for k, v := range m.ToMessage { - var l int if v == nil { continue } - l = csproto.Size(v) - itemSize := 1 + csproto.SizeOfVarint(uint64(l)) + l - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + valueSize := csproto.Size(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(15, itemSize) enc.EncodeString(1, k) enc.EncodeNested(2, v) @@ -392,10 +377,9 @@ func (m *AllTheMaps) MarshalTo(dest []byte) error { // ToEnum (16,map) for k, v := range m.ToEnum { - var l int itemSize := 1 + csproto.SizeOfVarint(uint64(v)) - l = len(k) - itemSize += 1 + csproto.SizeOfVarint(uint64(l)) + l + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize enc.EncodeMapEntryHeader(16, itemSize) enc.EncodeString(1, k) enc.EncodeUInt64(2, uint64(v)) diff --git a/example/proto2/googlev1/googlev1_proto2_example.pb.go b/example/proto2/googlev1/googlev1_proto2_example.pb.go index e07dc9f..a9ef987 100644 --- a/example/proto2/googlev1/googlev1_proto2_example.pb.go +++ b/example/proto2/googlev1/googlev1_proto2_example.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.21.2 +// protoc v3.21.12 // source: googlev1_proto2_example.proto package googlev1 diff --git a/example/proto2/googlev2/googlev2_proto2_example.pb.go b/example/proto2/googlev2/googlev2_proto2_example.pb.go index d818599..fca746f 100644 --- a/example/proto2/googlev2/googlev2_proto2_example.pb.go +++ b/example/proto2/googlev2/googlev2_proto2_example.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.21.2 +// protoc-gen-go v1.28.1 +// protoc v3.21.12 // source: googlev2_proto2_example.proto package googlev2 diff --git a/example/proto3/googlev1/googlev1_proto3_example.pb.go b/example/proto3/googlev1/googlev1_proto3_example.pb.go index 25fecb9..6284747 100644 --- a/example/proto3/googlev1/googlev1_proto3_example.pb.go +++ b/example/proto3/googlev1/googlev1_proto3_example.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.21.2 +// protoc v3.21.12 // source: googlev1_proto3_example.proto package googlev1 diff --git a/example/proto3/googlev2/googlev2_proto3_example.pb.fm.go b/example/proto3/googlev2/googlev2_proto3_example.pb.fm.go index 6f7a2c4..83b0319 100644 --- a/example/proto3/googlev2/googlev2_proto3_example.pb.fm.go +++ b/example/proto3/googlev2/googlev2_proto3_example.pb.fm.go @@ -80,6 +80,22 @@ func (m *TestEvent) Size() int { } } + // Oneofs (oneof) + if m.Oneofs != nil { + switch typedVal := m.Oneofs.(type) { + case *TestEvent_Timestamps: // timestamps (12,message) + if l = csproto.Size(typedVal.Timestamps); l > 0 { + sz += csproto.SizeOfTagKey(12) + csproto.SizeOfVarint(uint64(l)) + l + } + case *TestEvent_Structs: // structs (13,message) + if l = csproto.Size(typedVal.Structs); l > 0 { + sz += csproto.SizeOfTagKey(13) + csproto.SizeOfVarint(uint64(l)) + l + } + default: + _ = typedVal // ensure no unused variable + } + } + // cache the size so it can be re-used in Marshal()/MarshalTo() atomic.StoreInt32(&m.sizeCache, int32(sz)) return sz @@ -158,6 +174,17 @@ func (m *TestEvent) MarshalTo(dest []byte) error { _ = typedVal // ensure no unused variable } } + // Oneofs (oneof) + if m.Oneofs != nil { + switch typedVal := m.Oneofs.(type) { + case *TestEvent_Timestamps: // timestamps (12,message) + enc.EncodeNested(12, typedVal.Timestamps) + case *TestEvent_Structs: // structs (13,message) + enc.EncodeNested(13, typedVal.Structs) + default: + _ = typedVal // ensure no unused variable + } + } return nil } @@ -285,6 +312,30 @@ func (m *TestEvent) Unmarshal(p []byte) error { ov.Other = s } m.Path = &ov + case 12: // oneofs.timestamps (oneof,message) + var ov TestEvent_Timestamps + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for tag field 'timestamps' (tag=12), expected 2 (length-delimited)", wt) + } + var mm_timestamps timestamppb.Timestamp + if err = dec.DecodeNested(&mm_timestamps); err != nil { + return fmt.Errorf("unable to decode message value for field 'timestamps' (tag=12): %w", err) + } else { + ov.Timestamps = &mm_timestamps + } + m.Oneofs = &ov + case 13: // oneofs.structs (oneof,message) + var ov TestEvent_Structs + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for tag field 'structs' (tag=13), expected 2 (length-delimited)", wt) + } + var mm_structs structpb.Struct + if err = dec.DecodeNested(&mm_structs); err != nil { + return fmt.Errorf("unable to decode message value for field 'structs' (tag=13): %w", err) + } else { + ov.Structs = &mm_structs + } + m.Oneofs = &ov default: if skipped, err := dec.Skip(tag, wt); err != nil { return fmt.Errorf("invalid operation skipping tag %v: %w", tag, err) @@ -1495,6 +1546,1082 @@ func (m *EventUsingWKTs) Unmarshal(p []byte) error { return nil } +//------------------------------------------------------------------------------ +// Custom Protobuf size/marshal/unmarshal code for MapObject + +// Size calculates and returns the size, in bytes, required to hold the contents of m using the Protobuf +// binary encoding. +func (m *MapObject) Size() int { + // nil message is always 0 bytes + if m == nil { + return 0 + } + // return cached size, if present + if csz := int(atomic.LoadInt32(&m.sizeCache)); csz > 0 { + return csz + } + // calculate and cache + var sz, l int + _ = l // avoid unused variable + + // Name (string,optional) + if l = len(m.Name); l > 0 { + sz += csproto.SizeOfTagKey(1) + csproto.SizeOfVarint(uint64(l)) + l + } + // Ts (message,optional) + if m.Ts != nil { + l = csproto.Size(m.Ts) + sz += csproto.SizeOfTagKey(2) + csproto.SizeOfVarint(uint64(l)) + l + } + // Attributes (message,repeated) + for k, v := range m.Attributes { + // size of key (always has an internal tag of 1) + l = len(k) + keySize := 1 + csproto.SizeOfVarint(uint64(l)) + l + // size of value (always has an internal tag of 2) + l = len(v) + valueSize := 1 + csproto.SizeOfVarint(uint64(l)) + l + sz += csproto.SizeOfTagKey(3) + csproto.SizeOfVarint(uint64(keySize+valueSize)) + keySize + valueSize + } + + // cache the size so it can be re-used in Marshal()/MarshalTo() + atomic.StoreInt32(&m.sizeCache, int32(sz)) + return sz +} + +// Marshal converts the contents of m to the Protobuf binary encoding and returns the result or an error. +func (m *MapObject) Marshal() ([]byte, error) { + siz := m.Size() + buf := make([]byte, siz) + err := m.MarshalTo(buf) + return buf, err +} + +// MarshalTo converts the contents of m to the Protobuf binary encoding and writes the result to dest. +func (m *MapObject) MarshalTo(dest []byte) error { + var ( + enc = csproto.NewEncoder(dest) + buf []byte + err error + extVal interface{} + ) + // ensure no unused variables + _ = enc + _ = buf + _ = err + _ = extVal + + // Name (1,string,optional) + if len(m.Name) > 0 { + enc.EncodeString(1, m.Name) + } + // Ts (2,message,optional) + if m.Ts != nil { + if err = enc.EncodeNested(2, m.Ts); err != nil { + return fmt.Errorf("unable to encode message data for field 'ts' (tag=2): %w", err) + } + } + // Attributes (3,map) + for k, v := range m.Attributes { + valueSize := len(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize + enc.EncodeMapEntryHeader(3, itemSize) + enc.EncodeString(1, k) + enc.EncodeString(2, v) + } + + return nil +} + +// Unmarshal decodes a binary encoded Protobuf message from p and populates m with the result. +func (m *MapObject) Unmarshal(p []byte) error { + if len(p) == 0 { + return fmt.Errorf("cannot unmarshal from an empty buffer") + } + // clear any existing data + m.Reset() + dec := csproto.NewDecoder(p) + for dec.More() { + tag, wt, err := dec.DecodeTag() + if err != nil { + return err + } + switch tag { + case 1: // Name (string,optional) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for field 'name' (tag=1), expected 2 (length-delimited)", wt) + } + if s, err := dec.DecodeString(); err != nil { + return fmt.Errorf("unable to decode string value for field 'name' (tag=1): %w", err) + } else { + m.Name = s + } + + case 2: // Ts (message,optional) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for field 'ts' (tag=2), expected 2 (length-delimited)", wt) + } + var mm timestamppb.Timestamp + if err = dec.DecodeNested(&mm); err != nil { + return fmt.Errorf("unable to decode message value for field 'ts' (tag=2): %w", err) + } + m.Ts = &mm + case 3: // Attributes (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'attributes' (tag=3), expected 2 (length-delimited)", wt) + } + + if m.Attributes == nil { + m.Attributes = make(map[string]string) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey string + entryValue string + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map key for field 'attributes' (tag=3), expected 2 (length-delimited)", ewt) + } + if entryKey, err = dec.DecodeString(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map value for field 'attributes' (tag=3), expected 2 (length-delimited)", ewt) + } + if entryValue, err = dec.DecodeString(); err != nil { + return err + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Attributes[entryKey] = entryValue + + default: + if skipped, err := dec.Skip(tag, wt); err != nil { + return fmt.Errorf("invalid operation skipping tag %v: %w", tag, err) + } else { + m.unknownFields = append(m.unknownFields, skipped...) + } + } + } + return nil +} + +//------------------------------------------------------------------------------ +// Custom Protobuf size/marshal/unmarshal code for Maps + +// Size calculates and returns the size, in bytes, required to hold the contents of m using the Protobuf +// binary encoding. +func (m *Maps) Size() int { + // nil message is always 0 bytes + if m == nil { + return 0 + } + // return cached size, if present + if csz := int(atomic.LoadInt32(&m.sizeCache)); csz > 0 { + return csz + } + // calculate and cache + var sz, l int + _ = l // avoid unused variable + + // Bools (message,repeated) + for k, v := range m.Bools { + // size of key (always has an internal tag of 1) + l = len(k) + keySize := 1 + csproto.SizeOfVarint(uint64(l)) + l + // size of value (always has an internal tag of 2) + _ = v + valueSize := 1 + 1 + sz += csproto.SizeOfTagKey(1) + csproto.SizeOfVarint(uint64(keySize+valueSize)) + keySize + valueSize + } + + // Strings (message,repeated) + for k, v := range m.Strings { + // size of key (always has an internal tag of 1) + l = len(k) + keySize := 1 + csproto.SizeOfVarint(uint64(l)) + l + // size of value (always has an internal tag of 2) + l = len(v) + valueSize := 1 + csproto.SizeOfVarint(uint64(l)) + l + sz += csproto.SizeOfTagKey(2) + csproto.SizeOfVarint(uint64(keySize+valueSize)) + keySize + valueSize + } + + // Int32S (message,repeated) + for k, v := range m.Int32S { + // size of key (always has an internal tag of 1) + keySize := 1 + csproto.SizeOfVarint(uint64(k)) + // size of value (always has an internal tag of 2) + valueSize := 1 + csproto.SizeOfVarint(uint64(v)) + sz += csproto.SizeOfTagKey(3) + csproto.SizeOfVarint(uint64(keySize+valueSize)) + keySize + valueSize + } + + // Int64S (message,repeated) + for k, v := range m.Int64S { + // size of key (always has an internal tag of 1) + keySize := 1 + csproto.SizeOfVarint(uint64(k)) + // size of value (always has an internal tag of 2) + valueSize := 1 + csproto.SizeOfVarint(uint64(v)) + sz += csproto.SizeOfTagKey(4) + csproto.SizeOfVarint(uint64(keySize+valueSize)) + keySize + valueSize + } + + // Uint32S (message,repeated) + for k, v := range m.Uint32S { + // size of key (always has an internal tag of 1) + keySize := 1 + csproto.SizeOfVarint(uint64(k)) + // size of value (always has an internal tag of 2) + valueSize := 1 + csproto.SizeOfVarint(uint64(v)) + sz += csproto.SizeOfTagKey(5) + csproto.SizeOfVarint(uint64(keySize+valueSize)) + keySize + valueSize + } + + // Uint64S (message,repeated) + for k, v := range m.Uint64S { + // size of key (always has an internal tag of 1) + keySize := 1 + csproto.SizeOfVarint(uint64(k)) + // size of value (always has an internal tag of 2) + valueSize := 1 + csproto.SizeOfVarint(uint64(v)) + sz += csproto.SizeOfTagKey(6) + csproto.SizeOfVarint(uint64(keySize+valueSize)) + keySize + valueSize + } + + // Sint32S (message,repeated) + for k, v := range m.Sint32S { + // size of key (always has an internal tag of 1) + keySize := 1 + csproto.SizeOfZigZag(uint64(k)) + // size of value (always has an internal tag of 2) + valueSize := 1 + csproto.SizeOfZigZag(uint64(v)) + sz += csproto.SizeOfTagKey(7) + csproto.SizeOfVarint(uint64(keySize+valueSize)) + keySize + valueSize + } + + // Sint64S (message,repeated) + for k, v := range m.Sint64S { + // size of key (always has an internal tag of 1) + keySize := 1 + csproto.SizeOfZigZag(uint64(k)) + // size of value (always has an internal tag of 2) + valueSize := 1 + csproto.SizeOfZigZag(uint64(v)) + sz += csproto.SizeOfTagKey(8) + csproto.SizeOfVarint(uint64(keySize+valueSize)) + keySize + valueSize + } + + // Fixed32S (message,repeated) + for k, v := range m.Fixed32S { + // size of key (always has an internal tag of 1) + _ = k + keySize := 5 + // size of value (always has an internal tag of 2) + _ = v + sz += csproto.SizeOfTagKey(9) + csproto.SizeOfVarint(uint64(keySize+5)) + keySize + 5 + } + + // Fixed64S (message,repeated) + for k, v := range m.Fixed64S { + // size of key (always has an internal tag of 1) + _ = k + keySize := 9 + // size of value (always has an internal tag of 2) + _ = v + sz += csproto.SizeOfTagKey(10) + csproto.SizeOfVarint(uint64(keySize+9)) + keySize + 9 + } + + // Sfixed32S (message,repeated) + for k, v := range m.Sfixed32S { + // size of key (always has an internal tag of 1) + _ = k + keySize := 5 + // size of value (always has an internal tag of 2) + _ = v + sz += csproto.SizeOfTagKey(11) + csproto.SizeOfVarint(uint64(keySize+5)) + keySize + 5 + } + + // Sfixed64S (message,repeated) + for k, v := range m.Sfixed64S { + // size of key (always has an internal tag of 1) + _ = k + keySize := 9 + // size of value (always has an internal tag of 2) + _ = v + sz += csproto.SizeOfTagKey(12) + csproto.SizeOfVarint(uint64(keySize+9)) + keySize + 9 + } + + // Objects (message,repeated) + for k, v := range m.Objects { + // size of key (always has an internal tag of 1) + l = len(k) + keySize := 1 + csproto.SizeOfVarint(uint64(l)) + l + // size of value (always has an internal tag of 2) + if v != nil { + l = csproto.Size(v) + valueSize := 1 + csproto.SizeOfVarint(uint64(l)) + l + sz += csproto.SizeOfTagKey(13) + csproto.SizeOfVarint(uint64(keySize+valueSize)) + keySize + valueSize + } + } + + // cache the size so it can be re-used in Marshal()/MarshalTo() + atomic.StoreInt32(&m.sizeCache, int32(sz)) + return sz +} + +// Marshal converts the contents of m to the Protobuf binary encoding and returns the result or an error. +func (m *Maps) Marshal() ([]byte, error) { + siz := m.Size() + buf := make([]byte, siz) + err := m.MarshalTo(buf) + return buf, err +} + +// MarshalTo converts the contents of m to the Protobuf binary encoding and writes the result to dest. +func (m *Maps) MarshalTo(dest []byte) error { + var ( + enc = csproto.NewEncoder(dest) + buf []byte + err error + extVal interface{} + ) + // ensure no unused variables + _ = enc + _ = buf + _ = err + _ = extVal + + // Bools (1,map) + for k, v := range m.Bools { + _ = v + itemSize := 1 + 1 + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize + enc.EncodeMapEntryHeader(1, itemSize) + enc.EncodeString(1, k) + enc.EncodeBool(2, v) + } + + // Strings (2,map) + for k, v := range m.Strings { + valueSize := len(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize + enc.EncodeMapEntryHeader(2, itemSize) + enc.EncodeString(1, k) + enc.EncodeString(2, v) + } + + // Int32S (3,map) + for k, v := range m.Int32S { + itemSize := 1 + csproto.SizeOfVarint(uint64(v)) + itemSize += 1 + csproto.SizeOfVarint(uint64(k)) + enc.EncodeMapEntryHeader(3, itemSize) + enc.EncodeUInt64(1, uint64(k)) + enc.EncodeUInt64(2, uint64(v)) + } + + // Int64S (4,map) + for k, v := range m.Int64S { + itemSize := 1 + csproto.SizeOfVarint(uint64(v)) + itemSize += 1 + csproto.SizeOfVarint(uint64(k)) + enc.EncodeMapEntryHeader(4, itemSize) + enc.EncodeUInt64(1, uint64(k)) + enc.EncodeUInt64(2, uint64(v)) + } + + // Uint32S (5,map) + for k, v := range m.Uint32S { + itemSize := 1 + csproto.SizeOfVarint(uint64(v)) + itemSize += 1 + csproto.SizeOfVarint(uint64(k)) + enc.EncodeMapEntryHeader(5, itemSize) + enc.EncodeUInt64(1, uint64(k)) + enc.EncodeUInt64(2, uint64(v)) + } + + // Uint64S (6,map) + for k, v := range m.Uint64S { + itemSize := 1 + csproto.SizeOfVarint(uint64(v)) + itemSize += 1 + csproto.SizeOfVarint(uint64(k)) + enc.EncodeMapEntryHeader(6, itemSize) + enc.EncodeUInt64(1, uint64(k)) + enc.EncodeUInt64(2, uint64(v)) + } + + // Sint32S (7,map) + for k, v := range m.Sint32S { + itemSize := 1 + csproto.SizeOfZigZag(uint64(v)) + itemSize += 1 + csproto.SizeOfZigZag(uint64(k)) + enc.EncodeMapEntryHeader(7, itemSize) + enc.EncodeSInt32(1, k) + enc.EncodeSInt32(2, v) + } + + // Sint64S (8,map) + for k, v := range m.Sint64S { + itemSize := 1 + csproto.SizeOfZigZag(uint64(v)) + itemSize += 1 + csproto.SizeOfZigZag(uint64(k)) + enc.EncodeMapEntryHeader(8, itemSize) + enc.EncodeSInt64(1, k) + enc.EncodeSInt64(2, v) + } + + // Fixed32S (9,map) + for k, v := range m.Fixed32S { + itemSize := 5 + itemSize += 5 + enc.EncodeMapEntryHeader(9, itemSize) + enc.EncodeFixed32(1, uint32(k)) + enc.EncodeFixed32(2, uint32(v)) + } + + // Fixed64S (10,map) + for k, v := range m.Fixed64S { + itemSize := 9 + itemSize += 9 + enc.EncodeMapEntryHeader(10, itemSize) + enc.EncodeFixed64(1, uint64(k)) + enc.EncodeFixed64(2, uint64(v)) + } + + // Sfixed32S (11,map) + for k, v := range m.Sfixed32S { + itemSize := 5 + itemSize += 5 + enc.EncodeMapEntryHeader(11, itemSize) + enc.EncodeFixed32(1, uint32(k)) + enc.EncodeFixed32(2, uint32(v)) + } + + // Sfixed64S (12,map) + for k, v := range m.Sfixed64S { + itemSize := 9 + itemSize += 9 + enc.EncodeMapEntryHeader(12, itemSize) + enc.EncodeFixed64(1, uint64(k)) + enc.EncodeFixed64(2, uint64(v)) + } + + // Objects (13,map) + for k, v := range m.Objects { + if v == nil { + continue + } + valueSize := csproto.Size(v) + itemSize := 1 + csproto.SizeOfVarint(uint64(valueSize)) + valueSize + keySize := len(k) + itemSize += 1 + csproto.SizeOfVarint(uint64(keySize)) + keySize + enc.EncodeMapEntryHeader(13, itemSize) + enc.EncodeString(1, k) + enc.EncodeNested(2, v) + } + + return nil +} + +// Unmarshal decodes a binary encoded Protobuf message from p and populates m with the result. +func (m *Maps) Unmarshal(p []byte) error { + if len(p) == 0 { + return fmt.Errorf("cannot unmarshal from an empty buffer") + } + // clear any existing data + m.Reset() + dec := csproto.NewDecoder(p) + for dec.More() { + tag, wt, err := dec.DecodeTag() + if err != nil { + return err + } + switch tag { + case 1: // Bools (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'bools' (tag=1), expected 2 (length-delimited)", wt) + } + + if m.Bools == nil { + m.Bools = make(map[string]bool) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey string + entryValue bool + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map key for field 'bools' (tag=1), expected 2 (length-delimited)", ewt) + } + if entryKey, err = dec.DecodeString(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map value for field 'bools' (tag=1), expected 0 (varint)", ewt) + } + if entryValue, err = dec.DecodeBool(); err != nil { + return err + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Bools[entryKey] = entryValue + case 2: // Strings (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'strings' (tag=2), expected 2 (length-delimited)", wt) + } + + if m.Strings == nil { + m.Strings = make(map[string]string) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey string + entryValue string + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map key for field 'strings' (tag=2), expected 2 (length-delimited)", ewt) + } + if entryKey, err = dec.DecodeString(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map value for field 'strings' (tag=2), expected 2 (length-delimited)", ewt) + } + if entryValue, err = dec.DecodeString(); err != nil { + return err + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Strings[entryKey] = entryValue + case 3: // Int32S (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'int32s' (tag=3), expected 2 (length-delimited)", wt) + } + + if m.Int32S == nil { + m.Int32S = make(map[int32]int32) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey int32 + entryValue int32 + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map key for field 'int32s' (tag=3), expected 0 (varint)", ewt) + } + if entryKey, err = dec.DecodeInt32(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map value for field 'int32s' (tag=3), expected 0 (varint)", ewt) + } + if entryValue, err = dec.DecodeInt32(); err != nil { + return err + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Int32S[entryKey] = entryValue + case 4: // Int64S (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'int64s' (tag=4), expected 2 (length-delimited)", wt) + } + + if m.Int64S == nil { + m.Int64S = make(map[int64]int64) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey int64 + entryValue int64 + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map key for field 'int64s' (tag=4), expected 0 (varint)", ewt) + } + if entryKey, err = dec.DecodeInt64(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map value for field 'int64s' (tag=4), expected 0 (varint)", ewt) + } + if entryValue, err = dec.DecodeInt64(); err != nil { + return err + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Int64S[entryKey] = entryValue + case 5: // Uint32S (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'uint32s' (tag=5), expected 2 (length-delimited)", wt) + } + + if m.Uint32S == nil { + m.Uint32S = make(map[uint32]uint32) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey uint32 + entryValue uint32 + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map key for field 'uint32s' (tag=5), expected 0 (varint)", ewt) + } + if entryKey, err = dec.DecodeUInt32(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map value for field 'uint32s' (tag=5), expected 0 (varint)", ewt) + } + if entryValue, err = dec.DecodeUInt32(); err != nil { + return err + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Uint32S[entryKey] = entryValue + case 6: // Uint64S (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'uint64s' (tag=6), expected 2 (length-delimited)", wt) + } + + if m.Uint64S == nil { + m.Uint64S = make(map[uint64]uint64) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey uint64 + entryValue uint64 + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map key for field 'uint64s' (tag=6), expected 0 (varint)", ewt) + } + if entryKey, err = dec.DecodeUInt64(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map value for field 'uint64s' (tag=6), expected 0 (varint)", ewt) + } + if entryValue, err = dec.DecodeUInt64(); err != nil { + return err + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Uint64S[entryKey] = entryValue + case 7: // Sint32S (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'sint32s' (tag=7), expected 2 (length-delimited)", wt) + } + + if m.Sint32S == nil { + m.Sint32S = make(map[int32]int32) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey int32 + entryValue int32 + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map key for field 'sint32s' (tag=7), expected 0 (varint)", ewt) + } + if entryKey, err = dec.DecodeSInt32(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map value for field 'sint32s' (tag=7), expected 0 (varint)", ewt) + } + if entryValue, err = dec.DecodeSInt32(); err != nil { + return err + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Sint32S[entryKey] = entryValue + case 8: // Sint64S (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'sint64s' (tag=8), expected 2 (length-delimited)", wt) + } + + if m.Sint64S == nil { + m.Sint64S = make(map[int64]int64) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey int64 + entryValue int64 + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map key for field 'sint64s' (tag=8), expected 0 (varint)", ewt) + } + if entryKey, err = dec.DecodeSInt64(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeVarint { + return fmt.Errorf("incorrect wire type %v for map value for field 'sint64s' (tag=8), expected 0 (varint)", ewt) + } + if entryValue, err = dec.DecodeSInt64(); err != nil { + return err + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Sint64S[entryKey] = entryValue + case 9: // Fixed32S (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'fixed32s' (tag=9), expected 2 (length-delimited)", wt) + } + + if m.Fixed32S == nil { + m.Fixed32S = make(map[uint32]uint32) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey uint32 + entryValue uint32 + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeFixed32 { + return fmt.Errorf("incorrect wire type %v for map key for field 'fixed32s' (tag=9), expected 5 (fixed32)", ewt) + } + if entryKey, err = dec.DecodeFixed32(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeFixed32 { + return fmt.Errorf("incorrect wire type %v for map value for field 'fixed32s' (tag=9), expected 5 (fixed32)", ewt) + } + if entryValue, err = dec.DecodeFixed32(); err != nil { + return err + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Fixed32S[entryKey] = entryValue + case 10: // Fixed64S (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'fixed64s' (tag=10), expected 2 (length-delimited)", wt) + } + + if m.Fixed64S == nil { + m.Fixed64S = make(map[uint64]uint64) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey uint64 + entryValue uint64 + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeFixed64 { + return fmt.Errorf("incorrect wire type %v for map key for field 'fixed64s' (tag=10), expected 1 (fixed64)", ewt) + } + if entryKey, err = dec.DecodeFixed64(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeFixed64 { + return fmt.Errorf("incorrect wire type %v for map value for field 'fixed64s' (tag=10), expected 1 (fixed64)", ewt) + } + if entryValue, err = dec.DecodeFixed64(); err != nil { + return err + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Fixed64S[entryKey] = entryValue + case 11: // Sfixed32S (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'sfixed32s' (tag=11), expected 2 (length-delimited)", wt) + } + + if m.Sfixed32S == nil { + m.Sfixed32S = make(map[int32]int32) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey int32 + entryValue int32 + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeFixed32 { + return fmt.Errorf("incorrect wire type %v for map key for field 'sfixed32s' (tag=11), expected 5 (fixed32)", ewt) + } + if sv, err := dec.DecodeFixed32(); err != nil { + return err + } else { + entryKey = int32(sv) + } + case 2: // value + if ewt != csproto.WireTypeFixed32 { + return fmt.Errorf("incorrect wire type %v for map value for field 'sfixed32s' (tag=11), expected 5 (fixed32)", ewt) + } + if sv, err := dec.DecodeFixed32(); err != nil { + return err + } else { + entryValue = int32(sv) + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Sfixed32S[entryKey] = entryValue + case 12: // Sfixed64S (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'sfixed64s' (tag=12), expected 2 (length-delimited)", wt) + } + + if m.Sfixed64S == nil { + m.Sfixed64S = make(map[int64]int64) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey int64 + entryValue int64 + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeFixed64 { + return fmt.Errorf("incorrect wire type %v for map key for field 'sfixed64s' (tag=12), expected 1 (fixed64)", ewt) + } + if sv, err := dec.DecodeFixed64(); err != nil { + return err + } else { + entryKey = int64(sv) + } + case 2: // value + if ewt != csproto.WireTypeFixed64 { + return fmt.Errorf("incorrect wire type %v for map value for field 'sfixed64s' (tag=12), expected 1 (fixed64)", ewt) + } + if sv, err := dec.DecodeFixed64(); err != nil { + return err + } else { + entryValue = int64(sv) + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Sfixed64S[entryKey] = entryValue + case 13: // Objects (map) + if wt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map field 'objects' (tag=13), expected 2 (length-delimited)", wt) + } + + if m.Objects == nil { + m.Objects = make(map[string]*MapObject) + } + // consume the map entry size + // TODO - should we validate this? + if _, err = dec.DecodeInt32(); err != nil { + return err + } + // always 2 values + var ( + entryKey string + entryValue *MapObject + ) + for i := 0; i < 2; i++ { + etag, ewt, err := dec.DecodeTag() + if err != nil { + return err + } + switch etag { + case 1: // key + if ewt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map key for field 'objects' (tag=13), expected 2 (length-delimited)", ewt) + } + if entryKey, err = dec.DecodeString(); err != nil { + return err + } + case 2: // value + if ewt != csproto.WireTypeLengthDelimited { + return fmt.Errorf("incorrect wire type %v for map value for field 'objects' (tag=13), expected 2 (length-delimited)", ewt) + } + var v MapObject + if err = dec.DecodeNested(&v); err != nil { + return err + } else { + entryValue = &v + } + default: + return fmt.Errorf("invalid map entry field tag %d, expected 1 or 2", etag) + } + } + m.Objects[entryKey] = entryValue + + default: + if skipped, err := dec.Skip(tag, wt); err != nil { + return fmt.Errorf("invalid operation skipping tag %v: %w", tag, err) + } else { + m.unknownFields = append(m.unknownFields, skipped...) + } + } + } + return nil +} + //------------------------------------------------------------------------------ // Custom Protobuf size/marshal/unmarshal code for TestEvent_NestedMsg diff --git a/example/proto3/googlev2/googlev2_proto3_example.pb.go b/example/proto3/googlev2/googlev2_proto3_example.pb.go index 3afd661..5e1036a 100644 --- a/example/proto3/googlev2/googlev2_proto3_example.pb.go +++ b/example/proto3/googlev2/googlev2_proto3_example.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.21.2 +// protoc-gen-go v1.28.1 +// protoc v3.21.12 // source: googlev2_proto3_example.proto package googlev2 @@ -89,6 +89,10 @@ type TestEvent struct { Nested *TestEvent_NestedMsg `protobuf:"bytes,9,opt,name=nested,proto3" json:"nested,omitempty"` Ts *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=ts,proto3" json:"ts,omitempty"` NullVal structpb.NullValue `protobuf:"varint,11,opt,name=nullVal,proto3,enum=google.protobuf.NullValue" json:"nullVal,omitempty"` + // Types that are assignable to Oneofs: + // *TestEvent_Timestamps + // *TestEvent_Structs + Oneofs isTestEvent_Oneofs `protobuf_oneof:"oneofs"` } func (x *TestEvent) Reset() { @@ -207,6 +211,27 @@ func (x *TestEvent) GetNullVal() structpb.NullValue { return structpb.NullValue(0) } +func (m *TestEvent) GetOneofs() isTestEvent_Oneofs { + if m != nil { + return m.Oneofs + } + return nil +} + +func (x *TestEvent) GetTimestamps() *timestamppb.Timestamp { + if x, ok := x.GetOneofs().(*TestEvent_Timestamps); ok { + return x.Timestamps + } + return nil +} + +func (x *TestEvent) GetStructs() *structpb.Struct { + if x, ok := x.GetOneofs().(*TestEvent_Structs); ok { + return x.Structs + } + return nil +} + type isTestEvent_Path interface { isTestEvent_Path() } @@ -229,6 +254,22 @@ func (*TestEvent_Sith) isTestEvent_Path() {} func (*TestEvent_Other) isTestEvent_Path() {} +type isTestEvent_Oneofs interface { + isTestEvent_Oneofs() +} + +type TestEvent_Timestamps struct { + Timestamps *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=timestamps,proto3,oneof"` +} + +type TestEvent_Structs struct { + Structs *structpb.Struct `protobuf:"bytes,13,opt,name=structs,proto3,oneof"` +} + +func (*TestEvent_Timestamps) isTestEvent_Oneofs() {} + +func (*TestEvent_Structs) isTestEvent_Oneofs() {} + type EmbeddedEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -729,6 +770,212 @@ func (x *EventUsingWKTs) GetEventType() EventType { return EventType_EVENT_TYPE_UNDEFINED } +type MapObject struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Ts *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=ts,proto3" json:"ts,omitempty"` + Attributes map[string]string `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *MapObject) Reset() { + *x = MapObject{} + if protoimpl.UnsafeEnabled { + mi := &file_googlev2_proto3_example_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MapObject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MapObject) ProtoMessage() {} + +func (x *MapObject) ProtoReflect() protoreflect.Message { + mi := &file_googlev2_proto3_example_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MapObject.ProtoReflect.Descriptor instead. +func (*MapObject) Descriptor() ([]byte, []int) { + return file_googlev2_proto3_example_proto_rawDescGZIP(), []int{5} +} + +func (x *MapObject) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MapObject) GetTs() *timestamppb.Timestamp { + if x != nil { + return x.Ts + } + return nil +} + +func (x *MapObject) GetAttributes() map[string]string { + if x != nil { + return x.Attributes + } + return nil +} + +type Maps struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bools map[string]bool `protobuf:"bytes,1,rep,name=bools,proto3" json:"bools,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Strings map[string]string `protobuf:"bytes,2,rep,name=strings,proto3" json:"strings,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Int32S map[int32]int32 `protobuf:"bytes,3,rep,name=int32s,proto3" json:"int32s,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Int64S map[int64]int64 `protobuf:"bytes,4,rep,name=int64s,proto3" json:"int64s,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Uint32S map[uint32]uint32 `protobuf:"bytes,5,rep,name=uint32s,proto3" json:"uint32s,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Uint64S map[uint64]uint64 `protobuf:"bytes,6,rep,name=uint64s,proto3" json:"uint64s,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Sint32S map[int32]int32 `protobuf:"bytes,7,rep,name=sint32s,proto3" json:"sint32s,omitempty" protobuf_key:"zigzag32,1,opt,name=key,proto3" protobuf_val:"zigzag32,2,opt,name=value,proto3"` + Sint64S map[int64]int64 `protobuf:"bytes,8,rep,name=sint64s,proto3" json:"sint64s,omitempty" protobuf_key:"zigzag64,1,opt,name=key,proto3" protobuf_val:"zigzag64,2,opt,name=value,proto3"` + Fixed32S map[uint32]uint32 `protobuf:"bytes,9,rep,name=fixed32s,proto3" json:"fixed32s,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + Fixed64S map[uint64]uint64 `protobuf:"bytes,10,rep,name=fixed64s,proto3" json:"fixed64s,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + Sfixed32S map[int32]int32 `protobuf:"bytes,11,rep,name=sfixed32s,proto3" json:"sfixed32s,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + Sfixed64S map[int64]int64 `protobuf:"bytes,12,rep,name=sfixed64s,proto3" json:"sfixed64s,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + Objects map[string]*MapObject `protobuf:"bytes,13,rep,name=objects,proto3" json:"objects,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Maps) Reset() { + *x = Maps{} + if protoimpl.UnsafeEnabled { + mi := &file_googlev2_proto3_example_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Maps) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Maps) ProtoMessage() {} + +func (x *Maps) ProtoReflect() protoreflect.Message { + mi := &file_googlev2_proto3_example_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Maps.ProtoReflect.Descriptor instead. +func (*Maps) Descriptor() ([]byte, []int) { + return file_googlev2_proto3_example_proto_rawDescGZIP(), []int{6} +} + +func (x *Maps) GetBools() map[string]bool { + if x != nil { + return x.Bools + } + return nil +} + +func (x *Maps) GetStrings() map[string]string { + if x != nil { + return x.Strings + } + return nil +} + +func (x *Maps) GetInt32S() map[int32]int32 { + if x != nil { + return x.Int32S + } + return nil +} + +func (x *Maps) GetInt64S() map[int64]int64 { + if x != nil { + return x.Int64S + } + return nil +} + +func (x *Maps) GetUint32S() map[uint32]uint32 { + if x != nil { + return x.Uint32S + } + return nil +} + +func (x *Maps) GetUint64S() map[uint64]uint64 { + if x != nil { + return x.Uint64S + } + return nil +} + +func (x *Maps) GetSint32S() map[int32]int32 { + if x != nil { + return x.Sint32S + } + return nil +} + +func (x *Maps) GetSint64S() map[int64]int64 { + if x != nil { + return x.Sint64S + } + return nil +} + +func (x *Maps) GetFixed32S() map[uint32]uint32 { + if x != nil { + return x.Fixed32S + } + return nil +} + +func (x *Maps) GetFixed64S() map[uint64]uint64 { + if x != nil { + return x.Fixed64S + } + return nil +} + +func (x *Maps) GetSfixed32S() map[int32]int32 { + if x != nil { + return x.Sfixed32S + } + return nil +} + +func (x *Maps) GetSfixed64S() map[int64]int64 { + if x != nil { + return x.Sfixed64S + } + return nil +} + +func (x *Maps) GetObjects() map[string]*MapObject { + if x != nil { + return x.Objects + } + return nil +} + type TestEvent_NestedMsg struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -740,7 +987,7 @@ type TestEvent_NestedMsg struct { func (x *TestEvent_NestedMsg) Reset() { *x = TestEvent_NestedMsg{} if protoimpl.UnsafeEnabled { - mi := &file_googlev2_proto3_example_proto_msgTypes[5] + mi := &file_googlev2_proto3_example_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -753,7 +1000,7 @@ func (x *TestEvent_NestedMsg) String() string { func (*TestEvent_NestedMsg) ProtoMessage() {} func (x *TestEvent_NestedMsg) ProtoReflect() protoreflect.Message { - mi := &file_googlev2_proto3_example_proto_msgTypes[5] + mi := &file_googlev2_proto3_example_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -787,7 +1034,7 @@ var file_googlev2_proto3_example_proto_rawDesc = []byte{ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, - 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf0, 0x03, 0x0a, 0x09, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x04, 0x0a, 0x09, 0x54, 0x65, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, @@ -815,124 +1062,274 @@ var file_googlev2_proto3_example_proto_rawDesc = []byte{ 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x02, 0x74, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, - 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x1a, - 0x25, 0x0a, 0x09, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x18, 0x0a, 0x07, - 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x83, - 0x01, 0x0a, 0x0d, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x44, - 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x75, 0x66, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x73, 0x74, 0x75, 0x66, 0x66, 0x12, 0x28, 0x0a, 0x0f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, - 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, - 0x0f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, - 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x54, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x22, 0x98, 0x05, 0x0a, 0x0c, 0x41, 0x6c, 0x6c, 0x54, 0x68, 0x65, 0x54, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x02, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x68, 0x65, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x68, 0x65, 0x42, 0x6f, 0x6f, 0x6c, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x68, 0x65, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, - 0x08, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x65, - 0x49, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x68, 0x65, - 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, - 0x33, 0x32, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, - 0x74, 0x33, 0x32, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x36, - 0x34, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x11, 0x52, 0x09, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x12, - 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x12, 0x52, 0x09, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x1e, 0x0a, - 0x0a, 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x07, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, 0x1e, 0x0a, - 0x0a, 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x06, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x12, 0x20, 0x0a, - 0x0b, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x0f, 0x52, 0x0b, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, - 0x20, 0x0a, 0x0b, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x10, 0x52, 0x0b, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, - 0x34, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x02, 0x52, 0x08, 0x74, 0x68, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x68, 0x65, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x09, 0x74, 0x68, 0x65, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x12, 0x5a, 0x0a, 0x0c, 0x74, - 0x68, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x36, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, - 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x74, 0x68, 0x65, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x65, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, 0x65, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x12, 0x5a, 0x0a, 0x0a, 0x74, 0x68, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, - 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, - 0xbe, 0x05, 0x0a, 0x12, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x68, 0x65, - 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x02, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x68, 0x65, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x65, 0x42, 0x6f, 0x6f, - 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x08, 0x52, 0x08, 0x74, 0x68, 0x65, 0x42, 0x6f, 0x6f, - 0x6c, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x03, 0x52, 0x09, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x12, 0x1e, - 0x0a, 0x0a, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x12, 0x1e, - 0x0a, 0x0a, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x04, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x12, 0x1e, - 0x0a, 0x0a, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x18, 0x08, 0x20, 0x03, - 0x28, 0x11, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x12, 0x1e, - 0x0a, 0x0a, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x18, 0x09, 0x20, 0x03, - 0x28, 0x12, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x12, 0x20, - 0x0a, 0x0b, 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x73, 0x18, 0x0a, 0x20, - 0x03, 0x28, 0x07, 0x52, 0x0b, 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x73, - 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x73, 0x18, - 0x0b, 0x20, 0x03, 0x28, 0x06, 0x52, 0x0b, 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, - 0x34, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, - 0x32, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0f, 0x52, 0x0c, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, - 0x78, 0x65, 0x64, 0x33, 0x32, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, - 0x78, 0x65, 0x64, 0x36, 0x34, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x10, 0x52, 0x0c, 0x74, 0x68, - 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, - 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x02, 0x52, 0x09, 0x74, - 0x68, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x68, 0x65, 0x44, - 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0a, 0x74, 0x68, - 0x65, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x0d, 0x74, 0x68, 0x65, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0e, 0x32, - 0x36, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x74, 0x68, 0x65, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x65, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, 0x65, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x0b, 0x74, 0x68, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, - 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x74, 0x68, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, - 0x22, 0xa7, 0x01, 0x0a, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x69, 0x6e, 0x67, 0x57, - 0x4b, 0x54, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x12, + 0x3c, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x02, 0x74, 0x73, 0x12, 0x55, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, - 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x2a, 0x4d, 0x0a, 0x09, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x56, 0x45, 0x4e, 0x54, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x6f, 0x77, 0x64, 0x53, 0x74, 0x72, - 0x69, 0x6b, 0x65, 0x2f, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, + 0x01, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x12, 0x33, 0x0a, + 0x07, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x01, 0x52, 0x07, 0x73, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x73, 0x1a, 0x25, 0x0a, 0x09, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x12, + 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x42, 0x08, 0x0a, 0x06, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x0d, + 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x44, 0x12, 0x14, 0x0a, + 0x05, 0x73, 0x74, 0x75, 0x66, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, + 0x75, 0x66, 0x66, 0x12, 0x28, 0x0a, 0x0f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0f, 0x66, 0x61, + 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x22, 0x0a, + 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x54, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x22, 0x98, 0x05, 0x0a, 0x0c, 0x41, 0x6c, 0x6c, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x68, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x12, 0x18, 0x0a, 0x07, 0x74, 0x68, 0x65, 0x42, 0x6f, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x74, 0x68, 0x65, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, + 0x65, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x68, + 0x65, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, + 0x36, 0x34, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, + 0x36, 0x34, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x11, 0x52, 0x09, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x09, 0x20, 0x01, 0x28, 0x12, 0x52, + 0x09, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x68, + 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x07, 0x52, 0x0a, + 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x68, + 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0a, + 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x68, + 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0f, 0x52, + 0x0b, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, 0x20, 0x0a, 0x0b, + 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x10, 0x52, 0x0b, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x12, 0x1a, + 0x0a, 0x08, 0x74, 0x68, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x02, + 0x52, 0x08, 0x74, 0x68, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, + 0x65, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x74, + 0x68, 0x65, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x12, 0x5a, 0x0a, 0x0c, 0x74, 0x68, 0x65, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, + 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x74, 0x68, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x12, 0x5a, 0x0a, 0x0a, 0x74, 0x68, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x12, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, + 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x76, 0x32, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x52, 0x0a, 0x74, 0x68, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xbe, 0x05, 0x0a, + 0x12, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x68, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x65, 0x42, 0x6f, 0x6f, 0x6c, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x08, 0x52, 0x08, 0x74, 0x68, 0x65, 0x42, 0x6f, 0x6f, 0x6c, 0x73, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x05, 0x52, 0x09, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x03, + 0x52, 0x09, 0x74, 0x68, 0x65, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, + 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0d, 0x52, + 0x0a, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, + 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x52, + 0x0a, 0x74, 0x68, 0x65, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, + 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x11, 0x52, + 0x0a, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, + 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x12, 0x52, + 0x0a, 0x74, 0x68, 0x65, 0x53, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x74, + 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x07, + 0x52, 0x0b, 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x73, 0x12, 0x20, 0x0a, + 0x0b, 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x73, 0x18, 0x0b, 0x20, 0x03, + 0x28, 0x06, 0x52, 0x0b, 0x74, 0x68, 0x65, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x73, 0x12, + 0x22, 0x0a, 0x0c, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x73, 0x18, + 0x0c, 0x20, 0x03, 0x28, 0x0f, 0x52, 0x0c, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, + 0x33, 0x32, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x68, 0x65, 0x53, 0x46, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x10, 0x52, 0x0c, 0x74, 0x68, 0x65, 0x53, 0x46, + 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x65, 0x46, 0x6c, + 0x6f, 0x61, 0x74, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x02, 0x52, 0x09, 0x74, 0x68, 0x65, 0x46, + 0x6c, 0x6f, 0x61, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x68, 0x65, 0x44, 0x6f, 0x75, 0x62, + 0x6c, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x44, 0x6f, + 0x75, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x0d, 0x74, 0x68, 0x65, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x63, + 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x74, 0x68, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, + 0x11, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, + 0x5c, 0x0a, 0x0b, 0x74, 0x68, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x12, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, + 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x76, 0x32, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x52, 0x0b, 0x74, 0x68, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0xa7, 0x01, + 0x0a, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x69, 0x6e, 0x67, 0x57, 0x4b, 0x54, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x02, 0x74, 0x73, + 0x12, 0x55, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, + 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x76, 0x32, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0xf2, 0x01, 0x0a, 0x09, 0x4d, 0x61, 0x70, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x02, 0x74, 0x73, 0x12, 0x66, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x63, 0x72, 0x6f, 0x77, + 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x1a, 0x3d, 0x0a, + 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe4, 0x0f, 0x0a, + 0x04, 0x4d, 0x61, 0x70, 0x73, 0x12, 0x52, 0x0a, 0x05, 0x62, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, + 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x76, 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x05, 0x62, 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x58, 0x0a, 0x07, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x63, 0x72, 0x6f, + 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x73, 0x12, 0x55, 0x0a, 0x06, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, + 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, + 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x06, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x12, 0x55, 0x0a, 0x06, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x63, 0x72, 0x6f, + 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, + 0x74, 0x36, 0x34, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x73, 0x12, 0x58, 0x0a, 0x07, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, + 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, + 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x07, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x12, 0x58, 0x0a, 0x07, 0x75, + 0x69, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x63, + 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, + 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x75, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x73, 0x12, 0x58, 0x0a, 0x07, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, + 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x12, + 0x58, 0x0a, 0x07, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3e, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, + 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x07, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x12, 0x5b, 0x0a, 0x08, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x63, 0x72, + 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x46, + 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x33, 0x32, 0x73, 0x12, 0x5b, 0x0a, 0x08, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, + 0x34, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, + 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, + 0x64, 0x36, 0x34, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x73, 0x12, 0x5e, 0x0a, 0x09, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x73, + 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, + 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x33, 0x32, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x33, 0x32, 0x73, 0x12, 0x5e, 0x0a, 0x09, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x73, + 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, + 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x73, 0x12, 0x58, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x0d, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, + 0x6b, 0x65, 0x2e, 0x63, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x76, 0x32, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x1a, 0x38, 0x0a, + 0x0a, 0x42, 0x6f, 0x6f, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3a, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, + 0x0a, 0x0b, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3a, 0x0a, 0x0c, 0x55, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3a, 0x0a, 0x0c, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x3a, 0x0a, 0x0c, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x11, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3a, 0x0a, + 0x0c, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x12, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x12, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, + 0x34, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x06, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0f, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x3c, 0x0a, 0x0e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x10, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x10, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x72, 0x0a, 0x0c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x4c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x36, 0x2e, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2e, 0x63, + 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x2e, 0x4d, + 0x61, 0x70, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x2a, 0x4d, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x14, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, + 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x12, + 0x0a, 0x0e, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x57, 0x4f, + 0x10, 0x02, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x43, 0x72, 0x6f, 0x77, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x2f, 0x63, 0x73, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -948,7 +1345,7 @@ func file_googlev2_proto3_example_proto_rawDescGZIP() []byte { } var file_googlev2_proto3_example_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_googlev2_proto3_example_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_googlev2_proto3_example_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_googlev2_proto3_example_proto_goTypes = []interface{}{ (EventType)(0), // 0: crowdstrike.csproto.example.proto3.googlev2.EventType (*TestEvent)(nil), // 1: crowdstrike.csproto.example.proto3.googlev2.TestEvent @@ -956,26 +1353,61 @@ var file_googlev2_proto3_example_proto_goTypes = []interface{}{ (*AllTheThings)(nil), // 3: crowdstrike.csproto.example.proto3.googlev2.AllTheThings (*RepeatAllTheThings)(nil), // 4: crowdstrike.csproto.example.proto3.googlev2.RepeatAllTheThings (*EventUsingWKTs)(nil), // 5: crowdstrike.csproto.example.proto3.googlev2.EventUsingWKTs - (*TestEvent_NestedMsg)(nil), // 6: crowdstrike.csproto.example.proto3.googlev2.TestEvent.NestedMsg - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp - (structpb.NullValue)(0), // 8: google.protobuf.NullValue + (*MapObject)(nil), // 6: crowdstrike.csproto.example.proto3.googlev2.MapObject + (*Maps)(nil), // 7: crowdstrike.csproto.example.proto3.googlev2.Maps + (*TestEvent_NestedMsg)(nil), // 8: crowdstrike.csproto.example.proto3.googlev2.TestEvent.NestedMsg + nil, // 9: crowdstrike.csproto.example.proto3.googlev2.MapObject.AttributesEntry + nil, // 10: crowdstrike.csproto.example.proto3.googlev2.Maps.BoolsEntry + nil, // 11: crowdstrike.csproto.example.proto3.googlev2.Maps.StringsEntry + nil, // 12: crowdstrike.csproto.example.proto3.googlev2.Maps.Int32sEntry + nil, // 13: crowdstrike.csproto.example.proto3.googlev2.Maps.Int64sEntry + nil, // 14: crowdstrike.csproto.example.proto3.googlev2.Maps.Uint32sEntry + nil, // 15: crowdstrike.csproto.example.proto3.googlev2.Maps.Uint64sEntry + nil, // 16: crowdstrike.csproto.example.proto3.googlev2.Maps.Sint32sEntry + nil, // 17: crowdstrike.csproto.example.proto3.googlev2.Maps.Sint64sEntry + nil, // 18: crowdstrike.csproto.example.proto3.googlev2.Maps.Fixed32sEntry + nil, // 19: crowdstrike.csproto.example.proto3.googlev2.Maps.Fixed64sEntry + nil, // 20: crowdstrike.csproto.example.proto3.googlev2.Maps.Sfixed32sEntry + nil, // 21: crowdstrike.csproto.example.proto3.googlev2.Maps.Sfixed64sEntry + nil, // 22: crowdstrike.csproto.example.proto3.googlev2.Maps.ObjectsEntry + (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp + (structpb.NullValue)(0), // 24: google.protobuf.NullValue + (*structpb.Struct)(nil), // 25: google.protobuf.Struct } var file_googlev2_proto3_example_proto_depIdxs = []int32{ 2, // 0: crowdstrike.csproto.example.proto3.googlev2.TestEvent.embedded:type_name -> crowdstrike.csproto.example.proto3.googlev2.EmbeddedEvent - 6, // 1: crowdstrike.csproto.example.proto3.googlev2.TestEvent.nested:type_name -> crowdstrike.csproto.example.proto3.googlev2.TestEvent.NestedMsg - 7, // 2: crowdstrike.csproto.example.proto3.googlev2.TestEvent.ts:type_name -> google.protobuf.Timestamp - 8, // 3: crowdstrike.csproto.example.proto3.googlev2.TestEvent.nullVal:type_name -> google.protobuf.NullValue - 0, // 4: crowdstrike.csproto.example.proto3.googlev2.AllTheThings.theEventType:type_name -> crowdstrike.csproto.example.proto3.googlev2.EventType - 2, // 5: crowdstrike.csproto.example.proto3.googlev2.AllTheThings.theMessage:type_name -> crowdstrike.csproto.example.proto3.googlev2.EmbeddedEvent - 0, // 6: crowdstrike.csproto.example.proto3.googlev2.RepeatAllTheThings.theEventTypes:type_name -> crowdstrike.csproto.example.proto3.googlev2.EventType - 2, // 7: crowdstrike.csproto.example.proto3.googlev2.RepeatAllTheThings.theMessages:type_name -> crowdstrike.csproto.example.proto3.googlev2.EmbeddedEvent - 7, // 8: crowdstrike.csproto.example.proto3.googlev2.EventUsingWKTs.ts:type_name -> google.protobuf.Timestamp - 0, // 9: crowdstrike.csproto.example.proto3.googlev2.EventUsingWKTs.event_type:type_name -> crowdstrike.csproto.example.proto3.googlev2.EventType - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 8, // 1: crowdstrike.csproto.example.proto3.googlev2.TestEvent.nested:type_name -> crowdstrike.csproto.example.proto3.googlev2.TestEvent.NestedMsg + 23, // 2: crowdstrike.csproto.example.proto3.googlev2.TestEvent.ts:type_name -> google.protobuf.Timestamp + 24, // 3: crowdstrike.csproto.example.proto3.googlev2.TestEvent.nullVal:type_name -> google.protobuf.NullValue + 23, // 4: crowdstrike.csproto.example.proto3.googlev2.TestEvent.timestamps:type_name -> google.protobuf.Timestamp + 25, // 5: crowdstrike.csproto.example.proto3.googlev2.TestEvent.structs:type_name -> google.protobuf.Struct + 0, // 6: crowdstrike.csproto.example.proto3.googlev2.AllTheThings.theEventType:type_name -> crowdstrike.csproto.example.proto3.googlev2.EventType + 2, // 7: crowdstrike.csproto.example.proto3.googlev2.AllTheThings.theMessage:type_name -> crowdstrike.csproto.example.proto3.googlev2.EmbeddedEvent + 0, // 8: crowdstrike.csproto.example.proto3.googlev2.RepeatAllTheThings.theEventTypes:type_name -> crowdstrike.csproto.example.proto3.googlev2.EventType + 2, // 9: crowdstrike.csproto.example.proto3.googlev2.RepeatAllTheThings.theMessages:type_name -> crowdstrike.csproto.example.proto3.googlev2.EmbeddedEvent + 23, // 10: crowdstrike.csproto.example.proto3.googlev2.EventUsingWKTs.ts:type_name -> google.protobuf.Timestamp + 0, // 11: crowdstrike.csproto.example.proto3.googlev2.EventUsingWKTs.event_type:type_name -> crowdstrike.csproto.example.proto3.googlev2.EventType + 23, // 12: crowdstrike.csproto.example.proto3.googlev2.MapObject.ts:type_name -> google.protobuf.Timestamp + 9, // 13: crowdstrike.csproto.example.proto3.googlev2.MapObject.attributes:type_name -> crowdstrike.csproto.example.proto3.googlev2.MapObject.AttributesEntry + 10, // 14: crowdstrike.csproto.example.proto3.googlev2.Maps.bools:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.BoolsEntry + 11, // 15: crowdstrike.csproto.example.proto3.googlev2.Maps.strings:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.StringsEntry + 12, // 16: crowdstrike.csproto.example.proto3.googlev2.Maps.int32s:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.Int32sEntry + 13, // 17: crowdstrike.csproto.example.proto3.googlev2.Maps.int64s:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.Int64sEntry + 14, // 18: crowdstrike.csproto.example.proto3.googlev2.Maps.uint32s:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.Uint32sEntry + 15, // 19: crowdstrike.csproto.example.proto3.googlev2.Maps.uint64s:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.Uint64sEntry + 16, // 20: crowdstrike.csproto.example.proto3.googlev2.Maps.sint32s:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.Sint32sEntry + 17, // 21: crowdstrike.csproto.example.proto3.googlev2.Maps.sint64s:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.Sint64sEntry + 18, // 22: crowdstrike.csproto.example.proto3.googlev2.Maps.fixed32s:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.Fixed32sEntry + 19, // 23: crowdstrike.csproto.example.proto3.googlev2.Maps.fixed64s:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.Fixed64sEntry + 20, // 24: crowdstrike.csproto.example.proto3.googlev2.Maps.sfixed32s:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.Sfixed32sEntry + 21, // 25: crowdstrike.csproto.example.proto3.googlev2.Maps.sfixed64s:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.Sfixed64sEntry + 22, // 26: crowdstrike.csproto.example.proto3.googlev2.Maps.objects:type_name -> crowdstrike.csproto.example.proto3.googlev2.Maps.ObjectsEntry + 6, // 27: crowdstrike.csproto.example.proto3.googlev2.Maps.ObjectsEntry.value:type_name -> crowdstrike.csproto.example.proto3.googlev2.MapObject + 28, // [28:28] is the sub-list for method output_type + 28, // [28:28] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name } func init() { file_googlev2_proto3_example_proto_init() } @@ -1045,6 +1477,30 @@ func file_googlev2_proto3_example_proto_init() { } } file_googlev2_proto3_example_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MapObject); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_googlev2_proto3_example_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Maps); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_googlev2_proto3_example_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TestEvent_NestedMsg); i { case 0: return &v.state @@ -1061,6 +1517,8 @@ func file_googlev2_proto3_example_proto_init() { (*TestEvent_Jedi)(nil), (*TestEvent_Sith)(nil), (*TestEvent_Other)(nil), + (*TestEvent_Timestamps)(nil), + (*TestEvent_Structs)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -1068,7 +1526,7 @@ func file_googlev2_proto3_example_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_googlev2_proto3_example_proto_rawDesc, NumEnums: 1, - NumMessages: 6, + NumMessages: 22, NumExtensions: 0, NumServices: 0, }, diff --git a/example/proto3/googlev2/googlev2_proto3_example.proto b/example/proto3/googlev2/googlev2_proto3_example.proto index 7aa7752..b55507f 100644 --- a/example/proto3/googlev2/googlev2_proto3_example.proto +++ b/example/proto3/googlev2/googlev2_proto3_example.proto @@ -16,7 +16,7 @@ message TestEvent { string name = 1; string info = 2; bool isAwesome = 3; - + repeated string labels = 4; EmbeddedEvent embedded = 5; @@ -34,6 +34,11 @@ message TestEvent { google.protobuf.Timestamp ts = 10; google.protobuf.NullValue nullVal = 11; + + oneof oneofs { + google.protobuf.Timestamp timestamps = 12; + google.protobuf.Struct structs = 13; + } } message EmbeddedEvent { @@ -89,5 +94,26 @@ message EventUsingWKTs { string name = 1; google.protobuf.Timestamp ts = 2; EventType event_type = 3; +} -} \ No newline at end of file +message MapObject { + string name = 1; + google.protobuf.Timestamp ts = 2; + map attributes = 3; +} + +message Maps { + map bools = 1; + map strings = 2; + map int32s = 3; + map int64s = 4; + map uint32s = 5; + map uint64s = 6; + map sint32s = 7; + map sint64s = 8; + map fixed32s = 9; + map fixed64s = 10; + map sfixed32s = 11; + map sfixed64s = 12; + map objects = 13; +}