From 6735dfdb3c91b0f0962944bd6e27d5e1931e2331 Mon Sep 17 00:00:00 2001 From: "J. Conrad Hanson" <27842017+conradhanson@users.noreply.github.com> Date: Thu, 8 Dec 2022 12:24:39 -0800 Subject: [PATCH] Conradhanson/test external changes for supporting proto optionals (#20) * make generated-code with protoc 3.15.8 * non-generated changes from external branch * use internal hashstructure package; make generated-code --- extproto/ext.pb.go | 32 +-- main.go | 4 + templates/clone/msg.go | 9 +- templates/equal/msg.go | 15 +- templates/hash/msg.go | 5 +- templates/merge/functions.go | 1 + templates/merge/msg.go | 9 +- tests/api/hello.pb.clone.go | 98 +++++++- tests/api/hello.pb.equal.go | 176 ++++++++++++++ tests/api/hello.pb.go | 431 ++++++++++++++++++++++++++--------- tests/api/hello.pb.hash.go | 69 ++++++ tests/api/hello.pb.merge.go | 80 +++++++ tests/api/hello.proto | 42 +++- 13 files changed, 817 insertions(+), 154 deletions(-) diff --git a/extproto/ext.pb.go b/extproto/ext.pb.go index 14bff3e..ea417df 100644 --- a/extproto/ext.pb.go +++ b/extproto/ext.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.15.8 // source: extproto/ext.proto package extproto @@ -9,9 +9,9 @@ package extproto import ( reflect "reflect" - descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" ) const ( @@ -23,7 +23,7 @@ const ( var file_extproto_ext_proto_extTypes = []protoimpl.ExtensionInfo{ { - ExtendedType: (*descriptor.FileOptions)(nil), + ExtendedType: (*descriptorpb.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 10071, Name: "extproto.hash_all", @@ -31,7 +31,7 @@ var file_extproto_ext_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "extproto/ext.proto", }, { - ExtendedType: (*descriptor.FileOptions)(nil), + ExtendedType: (*descriptorpb.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 10072, Name: "extproto.equal_all", @@ -39,7 +39,7 @@ var file_extproto_ext_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "extproto/ext.proto", }, { - ExtendedType: (*descriptor.FileOptions)(nil), + ExtendedType: (*descriptorpb.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 10073, Name: "extproto.merge_all", @@ -47,7 +47,7 @@ var file_extproto_ext_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "extproto/ext.proto", }, { - ExtendedType: (*descriptor.FileOptions)(nil), + ExtendedType: (*descriptorpb.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 10074, Name: "extproto.clone_all", @@ -55,7 +55,7 @@ var file_extproto_ext_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "extproto/ext.proto", }, { - ExtendedType: (*descriptor.FieldOptions)(nil), + ExtendedType: (*descriptorpb.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 10071, Name: "extproto.skip_hashing", @@ -63,7 +63,7 @@ var file_extproto_ext_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "extproto/ext.proto", }, { - ExtendedType: (*descriptor.FieldOptions)(nil), + ExtendedType: (*descriptorpb.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 10072, Name: "extproto.skip_merging", @@ -71,7 +71,7 @@ var file_extproto_ext_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "extproto/ext.proto", }, { - ExtendedType: (*descriptor.FieldOptions)(nil), + ExtendedType: (*descriptorpb.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 10073, Name: "extproto.sensitive", @@ -79,7 +79,7 @@ var file_extproto_ext_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "extproto/ext.proto", }, { - ExtendedType: (*descriptor.OneofOptions)(nil), + ExtendedType: (*descriptorpb.OneofOptions)(nil), ExtensionType: (*bool)(nil), Field: 10072, Name: "extproto.skip_merging_oneof", @@ -88,7 +88,7 @@ var file_extproto_ext_proto_extTypes = []protoimpl.ExtensionInfo{ }, } -// Extension fields to descriptor.FileOptions. +// Extension fields to descriptorpb.FileOptions. var ( // Disabled nullifies any validation rules for this message, including any // message fields associated with it that do support validation. @@ -111,7 +111,7 @@ var ( E_CloneAll = &file_extproto_ext_proto_extTypes[3] ) -// Extension fields to descriptor.FieldOptions. +// Extension fields to descriptorpb.FieldOptions. var ( // Rules specify the validations to be performed on this field. By default, // no validation is performed against a field. @@ -128,7 +128,7 @@ var ( E_Sensitive = &file_extproto_ext_proto_extTypes[6] ) -// Extension fields to descriptor.OneofOptions. +// Extension fields to descriptorpb.OneofOptions. var ( // The fields in this oneof will not be merged when a message's Merge() method is called. // @@ -181,9 +181,9 @@ var file_extproto_ext_proto_rawDesc = []byte{ } var file_extproto_ext_proto_goTypes = []interface{}{ - (*descriptor.FileOptions)(nil), // 0: google.protobuf.FileOptions - (*descriptor.FieldOptions)(nil), // 1: google.protobuf.FieldOptions - (*descriptor.OneofOptions)(nil), // 2: google.protobuf.OneofOptions + (*descriptorpb.FileOptions)(nil), // 0: google.protobuf.FileOptions + (*descriptorpb.FieldOptions)(nil), // 1: google.protobuf.FieldOptions + (*descriptorpb.OneofOptions)(nil), // 2: google.protobuf.OneofOptions } var file_extproto_ext_proto_depIdxs = []int32{ 0, // 0: extproto.hash_all:extendee -> google.protobuf.FileOptions diff --git a/main.go b/main.go index 7ae1d44..1820efb 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,8 @@ package main import ( pgsgo "github.com/lyft/protoc-gen-star/lang/go" + "google.golang.org/protobuf/types/pluginpb" + "github.com/solo-io/protoc-gen-ext/module/clone" "github.com/solo-io/protoc-gen-ext/module/equal" "github.com/solo-io/protoc-gen-ext/module/hash" @@ -11,8 +13,10 @@ import ( ) func main() { + feat := uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) pgs.Init( pgs.DebugEnv("PROTO_DEBUG"), + pgs.SupportedFeatures(&feat), ).RegisterModule( hash.Hash(), equal.Equal(), diff --git a/templates/clone/msg.go b/templates/clone/msg.go index 9a70db9..ce8fd50 100644 --- a/templates/clone/msg.go +++ b/templates/clone/msg.go @@ -13,7 +13,14 @@ func (m {{ (msgTyp .).Pointer }}) Clone() proto.Message { {{ render . }} {{ end }} - {{ range .OneOfs }} + {{ range .SyntheticOneOfFields }} + if m.{{ name . }} != nil { + v := m.Get{{ name . }}() + target.{{ name . }} = &v + } + {{ end }} + + {{ range .RealOneOfs }} switch m.{{ name . }}.(type) { {{ $oneOfInterface := name .}} {{ range .Fields }} diff --git a/templates/equal/msg.go b/templates/equal/msg.go index 59a89bf..38daf45 100644 --- a/templates/equal/msg.go +++ b/templates/equal/msg.go @@ -26,7 +26,20 @@ func (m {{ (msgTyp .).Pointer }}) Equal(that interface{}) bool { {{ render . }} {{ end }} - {{ range .OneOfs }} + {{ range .SyntheticOneOfFields }} + if m.{{ name . }} != nil { + if target.{{ name . }} == nil { + return false + } + if m.Get{{ name . }}() != target.Get{{ name . }}() { + return false + } + } else if target.{{ name . }} != nil { + return false + } + {{ end }} + + {{ range .RealOneOfs }} switch m.{{ name . }}.(type) { {{ $oneOfInterface := name .}} {{ range .Fields }} diff --git a/templates/hash/msg.go b/templates/hash/msg.go index 75f1dc6..63fa419 100644 --- a/templates/hash/msg.go +++ b/templates/hash/msg.go @@ -14,7 +14,10 @@ func (m {{ (msgTyp .).Pointer }}) Hash(hasher hash.Hash64) (uint64, error) { {{ render . }} {{ end }} - {{ range .OneOfs }} + {{ range .SyntheticOneOfFields }} + {{ render . }} + {{ end }} + {{ range .RealOneOfs }} switch m.{{ name . }}.(type) { {{ range .Fields }} case {{ oneof . }}: diff --git a/templates/merge/functions.go b/templates/merge/functions.go index 1ed34b8..af023e1 100644 --- a/templates/merge/functions.go +++ b/templates/merge/functions.go @@ -20,6 +20,7 @@ func register(tpl *template.Template, params pgs.Parameters) { "pkg": fns.PackageName, "renderField": fns.renderField, "renderOneOf": fns.renderOneOf, + "name": fns.Name, }) } diff --git a/templates/merge/msg.go b/templates/merge/msg.go index f0d8d08..5b018a5 100644 --- a/templates/merge/msg.go +++ b/templates/merge/msg.go @@ -9,7 +9,14 @@ func (m {{ (msgTyp .).Pointer }}) Merge(overrides {{ (msgTyp .).Pointer }}) { {{ renderField . }} {{ end }} - {{ range .OneOfs }} + {{ range .SyntheticOneOfFields }} + if overrides.{{ name . }} != nil { + v := overrides.Get{{ name . }}() + m.{{ name . }} = &v + } + {{ end }} + + {{ range .RealOneOfs }} {{ renderOneOf . }} {{ end }} diff --git a/tests/api/hello.pb.clone.go b/tests/api/hello.pb.clone.go index d3cde41..5331633 100644 --- a/tests/api/hello.pb.clone.go +++ b/tests/api/hello.pb.clone.go @@ -13,7 +13,7 @@ import ( "github.com/solo-io/protoc-gen-ext/pkg/clone" "google.golang.org/protobuf/proto" - github_com_golang_protobuf_ptypes_struct "github.com/golang/protobuf/ptypes/struct" + google_golang_org_protobuf_types_known_structpb "google.golang.org/protobuf/types/known/structpb" ) // ensure the imports are used @@ -72,6 +72,86 @@ func (m *Simple) Clone() proto.Message { target.IntSkipped = m.GetIntSkipped() + if m.StrOptional != nil { + v := m.GetStrOptional() + target.StrOptional = &v + } + + if m.TestUint32Optional != nil { + v := m.GetTestUint32Optional() + target.TestUint32Optional = &v + } + + if m.TestUint64Optional != nil { + v := m.GetTestUint64Optional() + target.TestUint64Optional = &v + } + + if m.TestBoolOptional != nil { + v := m.GetTestBoolOptional() + target.TestBoolOptional = &v + } + + if m.DoubleTestOptional != nil { + v := m.GetDoubleTestOptional() + target.DoubleTestOptional = &v + } + + if m.FloatTestOptional != nil { + v := m.GetFloatTestOptional() + target.FloatTestOptional = &v + } + + if m.Int32TestOptional != nil { + v := m.GetInt32TestOptional() + target.Int32TestOptional = &v + } + + if m.Int64TestOptional != nil { + v := m.GetInt64TestOptional() + target.Int64TestOptional = &v + } + + if m.Sint32TestOptional != nil { + v := m.GetSint32TestOptional() + target.Sint32TestOptional = &v + } + + if m.Sint64TestOptional != nil { + v := m.GetSint64TestOptional() + target.Sint64TestOptional = &v + } + + if m.Fixed32TestOptional != nil { + v := m.GetFixed32TestOptional() + target.Fixed32TestOptional = &v + } + + if m.Fixed64TestOptional != nil { + v := m.GetFixed64TestOptional() + target.Fixed64TestOptional = &v + } + + if m.Sfixed32TestOptional != nil { + v := m.GetSfixed32TestOptional() + target.Sfixed32TestOptional = &v + } + + if m.Sfixed64TestOptional != nil { + v := m.GetSfixed64TestOptional() + target.Sfixed64TestOptional = &v + } + + if m.StrSkippedOptional != nil { + v := m.GetStrSkippedOptional() + target.StrSkippedOptional = &v + } + + if m.IntSkippedOptional != nil { + v := m.GetIntSkippedOptional() + target.IntSkippedOptional = &v + } + return target } @@ -113,9 +193,9 @@ func (m *Nested) Clone() proto.Message { } if h, ok := interface{}(m.GetDetails()).(clone.Cloner); ok { - target.Details = h.Clone().(*github_com_golang_protobuf_ptypes_struct.Struct) + target.Details = h.Clone().(*google_golang_org_protobuf_types_known_structpb.Struct) } else { - target.Details = proto.Clone(m.GetDetails()).(*github_com_golang_protobuf_ptypes_struct.Struct) + target.Details = proto.Clone(m.GetDetails()).(*google_golang_org_protobuf_types_known_structpb.Struct) } if h, ok := interface{}(m.GetSkipper()).(clone.Cloner); ok { @@ -169,26 +249,26 @@ func (m *Nested) Clone() proto.Message { } if m.GetRepeatedExternal() != nil { - target.RepeatedExternal = make([]*github_com_golang_protobuf_ptypes_struct.Struct, len(m.GetRepeatedExternal())) + target.RepeatedExternal = make([]*google_golang_org_protobuf_types_known_structpb.Struct, len(m.GetRepeatedExternal())) for idx, v := range m.GetRepeatedExternal() { if h, ok := interface{}(v).(clone.Cloner); ok { - target.RepeatedExternal[idx] = h.Clone().(*github_com_golang_protobuf_ptypes_struct.Struct) + target.RepeatedExternal[idx] = h.Clone().(*google_golang_org_protobuf_types_known_structpb.Struct) } else { - target.RepeatedExternal[idx] = proto.Clone(v).(*github_com_golang_protobuf_ptypes_struct.Struct) + target.RepeatedExternal[idx] = proto.Clone(v).(*google_golang_org_protobuf_types_known_structpb.Struct) } } } if m.GetMapExternal() != nil { - target.MapExternal = make(map[string]*github_com_golang_protobuf_ptypes_struct.Struct, len(m.GetMapExternal())) + target.MapExternal = make(map[string]*google_golang_org_protobuf_types_known_structpb.Struct, len(m.GetMapExternal())) for k, v := range m.GetMapExternal() { if h, ok := interface{}(v).(clone.Cloner); ok { - target.MapExternal[k] = h.Clone().(*github_com_golang_protobuf_ptypes_struct.Struct) + target.MapExternal[k] = h.Clone().(*google_golang_org_protobuf_types_known_structpb.Struct) } else { - target.MapExternal[k] = proto.Clone(v).(*github_com_golang_protobuf_ptypes_struct.Struct) + target.MapExternal[k] = proto.Clone(v).(*google_golang_org_protobuf_types_known_structpb.Struct) } } diff --git a/tests/api/hello.pb.equal.go b/tests/api/hello.pb.equal.go index 0c9e60a..03d2f03 100644 --- a/tests/api/hello.pb.equal.go +++ b/tests/api/hello.pb.equal.go @@ -114,6 +114,182 @@ func (m *Simple) Equal(that interface{}) bool { return false } + if m.StrOptional != nil { + if target.StrOptional == nil { + return false + } + if m.GetStrOptional() != target.GetStrOptional() { + return false + } + } else if target.StrOptional != nil { + return false + } + + if m.TestUint32Optional != nil { + if target.TestUint32Optional == nil { + return false + } + if m.GetTestUint32Optional() != target.GetTestUint32Optional() { + return false + } + } else if target.TestUint32Optional != nil { + return false + } + + if m.TestUint64Optional != nil { + if target.TestUint64Optional == nil { + return false + } + if m.GetTestUint64Optional() != target.GetTestUint64Optional() { + return false + } + } else if target.TestUint64Optional != nil { + return false + } + + if m.TestBoolOptional != nil { + if target.TestBoolOptional == nil { + return false + } + if m.GetTestBoolOptional() != target.GetTestBoolOptional() { + return false + } + } else if target.TestBoolOptional != nil { + return false + } + + if m.DoubleTestOptional != nil { + if target.DoubleTestOptional == nil { + return false + } + if m.GetDoubleTestOptional() != target.GetDoubleTestOptional() { + return false + } + } else if target.DoubleTestOptional != nil { + return false + } + + if m.FloatTestOptional != nil { + if target.FloatTestOptional == nil { + return false + } + if m.GetFloatTestOptional() != target.GetFloatTestOptional() { + return false + } + } else if target.FloatTestOptional != nil { + return false + } + + if m.Int32TestOptional != nil { + if target.Int32TestOptional == nil { + return false + } + if m.GetInt32TestOptional() != target.GetInt32TestOptional() { + return false + } + } else if target.Int32TestOptional != nil { + return false + } + + if m.Int64TestOptional != nil { + if target.Int64TestOptional == nil { + return false + } + if m.GetInt64TestOptional() != target.GetInt64TestOptional() { + return false + } + } else if target.Int64TestOptional != nil { + return false + } + + if m.Sint32TestOptional != nil { + if target.Sint32TestOptional == nil { + return false + } + if m.GetSint32TestOptional() != target.GetSint32TestOptional() { + return false + } + } else if target.Sint32TestOptional != nil { + return false + } + + if m.Sint64TestOptional != nil { + if target.Sint64TestOptional == nil { + return false + } + if m.GetSint64TestOptional() != target.GetSint64TestOptional() { + return false + } + } else if target.Sint64TestOptional != nil { + return false + } + + if m.Fixed32TestOptional != nil { + if target.Fixed32TestOptional == nil { + return false + } + if m.GetFixed32TestOptional() != target.GetFixed32TestOptional() { + return false + } + } else if target.Fixed32TestOptional != nil { + return false + } + + if m.Fixed64TestOptional != nil { + if target.Fixed64TestOptional == nil { + return false + } + if m.GetFixed64TestOptional() != target.GetFixed64TestOptional() { + return false + } + } else if target.Fixed64TestOptional != nil { + return false + } + + if m.Sfixed32TestOptional != nil { + if target.Sfixed32TestOptional == nil { + return false + } + if m.GetSfixed32TestOptional() != target.GetSfixed32TestOptional() { + return false + } + } else if target.Sfixed32TestOptional != nil { + return false + } + + if m.Sfixed64TestOptional != nil { + if target.Sfixed64TestOptional == nil { + return false + } + if m.GetSfixed64TestOptional() != target.GetSfixed64TestOptional() { + return false + } + } else if target.Sfixed64TestOptional != nil { + return false + } + + if m.StrSkippedOptional != nil { + if target.StrSkippedOptional == nil { + return false + } + if m.GetStrSkippedOptional() != target.GetStrSkippedOptional() { + return false + } + } else if target.StrSkippedOptional != nil { + return false + } + + if m.IntSkippedOptional != nil { + if target.IntSkippedOptional == nil { + return false + } + if m.GetIntSkippedOptional() != target.GetIntSkippedOptional() { + return false + } + } else if target.IntSkippedOptional != nil { + return false + } + return true } diff --git a/tests/api/hello.pb.go b/tests/api/hello.pb.go index 79f3fc2..1b2ecad 100644 --- a/tests/api/hello.pb.go +++ b/tests/api/hello.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.15.8 // source: tests/api/hello.proto package api @@ -10,10 +10,10 @@ import ( reflect "reflect" sync "sync" - _struct "github.com/golang/protobuf/ptypes/struct" _ "github.com/solo-io/protoc-gen-ext/extproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" ) const ( @@ -91,8 +91,25 @@ type Simple struct { Sfixed32Test int32 `protobuf:"fixed32,14,opt,name=sfixed32Test,proto3" json:"sfixed32Test,omitempty"` Sfixed64Test int64 `protobuf:"fixed64,15,opt,name=sfixed64Test,proto3" json:"sfixed64Test,omitempty"` // skipped primitives - StrSkipped string `protobuf:"bytes,16,opt,name=str_skipped,json=strSkipped,proto3" json:"str_skipped,omitempty"` - IntSkipped uint32 `protobuf:"varint,17,opt,name=int_skipped,json=intSkipped,proto3" json:"int_skipped,omitempty"` + StrSkipped string `protobuf:"bytes,16,opt,name=str_skipped,json=strSkipped,proto3" json:"str_skipped,omitempty"` + IntSkipped uint32 `protobuf:"varint,17,opt,name=int_skipped,json=intSkipped,proto3" json:"int_skipped,omitempty"` + StrOptional *string `protobuf:"bytes,18,opt,name=strOptional,proto3,oneof" json:"strOptional,omitempty"` + TestUint32Optional *uint32 `protobuf:"varint,19,opt,name=testUint32Optional,proto3,oneof" json:"testUint32Optional,omitempty"` + TestUint64Optional *uint64 `protobuf:"varint,20,opt,name=testUint64Optional,proto3,oneof" json:"testUint64Optional,omitempty"` + TestBoolOptional *bool `protobuf:"varint,21,opt,name=testBoolOptional,proto3,oneof" json:"testBoolOptional,omitempty"` + DoubleTestOptional *float64 `protobuf:"fixed64,22,opt,name=doubleTestOptional,proto3,oneof" json:"doubleTestOptional,omitempty"` + FloatTestOptional *float32 `protobuf:"fixed32,23,opt,name=floatTestOptional,proto3,oneof" json:"floatTestOptional,omitempty"` + Int32TestOptional *int32 `protobuf:"varint,24,opt,name=int32TestOptional,proto3,oneof" json:"int32TestOptional,omitempty"` + Int64TestOptional *int64 `protobuf:"varint,25,opt,name=int64TestOptional,proto3,oneof" json:"int64TestOptional,omitempty"` + Sint32TestOptional *int32 `protobuf:"zigzag32,26,opt,name=sint32TestOptional,proto3,oneof" json:"sint32TestOptional,omitempty"` + Sint64TestOptional *int64 `protobuf:"zigzag64,27,opt,name=sint64TestOptional,proto3,oneof" json:"sint64TestOptional,omitempty"` + Fixed32TestOptional *uint32 `protobuf:"fixed32,28,opt,name=fixed32TestOptional,proto3,oneof" json:"fixed32TestOptional,omitempty"` + Fixed64TestOptional *uint64 `protobuf:"fixed64,29,opt,name=fixed64TestOptional,proto3,oneof" json:"fixed64TestOptional,omitempty"` + Sfixed32TestOptional *int32 `protobuf:"fixed32,30,opt,name=sfixed32TestOptional,proto3,oneof" json:"sfixed32TestOptional,omitempty"` + Sfixed64TestOptional *int64 `protobuf:"fixed64,31,opt,name=sfixed64TestOptional,proto3,oneof" json:"sfixed64TestOptional,omitempty"` + // skipped primitives + StrSkippedOptional *string `protobuf:"bytes,32,opt,name=str_skippedOptional,json=strSkippedOptional,proto3,oneof" json:"str_skippedOptional,omitempty"` + IntSkippedOptional *uint32 `protobuf:"varint,33,opt,name=int_skippedOptional,json=intSkippedOptional,proto3,oneof" json:"int_skippedOptional,omitempty"` } func (x *Simple) Reset() { @@ -246,31 +263,142 @@ func (x *Simple) GetIntSkipped() uint32 { return 0 } +func (x *Simple) GetStrOptional() string { + if x != nil && x.StrOptional != nil { + return *x.StrOptional + } + return "" +} + +func (x *Simple) GetTestUint32Optional() uint32 { + if x != nil && x.TestUint32Optional != nil { + return *x.TestUint32Optional + } + return 0 +} + +func (x *Simple) GetTestUint64Optional() uint64 { + if x != nil && x.TestUint64Optional != nil { + return *x.TestUint64Optional + } + return 0 +} + +func (x *Simple) GetTestBoolOptional() bool { + if x != nil && x.TestBoolOptional != nil { + return *x.TestBoolOptional + } + return false +} + +func (x *Simple) GetDoubleTestOptional() float64 { + if x != nil && x.DoubleTestOptional != nil { + return *x.DoubleTestOptional + } + return 0 +} + +func (x *Simple) GetFloatTestOptional() float32 { + if x != nil && x.FloatTestOptional != nil { + return *x.FloatTestOptional + } + return 0 +} + +func (x *Simple) GetInt32TestOptional() int32 { + if x != nil && x.Int32TestOptional != nil { + return *x.Int32TestOptional + } + return 0 +} + +func (x *Simple) GetInt64TestOptional() int64 { + if x != nil && x.Int64TestOptional != nil { + return *x.Int64TestOptional + } + return 0 +} + +func (x *Simple) GetSint32TestOptional() int32 { + if x != nil && x.Sint32TestOptional != nil { + return *x.Sint32TestOptional + } + return 0 +} + +func (x *Simple) GetSint64TestOptional() int64 { + if x != nil && x.Sint64TestOptional != nil { + return *x.Sint64TestOptional + } + return 0 +} + +func (x *Simple) GetFixed32TestOptional() uint32 { + if x != nil && x.Fixed32TestOptional != nil { + return *x.Fixed32TestOptional + } + return 0 +} + +func (x *Simple) GetFixed64TestOptional() uint64 { + if x != nil && x.Fixed64TestOptional != nil { + return *x.Fixed64TestOptional + } + return 0 +} + +func (x *Simple) GetSfixed32TestOptional() int32 { + if x != nil && x.Sfixed32TestOptional != nil { + return *x.Sfixed32TestOptional + } + return 0 +} + +func (x *Simple) GetSfixed64TestOptional() int64 { + if x != nil && x.Sfixed64TestOptional != nil { + return *x.Sfixed64TestOptional + } + return 0 +} + +func (x *Simple) GetStrSkippedOptional() string { + if x != nil && x.StrSkippedOptional != nil { + return *x.StrSkippedOptional + } + return "" +} + +func (x *Simple) GetIntSkippedOptional() uint32 { + if x != nil && x.IntSkippedOptional != nil { + return *x.IntSkippedOptional + } + return 0 +} + type Nested struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Simple *Simple `protobuf:"bytes,1,opt,name=simple,proto3" json:"simple,omitempty"` - OtherSimple *Simple `protobuf:"bytes,14,opt,name=other_simple,json=otherSimple,proto3" json:"other_simple,omitempty"` - Test Test `protobuf:"varint,2,opt,name=test,proto3,enum=envoy.type.Test" json:"test,omitempty"` - Empty *Empty `protobuf:"bytes,3,opt,name=empty,proto3" json:"empty,omitempty"` - Hello []string `protobuf:"bytes,4,rep,name=hello,proto3" json:"hello,omitempty"` - Details *_struct.Struct `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` - Skipper *Simple `protobuf:"bytes,6,opt,name=skipper,proto3" json:"skipper,omitempty"` - X []*Simple `protobuf:"bytes,7,rep,name=x,proto3" json:"x,omitempty"` + OtherSimple *Simple `protobuf:"bytes,2,opt,name=other_simple,json=otherSimple,proto3" json:"other_simple,omitempty"` + Test Test `protobuf:"varint,3,opt,name=test,proto3,enum=envoy.type.Test" json:"test,omitempty"` + Empty *Empty `protobuf:"bytes,4,opt,name=empty,proto3" json:"empty,omitempty"` + Hello []string `protobuf:"bytes,5,rep,name=hello,proto3" json:"hello,omitempty"` + Details *structpb.Struct `protobuf:"bytes,6,opt,name=details,proto3" json:"details,omitempty"` + Skipper *Simple `protobuf:"bytes,7,opt,name=skipper,proto3" json:"skipper,omitempty"` + X []*Simple `protobuf:"bytes,8,rep,name=x,proto3" json:"x,omitempty"` Initial map[string]*Simple `protobuf:"bytes,9,rep,name=initial,proto3" json:"initial,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` SimpleMap map[string]string `protobuf:"bytes,10,rep,name=simple_map,json=simpleMap,proto3" json:"simple_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Types that are assignable to TestOneOf: - // // *Nested_EmptyOneOf // *Nested_NestedOneOf // *Nested_PrimitiveOneOf // *Nested_BytesOneOf - TestOneOf isNested_TestOneOf `protobuf_oneof:"test_one_of"` - RepeatedPrimitive []uint64 `protobuf:"varint,13,rep,packed,name=repeated_primitive,json=repeatedPrimitive,proto3" json:"repeated_primitive,omitempty"` - RepeatedExternal []*_struct.Struct `protobuf:"bytes,17,rep,name=repeated_external,json=repeatedExternal,proto3" json:"repeated_external,omitempty"` - MapExternal map[string]*_struct.Struct `protobuf:"bytes,18,rep,name=map_external,json=mapExternal,proto3" json:"map_external,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + TestOneOf isNested_TestOneOf `protobuf_oneof:"test_one_of"` + RepeatedPrimitive []uint64 `protobuf:"varint,15,rep,packed,name=repeated_primitive,json=repeatedPrimitive,proto3" json:"repeated_primitive,omitempty"` + RepeatedExternal []*structpb.Struct `protobuf:"bytes,16,rep,name=repeated_external,json=repeatedExternal,proto3" json:"repeated_external,omitempty"` + MapExternal map[string]*structpb.Struct `protobuf:"bytes,17,rep,name=map_external,json=mapExternal,proto3" json:"map_external,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *Nested) Reset() { @@ -340,7 +468,7 @@ func (x *Nested) GetHello() []string { return nil } -func (x *Nested) GetDetails() *_struct.Struct { +func (x *Nested) GetDetails() *structpb.Struct { if x != nil { return x.Details } @@ -417,14 +545,14 @@ func (x *Nested) GetRepeatedPrimitive() []uint64 { return nil } -func (x *Nested) GetRepeatedExternal() []*_struct.Struct { +func (x *Nested) GetRepeatedExternal() []*structpb.Struct { if x != nil { return x.RepeatedExternal } return nil } -func (x *Nested) GetMapExternal() map[string]*_struct.Struct { +func (x *Nested) GetMapExternal() map[string]*structpb.Struct { if x != nil { return x.MapExternal } @@ -444,11 +572,11 @@ type Nested_NestedOneOf struct { } type Nested_PrimitiveOneOf struct { - PrimitiveOneOf string `protobuf:"bytes,15,opt,name=primitive_one_of,json=primitiveOneOf,proto3,oneof"` + PrimitiveOneOf string `protobuf:"bytes,13,opt,name=primitive_one_of,json=primitiveOneOf,proto3,oneof"` } type Nested_BytesOneOf struct { - BytesOneOf []byte `protobuf:"bytes,16,opt,name=bytes_one_of,json=bytesOneOf,proto3,oneof"` + BytesOneOf []byte `protobuf:"bytes,14,opt,name=bytes_one_of,json=bytesOneOf,proto3,oneof"` } func (*Nested_EmptyOneOf) isNested_TestOneOf() {} @@ -552,7 +680,7 @@ var file_tests_api_hello_proto_rawDesc = []byte{ 0x79, 0x70, 0x65, 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, 0x1a, 0x12, 0x65, 0x78, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x04, 0x0a, 0x06, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe0, 0x0d, 0x0a, 0x06, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x74, 0x72, 0x12, 0x16, 0x0a, 0x03, 0x62, 0x79, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x04, 0xc8, 0xf5, 0x04, 0x01, 0x52, 0x03, 0x62, 0x79, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x65, @@ -586,88 +714,164 @@ var file_tests_api_hello_proto_rawDesc = []byte{ 0x09, 0x42, 0x04, 0xb8, 0xf5, 0x04, 0x01, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x04, 0xb8, 0xf5, 0x04, 0x01, 0x52, 0x0a, - 0x69, 0x6e, 0x74, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x22, 0xe1, 0x08, 0x0a, 0x06, 0x4e, - 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x06, 0x73, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x12, 0x35, 0x0a, 0x0c, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0b, 0x6f, 0x74, 0x68, - 0x65, 0x72, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x04, 0x74, 0x65, 0x73, 0x74, 0x12, 0x2d, - 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x42, 0x04, 0xc8, 0xf5, 0x04, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x68, 0x65, - 0x6c, 0x6c, 0x6f, 0x12, 0x31, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x05, - 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, 0x52, 0x07, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, - 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x04, 0xb8, 0xf5, 0x04, - 0x01, 0x52, 0x07, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x01, 0x78, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x04, 0xc8, 0xf5, 0x04, 0x01, 0x52, - 0x01, 0x78, 0x12, 0x39, 0x0a, 0x07, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x09, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x46, 0x0a, - 0x0a, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x4e, - 0x65, 0x73, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x42, 0x04, 0xc8, 0xf5, 0x04, 0x01, 0x52, 0x09, 0x73, 0x69, 0x6d, 0x70, - 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x35, 0x0a, 0x0c, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6f, - 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x65, 0x6e, - 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, - 0x52, 0x0a, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x12, 0x3d, 0x0a, 0x0d, - 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0b, - 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x12, 0x2a, 0x0a, 0x10, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x6f, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x5f, 0x6f, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, - 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x12, 0x2d, 0x0a, 0x12, 0x72, - 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x04, 0x52, 0x11, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x12, 0x44, 0x0a, 0x11, 0x72, 0x65, - 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, - 0x11, 0x20, 0x03, 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, 0x52, 0x10, - 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x12, 0x46, 0x0a, 0x0c, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6d, 0x61, 0x70, - 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x1a, 0x4e, 0x0a, 0x0c, 0x49, 0x6e, 0x69, 0x74, - 0x69, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e, 0x53, 0x69, 0x6d, 0x70, - 0x6c, 0x65, 0x4d, 0x61, 0x70, 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, 0x57, 0x0a, 0x10, 0x4d, 0x61, 0x70, 0x45, 0x78, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 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, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, - 0x0d, 0x0a, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x22, 0x07, - 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x39, 0x0a, 0x0b, 0x4e, 0x65, 0x73, 0x74, 0x65, - 0x64, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x06, 0x6e, 0x65, 0x73, 0x74, - 0x65, 0x64, 0x2a, 0x1c, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x09, 0x0a, 0x05, 0x48, 0x45, - 0x4c, 0x4c, 0x4f, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x4f, 0x52, 0x4c, 0x44, 0x10, 0x01, - 0x42, 0x3d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, - 0x6f, 0x6c, 0x6f, 0x2d, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, - 0x6e, 0x2d, 0x65, 0x78, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x73, 0x2f, 0x61, 0x70, 0x69, 0xb8, - 0xf5, 0x04, 0x01, 0xc8, 0xf5, 0x04, 0x01, 0xc0, 0xf5, 0x04, 0x01, 0xd0, 0xf5, 0x04, 0x01, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6e, 0x74, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0b, 0x73, 0x74, + 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x88, 0x01, + 0x01, 0x12, 0x33, 0x0a, 0x12, 0x74, 0x65, 0x73, 0x74, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, + 0x12, 0x74, 0x65, 0x73, 0x74, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x12, 0x74, 0x65, 0x73, 0x74, 0x55, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x14, 0x20, 0x01, + 0x28, 0x04, 0x48, 0x02, 0x52, 0x12, 0x74, 0x65, 0x73, 0x74, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x10, 0x74, + 0x65, 0x73, 0x74, 0x42, 0x6f, 0x6f, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, + 0x15, 0x20, 0x01, 0x28, 0x08, 0x48, 0x03, 0x52, 0x10, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x6f, + 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x12, + 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x18, 0x16, 0x20, 0x01, 0x28, 0x01, 0x48, 0x04, 0x52, 0x12, 0x64, 0x6f, 0x75, 0x62, + 0x6c, 0x65, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x88, 0x01, + 0x01, 0x12, 0x31, 0x0a, 0x11, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x17, 0x20, 0x01, 0x28, 0x02, 0x48, 0x05, 0x52, 0x11, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x11, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x54, 0x65, 0x73, + 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, 0x48, + 0x06, 0x52, 0x11, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x11, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x19, 0x20, 0x01, + 0x28, 0x03, 0x48, 0x07, 0x52, 0x11, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x54, 0x65, 0x73, 0x74, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x12, 0x73, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x18, 0x1a, 0x20, 0x01, 0x28, 0x11, 0x48, 0x08, 0x52, 0x12, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, + 0x33, 0x0a, 0x12, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x12, 0x48, 0x09, 0x52, 0x12, 0x73, + 0x69, 0x6e, 0x74, 0x36, 0x34, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x88, 0x01, 0x01, 0x12, 0x35, 0x0a, 0x13, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x54, + 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x1c, 0x20, 0x01, 0x28, + 0x07, 0x48, 0x0a, 0x52, 0x13, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x35, 0x0a, 0x13, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x06, 0x48, 0x0b, 0x52, 0x13, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x36, 0x34, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x88, + 0x01, 0x01, 0x12, 0x37, 0x0a, 0x14, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x54, 0x65, + 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0f, + 0x48, 0x0c, 0x52, 0x14, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x37, 0x0a, 0x14, 0x73, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x10, 0x48, 0x0d, 0x52, 0x14, 0x73, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x36, 0x34, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x13, 0x73, 0x74, 0x72, 0x5f, 0x73, 0x6b, 0x69, 0x70, + 0x70, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x20, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x04, 0xb8, 0xf5, 0x04, 0x01, 0x48, 0x0e, 0x52, 0x12, 0x73, 0x74, 0x72, 0x53, 0x6b, + 0x69, 0x70, 0x70, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, + 0x12, 0x3a, 0x0a, 0x13, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x04, 0xb8, + 0xf5, 0x04, 0x01, 0x48, 0x0f, 0x52, 0x12, 0x69, 0x6e, 0x74, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, + 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, + 0x5f, 0x73, 0x74, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x15, 0x0a, 0x13, + 0x5f, 0x74, 0x65, 0x73, 0x74, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x55, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x74, + 0x65, 0x73, 0x74, 0x42, 0x6f, 0x6f, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, + 0x15, 0x0a, 0x13, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, + 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x14, 0x0a, 0x12, + 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x73, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, + 0x15, 0x0a, 0x13, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x33, 0x32, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x16, + 0x0a, 0x14, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x33, 0x32, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, + 0x17, 0x0a, 0x15, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x73, 0x74, 0x72, + 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0xe1, 0x08, 0x0a, 0x06, 0x4e, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x06, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x12, + 0x35, 0x0a, 0x0c, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0b, 0x6f, 0x74, 0x68, 0x65, 0x72, + 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x04, 0x74, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x05, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x04, + 0xc8, 0xf5, 0x04, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x68, + 0x65, 0x6c, 0x6c, 0x6f, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x68, 0x65, 0x6c, 0x6c, + 0x6f, 0x12, 0x31, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x06, 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, 0x52, 0x07, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x72, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x04, 0xb8, 0xf5, 0x04, 0x01, 0x52, + 0x07, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x01, 0x78, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x04, 0xc8, 0xf5, 0x04, 0x01, 0x52, 0x01, 0x78, + 0x12, 0x39, 0x0a, 0x07, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x4e, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x07, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x46, 0x0a, 0x0a, 0x73, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x4e, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x42, 0x04, 0xc8, 0xf5, 0x04, 0x01, 0x52, 0x09, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, + 0x4d, 0x61, 0x70, 0x12, 0x35, 0x0a, 0x0c, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6f, 0x6e, 0x65, + 0x5f, 0x6f, 0x66, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0a, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x12, 0x3d, 0x0a, 0x0d, 0x6e, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x4e, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x6e, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x12, 0x2a, 0x0a, 0x10, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x6f, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6f, + 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0a, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x12, 0x2d, 0x0a, 0x12, 0x72, 0x65, 0x70, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x18, + 0x0f, 0x20, 0x03, 0x28, 0x04, 0x52, 0x11, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x50, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x12, 0x44, 0x0a, 0x11, 0x72, 0x65, 0x70, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x10, 0x20, + 0x03, 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, 0x52, 0x10, 0x72, 0x65, + 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x46, + 0x0a, 0x0c, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x11, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6d, 0x61, 0x70, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x1a, 0x4e, 0x0a, 0x0c, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, + 0x4d, 0x61, 0x70, 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, 0x57, 0x0a, 0x10, 0x4d, 0x61, 0x70, 0x45, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 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, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0d, 0x0a, + 0x0b, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x22, 0x07, 0x0a, 0x05, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x39, 0x0a, 0x0b, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, + 0x2a, 0x1c, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x09, 0x0a, 0x05, 0x48, 0x45, 0x4c, 0x4c, + 0x4f, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x4f, 0x52, 0x4c, 0x44, 0x10, 0x01, 0x42, 0x3d, + 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6c, + 0x6f, 0x2d, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x65, 0x78, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x73, 0x2f, 0x61, 0x70, 0x69, 0xb8, 0xf5, 0x04, + 0x01, 0xc8, 0xf5, 0x04, 0x01, 0xc0, 0xf5, 0x04, 0x01, 0xd0, 0xf5, 0x04, 0x01, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -685,15 +889,15 @@ func file_tests_api_hello_proto_rawDescGZIP() []byte { var file_tests_api_hello_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_tests_api_hello_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_tests_api_hello_proto_goTypes = []interface{}{ - (Test)(0), // 0: envoy.type.Test - (*Simple)(nil), // 1: envoy.type.Simple - (*Nested)(nil), // 2: envoy.type.Nested - (*Empty)(nil), // 3: envoy.type.Empty - (*NestedEmpty)(nil), // 4: envoy.type.NestedEmpty - nil, // 5: envoy.type.Nested.InitialEntry - nil, // 6: envoy.type.Nested.SimpleMapEntry - nil, // 7: envoy.type.Nested.MapExternalEntry - (*_struct.Struct)(nil), // 8: google.protobuf.Struct + (Test)(0), // 0: envoy.type.Test + (*Simple)(nil), // 1: envoy.type.Simple + (*Nested)(nil), // 2: envoy.type.Nested + (*Empty)(nil), // 3: envoy.type.Empty + (*NestedEmpty)(nil), // 4: envoy.type.NestedEmpty + nil, // 5: envoy.type.Nested.InitialEntry + nil, // 6: envoy.type.Nested.SimpleMapEntry + nil, // 7: envoy.type.Nested.MapExternalEntry + (*structpb.Struct)(nil), // 8: google.protobuf.Struct } var file_tests_api_hello_proto_depIdxs = []int32{ 1, // 0: envoy.type.Nested.simple:type_name -> envoy.type.Simple @@ -774,6 +978,7 @@ func file_tests_api_hello_proto_init() { } } } + file_tests_api_hello_proto_msgTypes[0].OneofWrappers = []interface{}{} file_tests_api_hello_proto_msgTypes[1].OneofWrappers = []interface{}{ (*Nested_EmptyOneOf)(nil), (*Nested_NestedOneOf)(nil), diff --git a/tests/api/hello.pb.hash.go b/tests/api/hello.pb.hash.go index fef3d96..adcad51 100644 --- a/tests/api/hello.pb.hash.go +++ b/tests/api/hello.pb.hash.go @@ -111,6 +111,75 @@ func (m *Simple) Hash(hasher hash.Hash64) (uint64, error) { return 0, err } + if _, err = hasher.Write([]byte(m.GetStrOptional())); err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetTestUint32Optional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetTestUint64Optional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetTestBoolOptional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetDoubleTestOptional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetFloatTestOptional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetInt32TestOptional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetInt64TestOptional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetSint32TestOptional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetSint64TestOptional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetFixed32TestOptional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetFixed64TestOptional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetSfixed32TestOptional()) + if err != nil { + return 0, err + } + + err = binary.Write(hasher, binary.LittleEndian, m.GetSfixed64TestOptional()) + if err != nil { + return 0, err + } + return hasher.Sum64(), nil } diff --git a/tests/api/hello.pb.merge.go b/tests/api/hello.pb.merge.go index 068a316..1928702 100644 --- a/tests/api/hello.pb.merge.go +++ b/tests/api/hello.pb.merge.go @@ -43,6 +43,86 @@ func (m *Simple) Merge(overrides *Simple) { m.IntSkipped = overrides.IntSkipped + if overrides.StrOptional != nil { + v := overrides.GetStrOptional() + m.StrOptional = &v + } + + if overrides.TestUint32Optional != nil { + v := overrides.GetTestUint32Optional() + m.TestUint32Optional = &v + } + + if overrides.TestUint64Optional != nil { + v := overrides.GetTestUint64Optional() + m.TestUint64Optional = &v + } + + if overrides.TestBoolOptional != nil { + v := overrides.GetTestBoolOptional() + m.TestBoolOptional = &v + } + + if overrides.DoubleTestOptional != nil { + v := overrides.GetDoubleTestOptional() + m.DoubleTestOptional = &v + } + + if overrides.FloatTestOptional != nil { + v := overrides.GetFloatTestOptional() + m.FloatTestOptional = &v + } + + if overrides.Int32TestOptional != nil { + v := overrides.GetInt32TestOptional() + m.Int32TestOptional = &v + } + + if overrides.Int64TestOptional != nil { + v := overrides.GetInt64TestOptional() + m.Int64TestOptional = &v + } + + if overrides.Sint32TestOptional != nil { + v := overrides.GetSint32TestOptional() + m.Sint32TestOptional = &v + } + + if overrides.Sint64TestOptional != nil { + v := overrides.GetSint64TestOptional() + m.Sint64TestOptional = &v + } + + if overrides.Fixed32TestOptional != nil { + v := overrides.GetFixed32TestOptional() + m.Fixed32TestOptional = &v + } + + if overrides.Fixed64TestOptional != nil { + v := overrides.GetFixed64TestOptional() + m.Fixed64TestOptional = &v + } + + if overrides.Sfixed32TestOptional != nil { + v := overrides.GetSfixed32TestOptional() + m.Sfixed32TestOptional = &v + } + + if overrides.Sfixed64TestOptional != nil { + v := overrides.GetSfixed64TestOptional() + m.Sfixed64TestOptional = &v + } + + if overrides.StrSkippedOptional != nil { + v := overrides.GetStrSkippedOptional() + m.StrSkippedOptional = &v + } + + if overrides.IntSkippedOptional != nil { + v := overrides.GetIntSkippedOptional() + m.IntSkippedOptional = &v + } + } // Merge non-nil fields from overrides into m diff --git a/tests/api/hello.proto b/tests/api/hello.proto index 0a005c9..10fd2a1 100644 --- a/tests/api/hello.proto +++ b/tests/api/hello.proto @@ -34,6 +34,24 @@ message Simple { string str_skipped = 16 [(extproto.skip_hashing) = true]; uint32 int_skipped = 17 [(extproto.skip_hashing) = true]; + optional string strOptional = 18; + optional uint32 testUint32Optional = 19; + optional uint64 testUint64Optional = 20; + optional bool testBoolOptional = 21; + optional double doubleTestOptional = 22; + optional float floatTestOptional = 23; + optional int32 int32TestOptional = 24; + optional int64 int64TestOptional = 25; + optional sint32 sint32TestOptional = 26; + optional sint64 sint64TestOptional = 27; + optional fixed32 fixed32TestOptional = 28; + optional fixed64 fixed64TestOptional = 29; + optional sfixed32 sfixed32TestOptional = 30; + optional sfixed64 sfixed64TestOptional = 31; + + // skipped primitives + optional string str_skippedOptional = 32 [(extproto.skip_hashing) = true]; + optional uint32 int_skippedOptional = 33 [(extproto.skip_hashing) = true]; } enum Test { @@ -44,19 +62,19 @@ enum Test { message Nested { Simple simple = 1; - Simple other_simple = 14; + Simple other_simple = 2; - Test test = 2; + Test test = 3; - Empty empty = 3 [(extproto.sensitive) = true]; + Empty empty = 4 [(extproto.sensitive) = true]; - repeated string hello = 4; + repeated string hello = 5; - google.protobuf.Struct details = 5; + google.protobuf.Struct details = 6; - Simple skipper = 6 [(extproto.skip_hashing) = true]; + Simple skipper = 7 [(extproto.skip_hashing) = true]; - repeated Simple x = 7 [(extproto.sensitive) = true]; + repeated Simple x = 8 [(extproto.sensitive) = true]; map initial = 9; @@ -65,15 +83,15 @@ message Nested { oneof test_one_of { Empty empty_one_of = 11; NestedEmpty nested_one_of = 12; - string primitive_one_of = 15; - bytes bytes_one_of = 16; + string primitive_one_of = 13; + bytes bytes_one_of = 14; } - repeated uint64 repeated_primitive = 13; + repeated uint64 repeated_primitive = 15; - repeated google.protobuf.Struct repeated_external = 17; + repeated google.protobuf.Struct repeated_external = 16; - map map_external = 18; + map map_external = 17; }