github.com/hellobchain/third_party@v0.0.0-20230331131523-deb0478a2e52/gin/testdata/protoexample/test.pb.go (about) 1 // Code generated by protoc-gen-go. 2 // source: test.proto 3 // DO NOT EDIT! 4 5 /* 6 Package protoexample is a generated protocol buffer package. 7 8 It is generated from these files: 9 test.proto 10 11 It has these top-level messages: 12 Test 13 */ 14 package protoexample 15 16 import proto "github.com/golang/protobuf/proto" 17 import math "math" 18 19 // Reference imports to suppress errors if they are not otherwise used. 20 var _ = proto.Marshal 21 var _ = math.Inf 22 23 type FOO int32 24 25 const ( 26 FOO_X FOO = 17 27 ) 28 29 var FOO_name = map[int32]string{ 30 17: "X", 31 } 32 var FOO_value = map[string]int32{ 33 "X": 17, 34 } 35 36 func (x FOO) Enum() *FOO { 37 p := new(FOO) 38 *p = x 39 return p 40 } 41 func (x FOO) String() string { 42 return proto.EnumName(FOO_name, int32(x)) 43 } 44 func (x *FOO) UnmarshalJSON(data []byte) error { 45 value, err := proto.UnmarshalJSONEnum(FOO_value, data, "FOO") 46 if err != nil { 47 return err 48 } 49 *x = FOO(value) 50 return nil 51 } 52 53 type Test struct { 54 Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"` 55 Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"` 56 Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"` 57 Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` 58 XXX_unrecognized []byte `json:"-"` 59 } 60 61 func (m *Test) Reset() { *m = Test{} } 62 func (m *Test) String() string { return proto.CompactTextString(m) } 63 func (*Test) ProtoMessage() {} 64 65 const Default_Test_Type int32 = 77 66 67 func (m *Test) GetLabel() string { 68 if m != nil && m.Label != nil { 69 return *m.Label 70 } 71 return "" 72 } 73 74 func (m *Test) GetType() int32 { 75 if m != nil && m.Type != nil { 76 return *m.Type 77 } 78 return Default_Test_Type 79 } 80 81 func (m *Test) GetReps() []int64 { 82 if m != nil { 83 return m.Reps 84 } 85 return nil 86 } 87 88 func (m *Test) GetOptionalgroup() *Test_OptionalGroup { 89 if m != nil { 90 return m.Optionalgroup 91 } 92 return nil 93 } 94 95 type Test_OptionalGroup struct { 96 RequiredField *string `protobuf:"bytes,5,req" json:"RequiredField,omitempty"` 97 XXX_unrecognized []byte `json:"-"` 98 } 99 100 func (m *Test_OptionalGroup) Reset() { *m = Test_OptionalGroup{} } 101 func (m *Test_OptionalGroup) String() string { return proto.CompactTextString(m) } 102 func (*Test_OptionalGroup) ProtoMessage() {} 103 104 func (m *Test_OptionalGroup) GetRequiredField() string { 105 if m != nil && m.RequiredField != nil { 106 return *m.RequiredField 107 } 108 return "" 109 } 110 111 func init() { 112 proto.RegisterEnum("protoexample.FOO", FOO_name, FOO_value) 113 }