| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1 | // Code generated by protoc-gen-go from "test.proto" |
| 2 | // DO NOT EDIT! |
| 3 | |
| 4 | package testdata |
| 5 | |
| 6 | import proto "code.google.com/p/goprotobuf/proto" |
| 7 | import "math" |
| 8 | |
| 9 | // Reference proto and math imports to suppress error if they are not otherwise used. |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 10 | var _ = proto.Marshal |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 11 | var _ = math.Inf |
| 12 | |
| 13 | type FOO int32 |
| 14 | |
| 15 | const ( |
| 16 | FOO_FOO1 FOO = 1 |
| 17 | ) |
| 18 | |
| 19 | var FOO_name = map[int32]string{ |
| 20 | 1: "FOO1", |
| 21 | } |
| 22 | var FOO_value = map[string]int32{ |
| 23 | "FOO1": 1, |
| 24 | } |
| 25 | |
| David Symonds | efeca9a | 2012-05-08 10:36:04 +1000 | [diff] [blame] | 26 | func (x FOO) Enum() *FOO { |
| 27 | p := new(FOO) |
| 28 | *p = x |
| 29 | return p |
| 30 | } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 31 | func (x FOO) String() string { |
| 32 | return proto.EnumName(FOO_name, int32(x)) |
| 33 | } |
| 34 | |
| 35 | type GoTest_KIND int32 |
| 36 | |
| 37 | const ( |
| 38 | GoTest_VOID GoTest_KIND = 0 |
| 39 | GoTest_BOOL GoTest_KIND = 1 |
| 40 | GoTest_BYTES GoTest_KIND = 2 |
| 41 | GoTest_FINGERPRINT GoTest_KIND = 3 |
| 42 | GoTest_FLOAT GoTest_KIND = 4 |
| 43 | GoTest_INT GoTest_KIND = 5 |
| 44 | GoTest_STRING GoTest_KIND = 6 |
| 45 | GoTest_TIME GoTest_KIND = 7 |
| 46 | GoTest_TUPLE GoTest_KIND = 8 |
| 47 | GoTest_ARRAY GoTest_KIND = 9 |
| 48 | GoTest_MAP GoTest_KIND = 10 |
| 49 | GoTest_TABLE GoTest_KIND = 11 |
| 50 | GoTest_FUNCTION GoTest_KIND = 12 |
| 51 | ) |
| 52 | |
| 53 | var GoTest_KIND_name = map[int32]string{ |
| 54 | 0: "VOID", |
| 55 | 1: "BOOL", |
| 56 | 2: "BYTES", |
| 57 | 3: "FINGERPRINT", |
| 58 | 4: "FLOAT", |
| 59 | 5: "INT", |
| 60 | 6: "STRING", |
| 61 | 7: "TIME", |
| 62 | 8: "TUPLE", |
| 63 | 9: "ARRAY", |
| 64 | 10: "MAP", |
| 65 | 11: "TABLE", |
| 66 | 12: "FUNCTION", |
| 67 | } |
| 68 | var GoTest_KIND_value = map[string]int32{ |
| 69 | "VOID": 0, |
| 70 | "BOOL": 1, |
| 71 | "BYTES": 2, |
| 72 | "FINGERPRINT": 3, |
| 73 | "FLOAT": 4, |
| 74 | "INT": 5, |
| 75 | "STRING": 6, |
| 76 | "TIME": 7, |
| 77 | "TUPLE": 8, |
| 78 | "ARRAY": 9, |
| 79 | "MAP": 10, |
| 80 | "TABLE": 11, |
| 81 | "FUNCTION": 12, |
| 82 | } |
| 83 | |
| David Symonds | efeca9a | 2012-05-08 10:36:04 +1000 | [diff] [blame] | 84 | func (x GoTest_KIND) Enum() *GoTest_KIND { |
| 85 | p := new(GoTest_KIND) |
| 86 | *p = x |
| 87 | return p |
| 88 | } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 89 | func (x GoTest_KIND) String() string { |
| 90 | return proto.EnumName(GoTest_KIND_name, int32(x)) |
| 91 | } |
| 92 | |
| 93 | type MyMessage_Color int32 |
| 94 | |
| 95 | const ( |
| 96 | MyMessage_RED MyMessage_Color = 0 |
| 97 | MyMessage_GREEN MyMessage_Color = 1 |
| 98 | MyMessage_BLUE MyMessage_Color = 2 |
| 99 | ) |
| 100 | |
| 101 | var MyMessage_Color_name = map[int32]string{ |
| 102 | 0: "RED", |
| 103 | 1: "GREEN", |
| 104 | 2: "BLUE", |
| 105 | } |
| 106 | var MyMessage_Color_value = map[string]int32{ |
| 107 | "RED": 0, |
| 108 | "GREEN": 1, |
| 109 | "BLUE": 2, |
| 110 | } |
| 111 | |
| David Symonds | efeca9a | 2012-05-08 10:36:04 +1000 | [diff] [blame] | 112 | func (x MyMessage_Color) Enum() *MyMessage_Color { |
| 113 | p := new(MyMessage_Color) |
| 114 | *p = x |
| 115 | return p |
| 116 | } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 117 | func (x MyMessage_Color) String() string { |
| 118 | return proto.EnumName(MyMessage_Color_name, int32(x)) |
| 119 | } |
| 120 | |
| 121 | type Defaults_Color int32 |
| 122 | |
| 123 | const ( |
| 124 | Defaults_RED Defaults_Color = 0 |
| 125 | Defaults_GREEN Defaults_Color = 1 |
| 126 | Defaults_BLUE Defaults_Color = 2 |
| 127 | ) |
| 128 | |
| 129 | var Defaults_Color_name = map[int32]string{ |
| 130 | 0: "RED", |
| 131 | 1: "GREEN", |
| 132 | 2: "BLUE", |
| 133 | } |
| 134 | var Defaults_Color_value = map[string]int32{ |
| 135 | "RED": 0, |
| 136 | "GREEN": 1, |
| 137 | "BLUE": 2, |
| 138 | } |
| 139 | |
| David Symonds | efeca9a | 2012-05-08 10:36:04 +1000 | [diff] [blame] | 140 | func (x Defaults_Color) Enum() *Defaults_Color { |
| 141 | p := new(Defaults_Color) |
| 142 | *p = x |
| 143 | return p |
| 144 | } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 145 | func (x Defaults_Color) String() string { |
| 146 | return proto.EnumName(Defaults_Color_name, int32(x)) |
| 147 | } |
| 148 | |
| 149 | type RepeatedEnum_Color int32 |
| 150 | |
| 151 | const ( |
| 152 | RepeatedEnum_RED RepeatedEnum_Color = 1 |
| 153 | ) |
| 154 | |
| 155 | var RepeatedEnum_Color_name = map[int32]string{ |
| 156 | 1: "RED", |
| 157 | } |
| 158 | var RepeatedEnum_Color_value = map[string]int32{ |
| 159 | "RED": 1, |
| 160 | } |
| 161 | |
| David Symonds | efeca9a | 2012-05-08 10:36:04 +1000 | [diff] [blame] | 162 | func (x RepeatedEnum_Color) Enum() *RepeatedEnum_Color { |
| 163 | p := new(RepeatedEnum_Color) |
| 164 | *p = x |
| 165 | return p |
| 166 | } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 167 | func (x RepeatedEnum_Color) String() string { |
| 168 | return proto.EnumName(RepeatedEnum_Color_name, int32(x)) |
| 169 | } |
| 170 | |
| 171 | type GoEnum struct { |
| 172 | Foo *FOO `protobuf:"varint,1,req,name=foo,enum=testdata.FOO" json:"foo,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 173 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | func (this *GoEnum) Reset() { *this = GoEnum{} } |
| 177 | func (this *GoEnum) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 178 | func (*GoEnum) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 179 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 180 | func (this *GoEnum) GetFoo() FOO { |
| 181 | if this != nil && this.Foo != nil { |
| 182 | return *this.Foo |
| 183 | } |
| 184 | return 0 |
| 185 | } |
| 186 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 187 | type GoTestField struct { |
| 188 | Label *string `protobuf:"bytes,1,req" json:"Label,omitempty"` |
| 189 | Type *string `protobuf:"bytes,2,req" json:"Type,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 190 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | func (this *GoTestField) Reset() { *this = GoTestField{} } |
| 194 | func (this *GoTestField) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 195 | func (*GoTestField) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 196 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 197 | func (this *GoTestField) GetLabel() string { |
| 198 | if this != nil && this.Label != nil { |
| 199 | return *this.Label |
| 200 | } |
| 201 | return "" |
| 202 | } |
| 203 | |
| 204 | func (this *GoTestField) GetType() string { |
| 205 | if this != nil && this.Type != nil { |
| 206 | return *this.Type |
| 207 | } |
| 208 | return "" |
| 209 | } |
| 210 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 211 | type GoTest struct { |
| 212 | Kind *GoTest_KIND `protobuf:"varint,1,req,enum=testdata.GoTest_KIND" json:"Kind,omitempty"` |
| 213 | Table *string `protobuf:"bytes,2,opt" json:"Table,omitempty"` |
| 214 | Param *int32 `protobuf:"varint,3,opt" json:"Param,omitempty"` |
| 215 | RequiredField *GoTestField `protobuf:"bytes,4,req" json:"RequiredField,omitempty"` |
| 216 | RepeatedField []*GoTestField `protobuf:"bytes,5,rep" json:"RepeatedField,omitempty"` |
| 217 | OptionalField *GoTestField `protobuf:"bytes,6,opt" json:"OptionalField,omitempty"` |
| 218 | F_BoolRequired *bool `protobuf:"varint,10,req,name=F_Bool_required" json:"F_Bool_required,omitempty"` |
| 219 | F_Int32Required *int32 `protobuf:"varint,11,req,name=F_Int32_required" json:"F_Int32_required,omitempty"` |
| 220 | F_Int64Required *int64 `protobuf:"varint,12,req,name=F_Int64_required" json:"F_Int64_required,omitempty"` |
| 221 | F_Fixed32Required *uint32 `protobuf:"fixed32,13,req,name=F_Fixed32_required" json:"F_Fixed32_required,omitempty"` |
| 222 | F_Fixed64Required *uint64 `protobuf:"fixed64,14,req,name=F_Fixed64_required" json:"F_Fixed64_required,omitempty"` |
| 223 | F_Uint32Required *uint32 `protobuf:"varint,15,req,name=F_Uint32_required" json:"F_Uint32_required,omitempty"` |
| 224 | F_Uint64Required *uint64 `protobuf:"varint,16,req,name=F_Uint64_required" json:"F_Uint64_required,omitempty"` |
| 225 | F_FloatRequired *float32 `protobuf:"fixed32,17,req,name=F_Float_required" json:"F_Float_required,omitempty"` |
| 226 | F_DoubleRequired *float64 `protobuf:"fixed64,18,req,name=F_Double_required" json:"F_Double_required,omitempty"` |
| 227 | F_StringRequired *string `protobuf:"bytes,19,req,name=F_String_required" json:"F_String_required,omitempty"` |
| 228 | F_BytesRequired []byte `protobuf:"bytes,101,req,name=F_Bytes_required" json:"F_Bytes_required,omitempty"` |
| 229 | F_Sint32Required *int32 `protobuf:"zigzag32,102,req,name=F_Sint32_required" json:"F_Sint32_required,omitempty"` |
| 230 | F_Sint64Required *int64 `protobuf:"zigzag64,103,req,name=F_Sint64_required" json:"F_Sint64_required,omitempty"` |
| 231 | F_BoolRepeated []bool `protobuf:"varint,20,rep,name=F_Bool_repeated" json:"F_Bool_repeated,omitempty"` |
| 232 | F_Int32Repeated []int32 `protobuf:"varint,21,rep,name=F_Int32_repeated" json:"F_Int32_repeated,omitempty"` |
| 233 | F_Int64Repeated []int64 `protobuf:"varint,22,rep,name=F_Int64_repeated" json:"F_Int64_repeated,omitempty"` |
| 234 | F_Fixed32Repeated []uint32 `protobuf:"fixed32,23,rep,name=F_Fixed32_repeated" json:"F_Fixed32_repeated,omitempty"` |
| 235 | F_Fixed64Repeated []uint64 `protobuf:"fixed64,24,rep,name=F_Fixed64_repeated" json:"F_Fixed64_repeated,omitempty"` |
| 236 | F_Uint32Repeated []uint32 `protobuf:"varint,25,rep,name=F_Uint32_repeated" json:"F_Uint32_repeated,omitempty"` |
| 237 | F_Uint64Repeated []uint64 `protobuf:"varint,26,rep,name=F_Uint64_repeated" json:"F_Uint64_repeated,omitempty"` |
| 238 | F_FloatRepeated []float32 `protobuf:"fixed32,27,rep,name=F_Float_repeated" json:"F_Float_repeated,omitempty"` |
| 239 | F_DoubleRepeated []float64 `protobuf:"fixed64,28,rep,name=F_Double_repeated" json:"F_Double_repeated,omitempty"` |
| 240 | F_StringRepeated []string `protobuf:"bytes,29,rep,name=F_String_repeated" json:"F_String_repeated,omitempty"` |
| 241 | F_BytesRepeated [][]byte `protobuf:"bytes,201,rep,name=F_Bytes_repeated" json:"F_Bytes_repeated,omitempty"` |
| 242 | F_Sint32Repeated []int32 `protobuf:"zigzag32,202,rep,name=F_Sint32_repeated" json:"F_Sint32_repeated,omitempty"` |
| 243 | F_Sint64Repeated []int64 `protobuf:"zigzag64,203,rep,name=F_Sint64_repeated" json:"F_Sint64_repeated,omitempty"` |
| 244 | F_BoolOptional *bool `protobuf:"varint,30,opt,name=F_Bool_optional" json:"F_Bool_optional,omitempty"` |
| 245 | F_Int32Optional *int32 `protobuf:"varint,31,opt,name=F_Int32_optional" json:"F_Int32_optional,omitempty"` |
| 246 | F_Int64Optional *int64 `protobuf:"varint,32,opt,name=F_Int64_optional" json:"F_Int64_optional,omitempty"` |
| 247 | F_Fixed32Optional *uint32 `protobuf:"fixed32,33,opt,name=F_Fixed32_optional" json:"F_Fixed32_optional,omitempty"` |
| 248 | F_Fixed64Optional *uint64 `protobuf:"fixed64,34,opt,name=F_Fixed64_optional" json:"F_Fixed64_optional,omitempty"` |
| 249 | F_Uint32Optional *uint32 `protobuf:"varint,35,opt,name=F_Uint32_optional" json:"F_Uint32_optional,omitempty"` |
| 250 | F_Uint64Optional *uint64 `protobuf:"varint,36,opt,name=F_Uint64_optional" json:"F_Uint64_optional,omitempty"` |
| 251 | F_FloatOptional *float32 `protobuf:"fixed32,37,opt,name=F_Float_optional" json:"F_Float_optional,omitempty"` |
| 252 | F_DoubleOptional *float64 `protobuf:"fixed64,38,opt,name=F_Double_optional" json:"F_Double_optional,omitempty"` |
| 253 | F_StringOptional *string `protobuf:"bytes,39,opt,name=F_String_optional" json:"F_String_optional,omitempty"` |
| 254 | F_BytesOptional []byte `protobuf:"bytes,301,opt,name=F_Bytes_optional" json:"F_Bytes_optional,omitempty"` |
| 255 | F_Sint32Optional *int32 `protobuf:"zigzag32,302,opt,name=F_Sint32_optional" json:"F_Sint32_optional,omitempty"` |
| 256 | F_Sint64Optional *int64 `protobuf:"zigzag64,303,opt,name=F_Sint64_optional" json:"F_Sint64_optional,omitempty"` |
| 257 | F_BoolDefaulted *bool `protobuf:"varint,40,opt,name=F_Bool_defaulted,def=1" json:"F_Bool_defaulted,omitempty"` |
| 258 | F_Int32Defaulted *int32 `protobuf:"varint,41,opt,name=F_Int32_defaulted,def=32" json:"F_Int32_defaulted,omitempty"` |
| 259 | F_Int64Defaulted *int64 `protobuf:"varint,42,opt,name=F_Int64_defaulted,def=64" json:"F_Int64_defaulted,omitempty"` |
| 260 | F_Fixed32Defaulted *uint32 `protobuf:"fixed32,43,opt,name=F_Fixed32_defaulted,def=320" json:"F_Fixed32_defaulted,omitempty"` |
| 261 | F_Fixed64Defaulted *uint64 `protobuf:"fixed64,44,opt,name=F_Fixed64_defaulted,def=640" json:"F_Fixed64_defaulted,omitempty"` |
| 262 | F_Uint32Defaulted *uint32 `protobuf:"varint,45,opt,name=F_Uint32_defaulted,def=3200" json:"F_Uint32_defaulted,omitempty"` |
| 263 | F_Uint64Defaulted *uint64 `protobuf:"varint,46,opt,name=F_Uint64_defaulted,def=6400" json:"F_Uint64_defaulted,omitempty"` |
| 264 | F_FloatDefaulted *float32 `protobuf:"fixed32,47,opt,name=F_Float_defaulted,def=314159" json:"F_Float_defaulted,omitempty"` |
| 265 | F_DoubleDefaulted *float64 `protobuf:"fixed64,48,opt,name=F_Double_defaulted,def=271828" json:"F_Double_defaulted,omitempty"` |
| 266 | F_StringDefaulted *string `protobuf:"bytes,49,opt,name=F_String_defaulted,def=hello, \"world!\"\n" json:"F_String_defaulted,omitempty"` |
| 267 | F_BytesDefaulted []byte `protobuf:"bytes,401,opt,name=F_Bytes_defaulted,def=Bignose" json:"F_Bytes_defaulted,omitempty"` |
| 268 | F_Sint32Defaulted *int32 `protobuf:"zigzag32,402,opt,name=F_Sint32_defaulted,def=-32" json:"F_Sint32_defaulted,omitempty"` |
| 269 | F_Sint64Defaulted *int64 `protobuf:"zigzag64,403,opt,name=F_Sint64_defaulted,def=-64" json:"F_Sint64_defaulted,omitempty"` |
| 270 | F_BoolRepeatedPacked []bool `protobuf:"varint,50,rep,packed,name=F_Bool_repeated_packed" json:"F_Bool_repeated_packed,omitempty"` |
| 271 | F_Int32RepeatedPacked []int32 `protobuf:"varint,51,rep,packed,name=F_Int32_repeated_packed" json:"F_Int32_repeated_packed,omitempty"` |
| 272 | F_Int64RepeatedPacked []int64 `protobuf:"varint,52,rep,packed,name=F_Int64_repeated_packed" json:"F_Int64_repeated_packed,omitempty"` |
| 273 | F_Fixed32RepeatedPacked []uint32 `protobuf:"fixed32,53,rep,packed,name=F_Fixed32_repeated_packed" json:"F_Fixed32_repeated_packed,omitempty"` |
| 274 | F_Fixed64RepeatedPacked []uint64 `protobuf:"fixed64,54,rep,packed,name=F_Fixed64_repeated_packed" json:"F_Fixed64_repeated_packed,omitempty"` |
| 275 | F_Uint32RepeatedPacked []uint32 `protobuf:"varint,55,rep,packed,name=F_Uint32_repeated_packed" json:"F_Uint32_repeated_packed,omitempty"` |
| 276 | F_Uint64RepeatedPacked []uint64 `protobuf:"varint,56,rep,packed,name=F_Uint64_repeated_packed" json:"F_Uint64_repeated_packed,omitempty"` |
| 277 | F_FloatRepeatedPacked []float32 `protobuf:"fixed32,57,rep,packed,name=F_Float_repeated_packed" json:"F_Float_repeated_packed,omitempty"` |
| 278 | F_DoubleRepeatedPacked []float64 `protobuf:"fixed64,58,rep,packed,name=F_Double_repeated_packed" json:"F_Double_repeated_packed,omitempty"` |
| 279 | F_Sint32RepeatedPacked []int32 `protobuf:"zigzag32,502,rep,packed,name=F_Sint32_repeated_packed" json:"F_Sint32_repeated_packed,omitempty"` |
| 280 | F_Sint64RepeatedPacked []int64 `protobuf:"zigzag64,503,rep,packed,name=F_Sint64_repeated_packed" json:"F_Sint64_repeated_packed,omitempty"` |
| 281 | Requiredgroup *GoTest_RequiredGroup `protobuf:"group,70,req,name=RequiredGroup" json:"requiredgroup,omitempty"` |
| 282 | Repeatedgroup []*GoTest_RepeatedGroup `protobuf:"group,80,rep,name=RepeatedGroup" json:"repeatedgroup,omitempty"` |
| 283 | Optionalgroup *GoTest_OptionalGroup `protobuf:"group,90,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 284 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 285 | } |
| 286 | |
| 287 | func (this *GoTest) Reset() { *this = GoTest{} } |
| 288 | func (this *GoTest) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 289 | func (*GoTest) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 290 | |
| 291 | const Default_GoTest_F_BoolDefaulted bool = true |
| 292 | const Default_GoTest_F_Int32Defaulted int32 = 32 |
| 293 | const Default_GoTest_F_Int64Defaulted int64 = 64 |
| 294 | const Default_GoTest_F_Fixed32Defaulted uint32 = 320 |
| 295 | const Default_GoTest_F_Fixed64Defaulted uint64 = 640 |
| 296 | const Default_GoTest_F_Uint32Defaulted uint32 = 3200 |
| 297 | const Default_GoTest_F_Uint64Defaulted uint64 = 6400 |
| 298 | const Default_GoTest_F_FloatDefaulted float32 = 314159 |
| 299 | const Default_GoTest_F_DoubleDefaulted float64 = 271828 |
| 300 | const Default_GoTest_F_StringDefaulted string = "hello, \"world!\"\n" |
| 301 | |
| 302 | var Default_GoTest_F_BytesDefaulted []byte = []byte("Bignose") |
| 303 | |
| 304 | const Default_GoTest_F_Sint32Defaulted int32 = -32 |
| 305 | const Default_GoTest_F_Sint64Defaulted int64 = -64 |
| 306 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 307 | func (this *GoTest) GetKind() GoTest_KIND { |
| 308 | if this != nil && this.Kind != nil { |
| 309 | return *this.Kind |
| 310 | } |
| 311 | return 0 |
| 312 | } |
| 313 | |
| 314 | func (this *GoTest) GetTable() string { |
| 315 | if this != nil && this.Table != nil { |
| 316 | return *this.Table |
| 317 | } |
| 318 | return "" |
| 319 | } |
| 320 | |
| 321 | func (this *GoTest) GetParam() int32 { |
| 322 | if this != nil && this.Param != nil { |
| 323 | return *this.Param |
| 324 | } |
| 325 | return 0 |
| 326 | } |
| 327 | |
| 328 | func (this *GoTest) GetRequiredField() *GoTestField { |
| 329 | if this != nil { |
| 330 | return this.RequiredField |
| 331 | } |
| 332 | return nil |
| 333 | } |
| 334 | |
| 335 | func (this *GoTest) GetOptionalField() *GoTestField { |
| 336 | if this != nil { |
| 337 | return this.OptionalField |
| 338 | } |
| 339 | return nil |
| 340 | } |
| 341 | |
| 342 | func (this *GoTest) GetF_BoolRequired() bool { |
| 343 | if this != nil && this.F_BoolRequired != nil { |
| 344 | return *this.F_BoolRequired |
| 345 | } |
| 346 | return false |
| 347 | } |
| 348 | |
| 349 | func (this *GoTest) GetF_Int32Required() int32 { |
| 350 | if this != nil && this.F_Int32Required != nil { |
| 351 | return *this.F_Int32Required |
| 352 | } |
| 353 | return 0 |
| 354 | } |
| 355 | |
| 356 | func (this *GoTest) GetF_Int64Required() int64 { |
| 357 | if this != nil && this.F_Int64Required != nil { |
| 358 | return *this.F_Int64Required |
| 359 | } |
| 360 | return 0 |
| 361 | } |
| 362 | |
| 363 | func (this *GoTest) GetF_Fixed32Required() uint32 { |
| 364 | if this != nil && this.F_Fixed32Required != nil { |
| 365 | return *this.F_Fixed32Required |
| 366 | } |
| 367 | return 0 |
| 368 | } |
| 369 | |
| 370 | func (this *GoTest) GetF_Fixed64Required() uint64 { |
| 371 | if this != nil && this.F_Fixed64Required != nil { |
| 372 | return *this.F_Fixed64Required |
| 373 | } |
| 374 | return 0 |
| 375 | } |
| 376 | |
| 377 | func (this *GoTest) GetF_Uint32Required() uint32 { |
| 378 | if this != nil && this.F_Uint32Required != nil { |
| 379 | return *this.F_Uint32Required |
| 380 | } |
| 381 | return 0 |
| 382 | } |
| 383 | |
| 384 | func (this *GoTest) GetF_Uint64Required() uint64 { |
| 385 | if this != nil && this.F_Uint64Required != nil { |
| 386 | return *this.F_Uint64Required |
| 387 | } |
| 388 | return 0 |
| 389 | } |
| 390 | |
| 391 | func (this *GoTest) GetF_FloatRequired() float32 { |
| 392 | if this != nil && this.F_FloatRequired != nil { |
| 393 | return *this.F_FloatRequired |
| 394 | } |
| 395 | return 0 |
| 396 | } |
| 397 | |
| 398 | func (this *GoTest) GetF_DoubleRequired() float64 { |
| 399 | if this != nil && this.F_DoubleRequired != nil { |
| 400 | return *this.F_DoubleRequired |
| 401 | } |
| 402 | return 0 |
| 403 | } |
| 404 | |
| 405 | func (this *GoTest) GetF_StringRequired() string { |
| 406 | if this != nil && this.F_StringRequired != nil { |
| 407 | return *this.F_StringRequired |
| 408 | } |
| 409 | return "" |
| 410 | } |
| 411 | |
| 412 | func (this *GoTest) GetF_BytesRequired() []byte { |
| 413 | if this != nil { |
| 414 | return this.F_BytesRequired |
| 415 | } |
| 416 | return nil |
| 417 | } |
| 418 | |
| 419 | func (this *GoTest) GetF_Sint32Required() int32 { |
| 420 | if this != nil && this.F_Sint32Required != nil { |
| 421 | return *this.F_Sint32Required |
| 422 | } |
| 423 | return 0 |
| 424 | } |
| 425 | |
| 426 | func (this *GoTest) GetF_Sint64Required() int64 { |
| 427 | if this != nil && this.F_Sint64Required != nil { |
| 428 | return *this.F_Sint64Required |
| 429 | } |
| 430 | return 0 |
| 431 | } |
| 432 | |
| 433 | func (this *GoTest) GetF_BoolOptional() bool { |
| 434 | if this != nil && this.F_BoolOptional != nil { |
| 435 | return *this.F_BoolOptional |
| 436 | } |
| 437 | return false |
| 438 | } |
| 439 | |
| 440 | func (this *GoTest) GetF_Int32Optional() int32 { |
| 441 | if this != nil && this.F_Int32Optional != nil { |
| 442 | return *this.F_Int32Optional |
| 443 | } |
| 444 | return 0 |
| 445 | } |
| 446 | |
| 447 | func (this *GoTest) GetF_Int64Optional() int64 { |
| 448 | if this != nil && this.F_Int64Optional != nil { |
| 449 | return *this.F_Int64Optional |
| 450 | } |
| 451 | return 0 |
| 452 | } |
| 453 | |
| 454 | func (this *GoTest) GetF_Fixed32Optional() uint32 { |
| 455 | if this != nil && this.F_Fixed32Optional != nil { |
| 456 | return *this.F_Fixed32Optional |
| 457 | } |
| 458 | return 0 |
| 459 | } |
| 460 | |
| 461 | func (this *GoTest) GetF_Fixed64Optional() uint64 { |
| 462 | if this != nil && this.F_Fixed64Optional != nil { |
| 463 | return *this.F_Fixed64Optional |
| 464 | } |
| 465 | return 0 |
| 466 | } |
| 467 | |
| 468 | func (this *GoTest) GetF_Uint32Optional() uint32 { |
| 469 | if this != nil && this.F_Uint32Optional != nil { |
| 470 | return *this.F_Uint32Optional |
| 471 | } |
| 472 | return 0 |
| 473 | } |
| 474 | |
| 475 | func (this *GoTest) GetF_Uint64Optional() uint64 { |
| 476 | if this != nil && this.F_Uint64Optional != nil { |
| 477 | return *this.F_Uint64Optional |
| 478 | } |
| 479 | return 0 |
| 480 | } |
| 481 | |
| 482 | func (this *GoTest) GetF_FloatOptional() float32 { |
| 483 | if this != nil && this.F_FloatOptional != nil { |
| 484 | return *this.F_FloatOptional |
| 485 | } |
| 486 | return 0 |
| 487 | } |
| 488 | |
| 489 | func (this *GoTest) GetF_DoubleOptional() float64 { |
| 490 | if this != nil && this.F_DoubleOptional != nil { |
| 491 | return *this.F_DoubleOptional |
| 492 | } |
| 493 | return 0 |
| 494 | } |
| 495 | |
| 496 | func (this *GoTest) GetF_StringOptional() string { |
| 497 | if this != nil && this.F_StringOptional != nil { |
| 498 | return *this.F_StringOptional |
| 499 | } |
| 500 | return "" |
| 501 | } |
| 502 | |
| 503 | func (this *GoTest) GetF_BytesOptional() []byte { |
| 504 | if this != nil { |
| 505 | return this.F_BytesOptional |
| 506 | } |
| 507 | return nil |
| 508 | } |
| 509 | |
| 510 | func (this *GoTest) GetF_Sint32Optional() int32 { |
| 511 | if this != nil && this.F_Sint32Optional != nil { |
| 512 | return *this.F_Sint32Optional |
| 513 | } |
| 514 | return 0 |
| 515 | } |
| 516 | |
| 517 | func (this *GoTest) GetF_Sint64Optional() int64 { |
| 518 | if this != nil && this.F_Sint64Optional != nil { |
| 519 | return *this.F_Sint64Optional |
| 520 | } |
| 521 | return 0 |
| 522 | } |
| 523 | |
| 524 | func (this *GoTest) GetF_BoolDefaulted() bool { |
| 525 | if this != nil && this.F_BoolDefaulted != nil { |
| 526 | return *this.F_BoolDefaulted |
| 527 | } |
| 528 | return Default_GoTest_F_BoolDefaulted |
| 529 | } |
| 530 | |
| 531 | func (this *GoTest) GetF_Int32Defaulted() int32 { |
| 532 | if this != nil && this.F_Int32Defaulted != nil { |
| 533 | return *this.F_Int32Defaulted |
| 534 | } |
| 535 | return Default_GoTest_F_Int32Defaulted |
| 536 | } |
| 537 | |
| 538 | func (this *GoTest) GetF_Int64Defaulted() int64 { |
| 539 | if this != nil && this.F_Int64Defaulted != nil { |
| 540 | return *this.F_Int64Defaulted |
| 541 | } |
| 542 | return Default_GoTest_F_Int64Defaulted |
| 543 | } |
| 544 | |
| 545 | func (this *GoTest) GetF_Fixed32Defaulted() uint32 { |
| 546 | if this != nil && this.F_Fixed32Defaulted != nil { |
| 547 | return *this.F_Fixed32Defaulted |
| 548 | } |
| 549 | return Default_GoTest_F_Fixed32Defaulted |
| 550 | } |
| 551 | |
| 552 | func (this *GoTest) GetF_Fixed64Defaulted() uint64 { |
| 553 | if this != nil && this.F_Fixed64Defaulted != nil { |
| 554 | return *this.F_Fixed64Defaulted |
| 555 | } |
| 556 | return Default_GoTest_F_Fixed64Defaulted |
| 557 | } |
| 558 | |
| 559 | func (this *GoTest) GetF_Uint32Defaulted() uint32 { |
| 560 | if this != nil && this.F_Uint32Defaulted != nil { |
| 561 | return *this.F_Uint32Defaulted |
| 562 | } |
| 563 | return Default_GoTest_F_Uint32Defaulted |
| 564 | } |
| 565 | |
| 566 | func (this *GoTest) GetF_Uint64Defaulted() uint64 { |
| 567 | if this != nil && this.F_Uint64Defaulted != nil { |
| 568 | return *this.F_Uint64Defaulted |
| 569 | } |
| 570 | return Default_GoTest_F_Uint64Defaulted |
| 571 | } |
| 572 | |
| 573 | func (this *GoTest) GetF_FloatDefaulted() float32 { |
| 574 | if this != nil && this.F_FloatDefaulted != nil { |
| 575 | return *this.F_FloatDefaulted |
| 576 | } |
| 577 | return Default_GoTest_F_FloatDefaulted |
| 578 | } |
| 579 | |
| 580 | func (this *GoTest) GetF_DoubleDefaulted() float64 { |
| 581 | if this != nil && this.F_DoubleDefaulted != nil { |
| 582 | return *this.F_DoubleDefaulted |
| 583 | } |
| 584 | return Default_GoTest_F_DoubleDefaulted |
| 585 | } |
| 586 | |
| 587 | func (this *GoTest) GetF_StringDefaulted() string { |
| 588 | if this != nil && this.F_StringDefaulted != nil { |
| 589 | return *this.F_StringDefaulted |
| 590 | } |
| 591 | return Default_GoTest_F_StringDefaulted |
| 592 | } |
| 593 | |
| 594 | func (this *GoTest) GetF_BytesDefaulted() []byte { |
| 595 | if this != nil && this.F_BytesDefaulted != nil { |
| 596 | return this.F_BytesDefaulted |
| 597 | } |
| 598 | return append([]byte(nil), Default_GoTest_F_BytesDefaulted...) |
| 599 | } |
| 600 | |
| 601 | func (this *GoTest) GetF_Sint32Defaulted() int32 { |
| 602 | if this != nil && this.F_Sint32Defaulted != nil { |
| 603 | return *this.F_Sint32Defaulted |
| 604 | } |
| 605 | return Default_GoTest_F_Sint32Defaulted |
| 606 | } |
| 607 | |
| 608 | func (this *GoTest) GetF_Sint64Defaulted() int64 { |
| 609 | if this != nil && this.F_Sint64Defaulted != nil { |
| 610 | return *this.F_Sint64Defaulted |
| 611 | } |
| 612 | return Default_GoTest_F_Sint64Defaulted |
| 613 | } |
| 614 | |
| 615 | func (this *GoTest) GetRequiredgroup() *GoTest_RequiredGroup { |
| 616 | if this != nil { |
| 617 | return this.Requiredgroup |
| 618 | } |
| 619 | return nil |
| 620 | } |
| 621 | |
| 622 | func (this *GoTest) GetOptionalgroup() *GoTest_OptionalGroup { |
| 623 | if this != nil { |
| 624 | return this.Optionalgroup |
| 625 | } |
| 626 | return nil |
| 627 | } |
| 628 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 629 | type GoTest_RequiredGroup struct { |
| 630 | RequiredField *string `protobuf:"bytes,71,req" json:"RequiredField,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 631 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 632 | } |
| 633 | |
| 634 | func (this *GoTest_RequiredGroup) Reset() { *this = GoTest_RequiredGroup{} } |
| 635 | func (this *GoTest_RequiredGroup) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 636 | func (*GoTest_RequiredGroup) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 637 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 638 | func (this *GoTest_RequiredGroup) GetRequiredField() string { |
| 639 | if this != nil && this.RequiredField != nil { |
| 640 | return *this.RequiredField |
| 641 | } |
| 642 | return "" |
| 643 | } |
| 644 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 645 | type GoTest_RepeatedGroup struct { |
| 646 | RequiredField *string `protobuf:"bytes,81,req" json:"RequiredField,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 647 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 648 | } |
| 649 | |
| 650 | func (this *GoTest_RepeatedGroup) Reset() { *this = GoTest_RepeatedGroup{} } |
| 651 | func (this *GoTest_RepeatedGroup) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 652 | func (*GoTest_RepeatedGroup) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 653 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 654 | func (this *GoTest_RepeatedGroup) GetRequiredField() string { |
| 655 | if this != nil && this.RequiredField != nil { |
| 656 | return *this.RequiredField |
| 657 | } |
| 658 | return "" |
| 659 | } |
| 660 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 661 | type GoTest_OptionalGroup struct { |
| 662 | RequiredField *string `protobuf:"bytes,91,req" json:"RequiredField,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 663 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 664 | } |
| 665 | |
| 666 | func (this *GoTest_OptionalGroup) Reset() { *this = GoTest_OptionalGroup{} } |
| 667 | func (this *GoTest_OptionalGroup) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 668 | func (*GoTest_OptionalGroup) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 669 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 670 | func (this *GoTest_OptionalGroup) GetRequiredField() string { |
| 671 | if this != nil && this.RequiredField != nil { |
| 672 | return *this.RequiredField |
| 673 | } |
| 674 | return "" |
| 675 | } |
| 676 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 677 | type GoSkipTest struct { |
| 678 | SkipInt32 *int32 `protobuf:"varint,11,req,name=skip_int32" json:"skip_int32,omitempty"` |
| 679 | SkipFixed32 *uint32 `protobuf:"fixed32,12,req,name=skip_fixed32" json:"skip_fixed32,omitempty"` |
| 680 | SkipFixed64 *uint64 `protobuf:"fixed64,13,req,name=skip_fixed64" json:"skip_fixed64,omitempty"` |
| 681 | SkipString *string `protobuf:"bytes,14,req,name=skip_string" json:"skip_string,omitempty"` |
| 682 | Skipgroup *GoSkipTest_SkipGroup `protobuf:"group,15,req,name=SkipGroup" json:"skipgroup,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 683 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 684 | } |
| 685 | |
| 686 | func (this *GoSkipTest) Reset() { *this = GoSkipTest{} } |
| 687 | func (this *GoSkipTest) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 688 | func (*GoSkipTest) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 689 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 690 | func (this *GoSkipTest) GetSkipInt32() int32 { |
| 691 | if this != nil && this.SkipInt32 != nil { |
| 692 | return *this.SkipInt32 |
| 693 | } |
| 694 | return 0 |
| 695 | } |
| 696 | |
| 697 | func (this *GoSkipTest) GetSkipFixed32() uint32 { |
| 698 | if this != nil && this.SkipFixed32 != nil { |
| 699 | return *this.SkipFixed32 |
| 700 | } |
| 701 | return 0 |
| 702 | } |
| 703 | |
| 704 | func (this *GoSkipTest) GetSkipFixed64() uint64 { |
| 705 | if this != nil && this.SkipFixed64 != nil { |
| 706 | return *this.SkipFixed64 |
| 707 | } |
| 708 | return 0 |
| 709 | } |
| 710 | |
| 711 | func (this *GoSkipTest) GetSkipString() string { |
| 712 | if this != nil && this.SkipString != nil { |
| 713 | return *this.SkipString |
| 714 | } |
| 715 | return "" |
| 716 | } |
| 717 | |
| 718 | func (this *GoSkipTest) GetSkipgroup() *GoSkipTest_SkipGroup { |
| 719 | if this != nil { |
| 720 | return this.Skipgroup |
| 721 | } |
| 722 | return nil |
| 723 | } |
| 724 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 725 | type GoSkipTest_SkipGroup struct { |
| 726 | GroupInt32 *int32 `protobuf:"varint,16,req,name=group_int32" json:"group_int32,omitempty"` |
| 727 | GroupString *string `protobuf:"bytes,17,req,name=group_string" json:"group_string,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 728 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 729 | } |
| 730 | |
| 731 | func (this *GoSkipTest_SkipGroup) Reset() { *this = GoSkipTest_SkipGroup{} } |
| 732 | func (this *GoSkipTest_SkipGroup) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 733 | func (*GoSkipTest_SkipGroup) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 734 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 735 | func (this *GoSkipTest_SkipGroup) GetGroupInt32() int32 { |
| 736 | if this != nil && this.GroupInt32 != nil { |
| 737 | return *this.GroupInt32 |
| 738 | } |
| 739 | return 0 |
| 740 | } |
| 741 | |
| 742 | func (this *GoSkipTest_SkipGroup) GetGroupString() string { |
| 743 | if this != nil && this.GroupString != nil { |
| 744 | return *this.GroupString |
| 745 | } |
| 746 | return "" |
| 747 | } |
| 748 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 749 | type NonPackedTest struct { |
| 750 | A []int32 `protobuf:"varint,1,rep,name=a" json:"a,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 751 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 752 | } |
| 753 | |
| 754 | func (this *NonPackedTest) Reset() { *this = NonPackedTest{} } |
| 755 | func (this *NonPackedTest) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 756 | func (*NonPackedTest) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 757 | |
| 758 | type PackedTest struct { |
| 759 | B []int32 `protobuf:"varint,1,rep,packed,name=b" json:"b,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 760 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 761 | } |
| 762 | |
| 763 | func (this *PackedTest) Reset() { *this = PackedTest{} } |
| 764 | func (this *PackedTest) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 765 | func (*PackedTest) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 766 | |
| 767 | type MaxTag struct { |
| 768 | LastField *string `protobuf:"bytes,536870911,opt,name=last_field" json:"last_field,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 769 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 770 | } |
| 771 | |
| 772 | func (this *MaxTag) Reset() { *this = MaxTag{} } |
| 773 | func (this *MaxTag) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 774 | func (*MaxTag) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 775 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 776 | func (this *MaxTag) GetLastField() string { |
| 777 | if this != nil && this.LastField != nil { |
| 778 | return *this.LastField |
| 779 | } |
| 780 | return "" |
| 781 | } |
| 782 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 783 | type InnerMessage struct { |
| 784 | Host *string `protobuf:"bytes,1,req,name=host" json:"host,omitempty"` |
| 785 | Port *int32 `protobuf:"varint,2,opt,name=port,def=4000" json:"port,omitempty"` |
| 786 | Connected *bool `protobuf:"varint,3,opt,name=connected" json:"connected,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 787 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 788 | } |
| 789 | |
| 790 | func (this *InnerMessage) Reset() { *this = InnerMessage{} } |
| 791 | func (this *InnerMessage) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 792 | func (*InnerMessage) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 793 | |
| 794 | const Default_InnerMessage_Port int32 = 4000 |
| 795 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 796 | func (this *InnerMessage) GetHost() string { |
| 797 | if this != nil && this.Host != nil { |
| 798 | return *this.Host |
| 799 | } |
| 800 | return "" |
| 801 | } |
| 802 | |
| 803 | func (this *InnerMessage) GetPort() int32 { |
| 804 | if this != nil && this.Port != nil { |
| 805 | return *this.Port |
| 806 | } |
| 807 | return Default_InnerMessage_Port |
| 808 | } |
| 809 | |
| 810 | func (this *InnerMessage) GetConnected() bool { |
| 811 | if this != nil && this.Connected != nil { |
| 812 | return *this.Connected |
| 813 | } |
| 814 | return false |
| 815 | } |
| 816 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 817 | type OtherMessage struct { |
| 818 | Key *int64 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"` |
| 819 | Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` |
| 820 | Weight *float32 `protobuf:"fixed32,3,opt,name=weight" json:"weight,omitempty"` |
| 821 | Inner *InnerMessage `protobuf:"bytes,4,opt,name=inner" json:"inner,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 822 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 823 | } |
| 824 | |
| 825 | func (this *OtherMessage) Reset() { *this = OtherMessage{} } |
| 826 | func (this *OtherMessage) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 827 | func (*OtherMessage) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 828 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 829 | func (this *OtherMessage) GetKey() int64 { |
| 830 | if this != nil && this.Key != nil { |
| 831 | return *this.Key |
| 832 | } |
| 833 | return 0 |
| 834 | } |
| 835 | |
| 836 | func (this *OtherMessage) GetValue() []byte { |
| 837 | if this != nil { |
| 838 | return this.Value |
| 839 | } |
| 840 | return nil |
| 841 | } |
| 842 | |
| 843 | func (this *OtherMessage) GetWeight() float32 { |
| 844 | if this != nil && this.Weight != nil { |
| 845 | return *this.Weight |
| 846 | } |
| 847 | return 0 |
| 848 | } |
| 849 | |
| 850 | func (this *OtherMessage) GetInner() *InnerMessage { |
| 851 | if this != nil { |
| 852 | return this.Inner |
| 853 | } |
| 854 | return nil |
| 855 | } |
| 856 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 857 | type MyMessage struct { |
| 858 | Count *int32 `protobuf:"varint,1,req,name=count" json:"count,omitempty"` |
| 859 | Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` |
| 860 | Quote *string `protobuf:"bytes,3,opt,name=quote" json:"quote,omitempty"` |
| 861 | Pet []string `protobuf:"bytes,4,rep,name=pet" json:"pet,omitempty"` |
| 862 | Inner *InnerMessage `protobuf:"bytes,5,opt,name=inner" json:"inner,omitempty"` |
| 863 | Others []*OtherMessage `protobuf:"bytes,6,rep,name=others" json:"others,omitempty"` |
| 864 | Bikeshed *MyMessage_Color `protobuf:"varint,7,opt,name=bikeshed,enum=testdata.MyMessage_Color" json:"bikeshed,omitempty"` |
| 865 | Somegroup *MyMessage_SomeGroup `protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"` |
| 866 | RepBytes [][]byte `protobuf:"bytes,10,rep,name=rep_bytes" json:"rep_bytes,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 867 | XXX_extensions map[int32]proto.Extension `json:"-"` |
| 868 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 869 | } |
| 870 | |
| 871 | func (this *MyMessage) Reset() { *this = MyMessage{} } |
| 872 | func (this *MyMessage) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 873 | func (*MyMessage) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 874 | |
| 875 | var extRange_MyMessage = []proto.ExtensionRange{ |
| 876 | {100, 536870911}, |
| 877 | } |
| 878 | |
| 879 | func (*MyMessage) ExtensionRangeArray() []proto.ExtensionRange { |
| 880 | return extRange_MyMessage |
| 881 | } |
| 882 | func (this *MyMessage) ExtensionMap() map[int32]proto.Extension { |
| 883 | if this.XXX_extensions == nil { |
| 884 | this.XXX_extensions = make(map[int32]proto.Extension) |
| 885 | } |
| 886 | return this.XXX_extensions |
| 887 | } |
| 888 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 889 | func (this *MyMessage) GetCount() int32 { |
| 890 | if this != nil && this.Count != nil { |
| 891 | return *this.Count |
| 892 | } |
| 893 | return 0 |
| 894 | } |
| 895 | |
| 896 | func (this *MyMessage) GetName() string { |
| 897 | if this != nil && this.Name != nil { |
| 898 | return *this.Name |
| 899 | } |
| 900 | return "" |
| 901 | } |
| 902 | |
| 903 | func (this *MyMessage) GetQuote() string { |
| 904 | if this != nil && this.Quote != nil { |
| 905 | return *this.Quote |
| 906 | } |
| 907 | return "" |
| 908 | } |
| 909 | |
| 910 | func (this *MyMessage) GetInner() *InnerMessage { |
| 911 | if this != nil { |
| 912 | return this.Inner |
| 913 | } |
| 914 | return nil |
| 915 | } |
| 916 | |
| 917 | func (this *MyMessage) GetBikeshed() MyMessage_Color { |
| 918 | if this != nil && this.Bikeshed != nil { |
| 919 | return *this.Bikeshed |
| 920 | } |
| 921 | return 0 |
| 922 | } |
| 923 | |
| 924 | func (this *MyMessage) GetSomegroup() *MyMessage_SomeGroup { |
| 925 | if this != nil { |
| 926 | return this.Somegroup |
| 927 | } |
| 928 | return nil |
| 929 | } |
| 930 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 931 | type MyMessage_SomeGroup struct { |
| 932 | GroupField *int32 `protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 933 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 934 | } |
| 935 | |
| 936 | func (this *MyMessage_SomeGroup) Reset() { *this = MyMessage_SomeGroup{} } |
| 937 | func (this *MyMessage_SomeGroup) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 938 | func (*MyMessage_SomeGroup) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 939 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 940 | func (this *MyMessage_SomeGroup) GetGroupField() int32 { |
| 941 | if this != nil && this.GroupField != nil { |
| 942 | return *this.GroupField |
| 943 | } |
| 944 | return 0 |
| 945 | } |
| 946 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 947 | type Ext struct { |
| 948 | Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 949 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 950 | } |
| 951 | |
| 952 | func (this *Ext) Reset() { *this = Ext{} } |
| 953 | func (this *Ext) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 954 | func (*Ext) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 955 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 956 | func (this *Ext) GetData() string { |
| 957 | if this != nil && this.Data != nil { |
| 958 | return *this.Data |
| 959 | } |
| 960 | return "" |
| 961 | } |
| 962 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 963 | var E_Ext_More = &proto.ExtensionDesc{ |
| 964 | ExtendedType: (*MyMessage)(nil), |
| 965 | ExtensionType: (*Ext)(nil), |
| 966 | Field: 103, |
| 967 | Name: "testdata.Ext.more", |
| 968 | Tag: "bytes,103,opt,name=more", |
| 969 | } |
| 970 | |
| 971 | var E_Ext_Text = &proto.ExtensionDesc{ |
| 972 | ExtendedType: (*MyMessage)(nil), |
| 973 | ExtensionType: (*string)(nil), |
| 974 | Field: 104, |
| 975 | Name: "testdata.Ext.text", |
| 976 | Tag: "bytes,104,opt,name=text", |
| 977 | } |
| 978 | |
| 979 | var E_Ext_Number = &proto.ExtensionDesc{ |
| 980 | ExtendedType: (*MyMessage)(nil), |
| 981 | ExtensionType: (*int32)(nil), |
| 982 | Field: 105, |
| 983 | Name: "testdata.Ext.number", |
| 984 | Tag: "varint,105,opt,name=number", |
| 985 | } |
| 986 | |
| 987 | type MessageList struct { |
| 988 | Message []*MessageList_Message `protobuf:"group,1,rep" json:"message,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 989 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 990 | } |
| 991 | |
| 992 | func (this *MessageList) Reset() { *this = MessageList{} } |
| 993 | func (this *MessageList) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 994 | func (*MessageList) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 995 | |
| 996 | type MessageList_Message struct { |
| 997 | Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` |
| 998 | Count *int32 `protobuf:"varint,3,req,name=count" json:"count,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 999 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1000 | } |
| 1001 | |
| 1002 | func (this *MessageList_Message) Reset() { *this = MessageList_Message{} } |
| 1003 | func (this *MessageList_Message) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1004 | func (*MessageList_Message) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1005 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 1006 | func (this *MessageList_Message) GetName() string { |
| 1007 | if this != nil && this.Name != nil { |
| 1008 | return *this.Name |
| 1009 | } |
| 1010 | return "" |
| 1011 | } |
| 1012 | |
| 1013 | func (this *MessageList_Message) GetCount() int32 { |
| 1014 | if this != nil && this.Count != nil { |
| 1015 | return *this.Count |
| 1016 | } |
| 1017 | return 0 |
| 1018 | } |
| 1019 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1020 | type Strings struct { |
| 1021 | StringField *string `protobuf:"bytes,1,opt,name=string_field" json:"string_field,omitempty"` |
| 1022 | BytesField []byte `protobuf:"bytes,2,opt,name=bytes_field" json:"bytes_field,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1023 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1024 | } |
| 1025 | |
| 1026 | func (this *Strings) Reset() { *this = Strings{} } |
| 1027 | func (this *Strings) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1028 | func (*Strings) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1029 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 1030 | func (this *Strings) GetStringField() string { |
| 1031 | if this != nil && this.StringField != nil { |
| 1032 | return *this.StringField |
| 1033 | } |
| 1034 | return "" |
| 1035 | } |
| 1036 | |
| 1037 | func (this *Strings) GetBytesField() []byte { |
| 1038 | if this != nil { |
| 1039 | return this.BytesField |
| 1040 | } |
| 1041 | return nil |
| 1042 | } |
| 1043 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1044 | type Defaults struct { |
| 1045 | F_Bool *bool `protobuf:"varint,1,opt,def=1" json:"F_Bool,omitempty"` |
| 1046 | F_Int32 *int32 `protobuf:"varint,2,opt,def=32" json:"F_Int32,omitempty"` |
| 1047 | F_Int64 *int64 `protobuf:"varint,3,opt,def=64" json:"F_Int64,omitempty"` |
| 1048 | F_Fixed32 *uint32 `protobuf:"fixed32,4,opt,def=320" json:"F_Fixed32,omitempty"` |
| 1049 | F_Fixed64 *uint64 `protobuf:"fixed64,5,opt,def=640" json:"F_Fixed64,omitempty"` |
| 1050 | F_Uint32 *uint32 `protobuf:"varint,6,opt,def=3200" json:"F_Uint32,omitempty"` |
| 1051 | F_Uint64 *uint64 `protobuf:"varint,7,opt,def=6400" json:"F_Uint64,omitempty"` |
| 1052 | F_Float *float32 `protobuf:"fixed32,8,opt,def=314159" json:"F_Float,omitempty"` |
| 1053 | F_Double *float64 `protobuf:"fixed64,9,opt,def=271828" json:"F_Double,omitempty"` |
| 1054 | F_String *string `protobuf:"bytes,10,opt,def=hello, \"world!\"\n" json:"F_String,omitempty"` |
| 1055 | F_Bytes []byte `protobuf:"bytes,11,opt,def=Bignose" json:"F_Bytes,omitempty"` |
| 1056 | F_Sint32 *int32 `protobuf:"zigzag32,12,opt,def=-32" json:"F_Sint32,omitempty"` |
| 1057 | F_Sint64 *int64 `protobuf:"zigzag64,13,opt,def=-64" json:"F_Sint64,omitempty"` |
| 1058 | F_Enum *Defaults_Color `protobuf:"varint,14,opt,enum=testdata.Defaults_Color,def=1" json:"F_Enum,omitempty"` |
| 1059 | F_Pinf *float32 `protobuf:"fixed32,15,opt,def=inf" json:"F_Pinf,omitempty"` |
| 1060 | F_Ninf *float32 `protobuf:"fixed32,16,opt,def=-inf" json:"F_Ninf,omitempty"` |
| 1061 | F_Nan *float32 `protobuf:"fixed32,17,opt,def=nan" json:"F_Nan,omitempty"` |
| 1062 | Sub *SubDefaults `protobuf:"bytes,18,opt,name=sub" json:"sub,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1063 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1064 | } |
| 1065 | |
| 1066 | func (this *Defaults) Reset() { *this = Defaults{} } |
| 1067 | func (this *Defaults) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1068 | func (*Defaults) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1069 | |
| 1070 | const Default_Defaults_F_Bool bool = true |
| 1071 | const Default_Defaults_F_Int32 int32 = 32 |
| 1072 | const Default_Defaults_F_Int64 int64 = 64 |
| 1073 | const Default_Defaults_F_Fixed32 uint32 = 320 |
| 1074 | const Default_Defaults_F_Fixed64 uint64 = 640 |
| 1075 | const Default_Defaults_F_Uint32 uint32 = 3200 |
| 1076 | const Default_Defaults_F_Uint64 uint64 = 6400 |
| 1077 | const Default_Defaults_F_Float float32 = 314159 |
| 1078 | const Default_Defaults_F_Double float64 = 271828 |
| 1079 | const Default_Defaults_F_String string = "hello, \"world!\"\n" |
| 1080 | |
| 1081 | var Default_Defaults_F_Bytes []byte = []byte("Bignose") |
| 1082 | |
| 1083 | const Default_Defaults_F_Sint32 int32 = -32 |
| 1084 | const Default_Defaults_F_Sint64 int64 = -64 |
| 1085 | const Default_Defaults_F_Enum Defaults_Color = Defaults_GREEN |
| 1086 | |
| 1087 | var Default_Defaults_F_Pinf float32 = float32(math.Inf(1)) |
| 1088 | var Default_Defaults_F_Ninf float32 = float32(math.Inf(-1)) |
| 1089 | var Default_Defaults_F_Nan float32 = float32(math.NaN()) |
| 1090 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 1091 | func (this *Defaults) GetF_Bool() bool { |
| 1092 | if this != nil && this.F_Bool != nil { |
| 1093 | return *this.F_Bool |
| 1094 | } |
| 1095 | return Default_Defaults_F_Bool |
| 1096 | } |
| 1097 | |
| 1098 | func (this *Defaults) GetF_Int32() int32 { |
| 1099 | if this != nil && this.F_Int32 != nil { |
| 1100 | return *this.F_Int32 |
| 1101 | } |
| 1102 | return Default_Defaults_F_Int32 |
| 1103 | } |
| 1104 | |
| 1105 | func (this *Defaults) GetF_Int64() int64 { |
| 1106 | if this != nil && this.F_Int64 != nil { |
| 1107 | return *this.F_Int64 |
| 1108 | } |
| 1109 | return Default_Defaults_F_Int64 |
| 1110 | } |
| 1111 | |
| 1112 | func (this *Defaults) GetF_Fixed32() uint32 { |
| 1113 | if this != nil && this.F_Fixed32 != nil { |
| 1114 | return *this.F_Fixed32 |
| 1115 | } |
| 1116 | return Default_Defaults_F_Fixed32 |
| 1117 | } |
| 1118 | |
| 1119 | func (this *Defaults) GetF_Fixed64() uint64 { |
| 1120 | if this != nil && this.F_Fixed64 != nil { |
| 1121 | return *this.F_Fixed64 |
| 1122 | } |
| 1123 | return Default_Defaults_F_Fixed64 |
| 1124 | } |
| 1125 | |
| 1126 | func (this *Defaults) GetF_Uint32() uint32 { |
| 1127 | if this != nil && this.F_Uint32 != nil { |
| 1128 | return *this.F_Uint32 |
| 1129 | } |
| 1130 | return Default_Defaults_F_Uint32 |
| 1131 | } |
| 1132 | |
| 1133 | func (this *Defaults) GetF_Uint64() uint64 { |
| 1134 | if this != nil && this.F_Uint64 != nil { |
| 1135 | return *this.F_Uint64 |
| 1136 | } |
| 1137 | return Default_Defaults_F_Uint64 |
| 1138 | } |
| 1139 | |
| 1140 | func (this *Defaults) GetF_Float() float32 { |
| 1141 | if this != nil && this.F_Float != nil { |
| 1142 | return *this.F_Float |
| 1143 | } |
| 1144 | return Default_Defaults_F_Float |
| 1145 | } |
| 1146 | |
| 1147 | func (this *Defaults) GetF_Double() float64 { |
| 1148 | if this != nil && this.F_Double != nil { |
| 1149 | return *this.F_Double |
| 1150 | } |
| 1151 | return Default_Defaults_F_Double |
| 1152 | } |
| 1153 | |
| 1154 | func (this *Defaults) GetF_String() string { |
| 1155 | if this != nil && this.F_String != nil { |
| 1156 | return *this.F_String |
| 1157 | } |
| 1158 | return Default_Defaults_F_String |
| 1159 | } |
| 1160 | |
| 1161 | func (this *Defaults) GetF_Bytes() []byte { |
| 1162 | if this != nil && this.F_Bytes != nil { |
| 1163 | return this.F_Bytes |
| 1164 | } |
| 1165 | return append([]byte(nil), Default_Defaults_F_Bytes...) |
| 1166 | } |
| 1167 | |
| 1168 | func (this *Defaults) GetF_Sint32() int32 { |
| 1169 | if this != nil && this.F_Sint32 != nil { |
| 1170 | return *this.F_Sint32 |
| 1171 | } |
| 1172 | return Default_Defaults_F_Sint32 |
| 1173 | } |
| 1174 | |
| 1175 | func (this *Defaults) GetF_Sint64() int64 { |
| 1176 | if this != nil && this.F_Sint64 != nil { |
| 1177 | return *this.F_Sint64 |
| 1178 | } |
| 1179 | return Default_Defaults_F_Sint64 |
| 1180 | } |
| 1181 | |
| 1182 | func (this *Defaults) GetF_Enum() Defaults_Color { |
| 1183 | if this != nil && this.F_Enum != nil { |
| 1184 | return *this.F_Enum |
| 1185 | } |
| 1186 | return Default_Defaults_F_Enum |
| 1187 | } |
| 1188 | |
| 1189 | func (this *Defaults) GetF_Pinf() float32 { |
| 1190 | if this != nil && this.F_Pinf != nil { |
| 1191 | return *this.F_Pinf |
| 1192 | } |
| 1193 | return Default_Defaults_F_Pinf |
| 1194 | } |
| 1195 | |
| 1196 | func (this *Defaults) GetF_Ninf() float32 { |
| 1197 | if this != nil && this.F_Ninf != nil { |
| 1198 | return *this.F_Ninf |
| 1199 | } |
| 1200 | return Default_Defaults_F_Ninf |
| 1201 | } |
| 1202 | |
| 1203 | func (this *Defaults) GetF_Nan() float32 { |
| 1204 | if this != nil && this.F_Nan != nil { |
| 1205 | return *this.F_Nan |
| 1206 | } |
| 1207 | return Default_Defaults_F_Nan |
| 1208 | } |
| 1209 | |
| 1210 | func (this *Defaults) GetSub() *SubDefaults { |
| 1211 | if this != nil { |
| 1212 | return this.Sub |
| 1213 | } |
| 1214 | return nil |
| 1215 | } |
| 1216 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1217 | type SubDefaults struct { |
| 1218 | N *int64 `protobuf:"varint,1,opt,name=n,def=7" json:"n,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1219 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1220 | } |
| 1221 | |
| 1222 | func (this *SubDefaults) Reset() { *this = SubDefaults{} } |
| 1223 | func (this *SubDefaults) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1224 | func (*SubDefaults) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1225 | |
| 1226 | const Default_SubDefaults_N int64 = 7 |
| 1227 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame^] | 1228 | func (this *SubDefaults) GetN() int64 { |
| 1229 | if this != nil && this.N != nil { |
| 1230 | return *this.N |
| 1231 | } |
| 1232 | return Default_SubDefaults_N |
| 1233 | } |
| 1234 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1235 | type RepeatedEnum struct { |
| 1236 | Color []RepeatedEnum_Color `protobuf:"varint,1,rep,name=color,enum=testdata.RepeatedEnum_Color" json:"color,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1237 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1238 | } |
| 1239 | |
| 1240 | func (this *RepeatedEnum) Reset() { *this = RepeatedEnum{} } |
| 1241 | func (this *RepeatedEnum) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1242 | func (*RepeatedEnum) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1243 | |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1244 | var E_Greeting = &proto.ExtensionDesc{ |
| 1245 | ExtendedType: (*MyMessage)(nil), |
| 1246 | ExtensionType: ([]string)(nil), |
| 1247 | Field: 106, |
| 1248 | Name: "testdata.greeting", |
| 1249 | Tag: "bytes,106,rep,name=greeting", |
| 1250 | } |
| 1251 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1252 | func init() { |
| 1253 | proto.RegisterEnum("testdata.FOO", FOO_name, FOO_value) |
| 1254 | proto.RegisterEnum("testdata.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value) |
| 1255 | proto.RegisterEnum("testdata.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value) |
| 1256 | proto.RegisterEnum("testdata.Defaults_Color", Defaults_Color_name, Defaults_Color_value) |
| 1257 | proto.RegisterEnum("testdata.RepeatedEnum_Color", RepeatedEnum_Color_name, RepeatedEnum_Color_value) |
| 1258 | proto.RegisterExtension(E_Ext_More) |
| 1259 | proto.RegisterExtension(E_Ext_Text) |
| 1260 | proto.RegisterExtension(E_Ext_Number) |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1261 | proto.RegisterExtension(E_Greeting) |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1262 | } |