| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 1 | // Code generated by protoc-gen-go from "test.proto" |
| 2 | // DO NOT EDIT! |
| 3 | |
| 4 | package test_proto |
| 5 | |
| Rob Pike | ab5b802 | 2010-06-21 17:47:58 -0700 | [diff] [blame] | 6 | import proto "goprotobuf.googlecode.com/hg/proto" |
| David Symonds | 4fee3b1 | 2010-11-11 10:00:13 +1100 | [diff] [blame] | 7 | import "os" |
| Rob Pike | ab5b802 | 2010-06-21 17:47:58 -0700 | [diff] [blame] | 8 | |
| David Symonds | 4fee3b1 | 2010-11-11 10:00:13 +1100 | [diff] [blame] | 9 | // Reference proto & os imports to suppress error if it's not otherwise used. |
| Rob Pike | ab5b802 | 2010-06-21 17:47:58 -0700 | [diff] [blame] | 10 | var _ = proto.GetString |
| David Symonds | 4fee3b1 | 2010-11-11 10:00:13 +1100 | [diff] [blame] | 11 | var _ os.Error |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 12 | |
| 13 | type FOO int32 |
| 14 | const ( |
| 15 | FOO_FOO1 = 1 |
| 16 | ) |
| 17 | var FOO_name = map[int32] string { |
| 18 | 1: "FOO1", |
| 19 | } |
| 20 | var FOO_value = map[string] int32 { |
| 21 | "FOO1": 1, |
| 22 | } |
| 23 | func NewFOO(x int32) *FOO { |
| 24 | e := FOO(x) |
| 25 | return &e |
| 26 | } |
| 27 | |
| 28 | type GoTest_KIND int32 |
| 29 | const ( |
| 30 | GoTest_VOID = 0 |
| 31 | GoTest_BOOL = 1 |
| 32 | GoTest_BYTES = 2 |
| 33 | GoTest_FINGERPRINT = 3 |
| 34 | GoTest_FLOAT = 4 |
| 35 | GoTest_INT = 5 |
| 36 | GoTest_STRING = 6 |
| 37 | GoTest_TIME = 7 |
| 38 | GoTest_TUPLE = 8 |
| 39 | GoTest_ARRAY = 9 |
| 40 | GoTest_MAP = 10 |
| 41 | GoTest_TABLE = 11 |
| 42 | GoTest_FUNCTION = 12 |
| 43 | ) |
| 44 | var GoTest_KIND_name = map[int32] string { |
| 45 | 0: "VOID", |
| 46 | 1: "BOOL", |
| 47 | 2: "BYTES", |
| 48 | 3: "FINGERPRINT", |
| 49 | 4: "FLOAT", |
| 50 | 5: "INT", |
| 51 | 6: "STRING", |
| 52 | 7: "TIME", |
| 53 | 8: "TUPLE", |
| 54 | 9: "ARRAY", |
| 55 | 10: "MAP", |
| 56 | 11: "TABLE", |
| 57 | 12: "FUNCTION", |
| 58 | } |
| 59 | var GoTest_KIND_value = map[string] int32 { |
| 60 | "VOID": 0, |
| 61 | "BOOL": 1, |
| 62 | "BYTES": 2, |
| 63 | "FINGERPRINT": 3, |
| 64 | "FLOAT": 4, |
| 65 | "INT": 5, |
| 66 | "STRING": 6, |
| 67 | "TIME": 7, |
| 68 | "TUPLE": 8, |
| 69 | "ARRAY": 9, |
| 70 | "MAP": 10, |
| 71 | "TABLE": 11, |
| 72 | "FUNCTION": 12, |
| 73 | } |
| 74 | func NewGoTest_KIND(x int32) *GoTest_KIND { |
| 75 | e := GoTest_KIND(x) |
| 76 | return &e |
| 77 | } |
| 78 | |
| 79 | type MyMessage_Color int32 |
| 80 | const ( |
| 81 | MyMessage_RED = 0 |
| 82 | MyMessage_GREEN = 1 |
| 83 | MyMessage_BLUE = 2 |
| 84 | ) |
| 85 | var MyMessage_Color_name = map[int32] string { |
| 86 | 0: "RED", |
| 87 | 1: "GREEN", |
| 88 | 2: "BLUE", |
| 89 | } |
| 90 | var MyMessage_Color_value = map[string] int32 { |
| 91 | "RED": 0, |
| 92 | "GREEN": 1, |
| 93 | "BLUE": 2, |
| 94 | } |
| 95 | func NewMyMessage_Color(x int32) *MyMessage_Color { |
| 96 | e := MyMessage_Color(x) |
| 97 | return &e |
| 98 | } |
| 99 | |
| 100 | type GoEnum struct { |
| 101 | Foo *FOO "PB(varint,1,req,name=foo,enum=test_proto.FOO)" |
| 102 | XXX_unrecognized []byte |
| 103 | } |
| 104 | func (this *GoEnum) Reset() { |
| 105 | *this = GoEnum{} |
| 106 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 107 | |
| 108 | type GoTestField struct { |
| 109 | Label *string "PB(bytes,1,req)" |
| 110 | Type *string "PB(bytes,2,req)" |
| 111 | XXX_unrecognized []byte |
| 112 | } |
| 113 | func (this *GoTestField) Reset() { |
| 114 | *this = GoTestField{} |
| 115 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 116 | |
| 117 | type GoTest struct { |
| 118 | Kind *int32 "PB(varint,1,req)" |
| 119 | Table *string "PB(bytes,2,opt)" |
| 120 | Param *int32 "PB(varint,3,opt)" |
| 121 | RequiredField *GoTestField "PB(bytes,4,req)" |
| 122 | RepeatedField []*GoTestField "PB(bytes,5,rep)" |
| 123 | OptionalField *GoTestField "PB(bytes,6,opt)" |
| 124 | F_BoolRequired *bool "PB(varint,10,req,name=F_Bool_required)" |
| 125 | F_Int32Required *int32 "PB(varint,11,req,name=F_Int32_required)" |
| 126 | F_Int64Required *int64 "PB(varint,12,req,name=F_Int64_required)" |
| 127 | F_Fixed32Required *uint32 "PB(fixed32,13,req,name=F_Fixed32_required)" |
| 128 | F_Fixed64Required *uint64 "PB(fixed64,14,req,name=F_Fixed64_required)" |
| 129 | F_Uint32Required *uint32 "PB(varint,15,req,name=F_Uint32_required)" |
| 130 | F_Uint64Required *uint64 "PB(varint,16,req,name=F_Uint64_required)" |
| 131 | F_FloatRequired *float32 "PB(fixed32,17,req,name=F_Float_required)" |
| 132 | F_DoubleRequired *float64 "PB(fixed64,18,req,name=F_Double_required)" |
| 133 | F_StringRequired *string "PB(bytes,19,req,name=F_String_required)" |
| 134 | F_BytesRequired []byte "PB(bytes,101,req,name=F_Bytes_required)" |
| 135 | F_Sint32Required *int32 "PB(zigzag32,102,req,name=F_Sint32_required)" |
| 136 | F_Sint64Required *int64 "PB(zigzag64,103,req,name=F_Sint64_required)" |
| 137 | F_BoolRepeated []bool "PB(varint,20,rep,name=F_Bool_repeated)" |
| 138 | F_Int32Repeated []int32 "PB(varint,21,rep,name=F_Int32_repeated)" |
| 139 | F_Int64Repeated []int64 "PB(varint,22,rep,name=F_Int64_repeated)" |
| 140 | F_Fixed32Repeated []uint32 "PB(fixed32,23,rep,name=F_Fixed32_repeated)" |
| 141 | F_Fixed64Repeated []uint64 "PB(fixed64,24,rep,name=F_Fixed64_repeated)" |
| 142 | F_Uint32Repeated []uint32 "PB(varint,25,rep,name=F_Uint32_repeated)" |
| 143 | F_Uint64Repeated []uint64 "PB(varint,26,rep,name=F_Uint64_repeated)" |
| 144 | F_FloatRepeated []float32 "PB(fixed32,27,rep,name=F_Float_repeated)" |
| 145 | F_DoubleRepeated []float64 "PB(fixed64,28,rep,name=F_Double_repeated)" |
| 146 | F_StringRepeated []string "PB(bytes,29,rep,name=F_String_repeated)" |
| 147 | F_BytesRepeated [][]byte "PB(bytes,201,rep,name=F_Bytes_repeated)" |
| 148 | F_Sint32Repeated []int32 "PB(zigzag32,202,rep,name=F_Sint32_repeated)" |
| 149 | F_Sint64Repeated []int64 "PB(zigzag64,203,rep,name=F_Sint64_repeated)" |
| 150 | F_BoolOptional *bool "PB(varint,30,opt,name=F_Bool_optional)" |
| 151 | F_Int32Optional *int32 "PB(varint,31,opt,name=F_Int32_optional)" |
| 152 | F_Int64Optional *int64 "PB(varint,32,opt,name=F_Int64_optional)" |
| 153 | F_Fixed32Optional *uint32 "PB(fixed32,33,opt,name=F_Fixed32_optional)" |
| 154 | F_Fixed64Optional *uint64 "PB(fixed64,34,opt,name=F_Fixed64_optional)" |
| 155 | F_Uint32Optional *uint32 "PB(varint,35,opt,name=F_Uint32_optional)" |
| 156 | F_Uint64Optional *uint64 "PB(varint,36,opt,name=F_Uint64_optional)" |
| 157 | F_FloatOptional *float32 "PB(fixed32,37,opt,name=F_Float_optional)" |
| 158 | F_DoubleOptional *float64 "PB(fixed64,38,opt,name=F_Double_optional)" |
| 159 | F_StringOptional *string "PB(bytes,39,opt,name=F_String_optional)" |
| 160 | F_BytesOptional []byte "PB(bytes,301,opt,name=F_Bytes_optional)" |
| 161 | F_Sint32Optional *int32 "PB(zigzag32,302,opt,name=F_Sint32_optional)" |
| 162 | F_Sint64Optional *int64 "PB(zigzag64,303,opt,name=F_Sint64_optional)" |
| 163 | F_BoolDefaulted *bool "PB(varint,40,opt,name=F_Bool_defaulted,def=1)" |
| 164 | F_Int32Defaulted *int32 "PB(varint,41,opt,name=F_Int32_defaulted,def=32)" |
| 165 | F_Int64Defaulted *int64 "PB(varint,42,opt,name=F_Int64_defaulted,def=64)" |
| 166 | F_Fixed32Defaulted *uint32 "PB(fixed32,43,opt,name=F_Fixed32_defaulted,def=320)" |
| 167 | F_Fixed64Defaulted *uint64 "PB(fixed64,44,opt,name=F_Fixed64_defaulted,def=640)" |
| 168 | F_Uint32Defaulted *uint32 "PB(varint,45,opt,name=F_Uint32_defaulted,def=3200)" |
| 169 | F_Uint64Defaulted *uint64 "PB(varint,46,opt,name=F_Uint64_defaulted,def=6400)" |
| 170 | F_FloatDefaulted *float32 "PB(fixed32,47,opt,name=F_Float_defaulted,def=314159)" |
| 171 | F_DoubleDefaulted *float64 "PB(fixed64,48,opt,name=F_Double_defaulted,def=271828)" |
| 172 | F_StringDefaulted *string "PB(bytes,49,opt,name=F_String_defaulted,def=hello, \\\"world!\\\"\\n)" |
| 173 | F_BytesDefaulted []byte "PB(bytes,401,opt,name=F_Bytes_defaulted,def=Bignose)" |
| 174 | F_Sint32Defaulted *int32 "PB(zigzag32,402,opt,name=F_Sint32_defaulted,def=-32)" |
| 175 | F_Sint64Defaulted *int64 "PB(zigzag64,403,opt,name=F_Sint64_defaulted,def=-64)" |
| David Symonds | 5b7775e | 2010-12-01 10:09:04 +1100 | [diff] [blame] | 176 | F_BoolRepeatedPacked []bool "PB(varint,50,rep,packed,name=F_Bool_repeated_packed)" |
| 177 | F_Int32RepeatedPacked []int32 "PB(varint,51,rep,packed,name=F_Int32_repeated_packed)" |
| 178 | F_Int64RepeatedPacked []int64 "PB(varint,52,rep,packed,name=F_Int64_repeated_packed)" |
| 179 | F_Fixed32RepeatedPacked []uint32 "PB(fixed32,53,rep,packed,name=F_Fixed32_repeated_packed)" |
| 180 | F_Fixed64RepeatedPacked []uint64 "PB(fixed64,54,rep,packed,name=F_Fixed64_repeated_packed)" |
| 181 | F_Uint32RepeatedPacked []uint32 "PB(varint,55,rep,packed,name=F_Uint32_repeated_packed)" |
| 182 | F_Uint64RepeatedPacked []uint64 "PB(varint,56,rep,packed,name=F_Uint64_repeated_packed)" |
| 183 | F_FloatRepeatedPacked []float32 "PB(fixed32,57,rep,packed,name=F_Float_repeated_packed)" |
| 184 | F_DoubleRepeatedPacked []float64 "PB(fixed64,58,rep,packed,name=F_Double_repeated_packed)" |
| 185 | F_Sint32RepeatedPacked []int32 "PB(zigzag32,502,rep,packed,name=F_Sint32_repeated_packed)" |
| 186 | F_Sint64RepeatedPacked []int64 "PB(zigzag64,503,rep,packed,name=F_Sint64_repeated_packed)" |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 187 | Requiredgroup *GoTest_RequiredGroup "PB(group,70,req,name=requiredgroup)" |
| 188 | Repeatedgroup []*GoTest_RepeatedGroup "PB(group,80,rep,name=repeatedgroup)" |
| 189 | Optionalgroup *GoTest_OptionalGroup "PB(group,90,opt,name=optionalgroup)" |
| 190 | XXX_unrecognized []byte |
| 191 | } |
| 192 | func (this *GoTest) Reset() { |
| 193 | *this = GoTest{} |
| 194 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 195 | const Default_GoTest_F_BoolDefaulted bool = true |
| 196 | const Default_GoTest_F_Int32Defaulted int32 = 32 |
| 197 | const Default_GoTest_F_Int64Defaulted int64 = 64 |
| 198 | const Default_GoTest_F_Fixed32Defaulted uint32 = 320 |
| 199 | const Default_GoTest_F_Fixed64Defaulted uint64 = 640 |
| 200 | const Default_GoTest_F_Uint32Defaulted uint32 = 3200 |
| 201 | const Default_GoTest_F_Uint64Defaulted uint64 = 6400 |
| 202 | const Default_GoTest_F_FloatDefaulted float32 = 314159 |
| 203 | const Default_GoTest_F_DoubleDefaulted float64 = 271828 |
| 204 | const Default_GoTest_F_StringDefaulted string = "hello, \"world!\"\n" |
| 205 | var Default_GoTest_F_BytesDefaulted []byte = []byte("Bignose") |
| 206 | const Default_GoTest_F_Sint32Defaulted int32 = -32 |
| 207 | const Default_GoTest_F_Sint64Defaulted int64 = -64 |
| 208 | |
| 209 | type GoTest_RequiredGroup struct { |
| 210 | RequiredField *string "PB(bytes,71,req)" |
| 211 | XXX_unrecognized []byte |
| 212 | } |
| 213 | func (this *GoTest_RequiredGroup) Reset() { |
| 214 | *this = GoTest_RequiredGroup{} |
| 215 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 216 | |
| 217 | type GoTest_RepeatedGroup struct { |
| 218 | RequiredField *string "PB(bytes,81,req)" |
| 219 | XXX_unrecognized []byte |
| 220 | } |
| 221 | func (this *GoTest_RepeatedGroup) Reset() { |
| 222 | *this = GoTest_RepeatedGroup{} |
| 223 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 224 | |
| 225 | type GoTest_OptionalGroup struct { |
| 226 | RequiredField *string "PB(bytes,91,req)" |
| 227 | XXX_unrecognized []byte |
| 228 | } |
| 229 | func (this *GoTest_OptionalGroup) Reset() { |
| 230 | *this = GoTest_OptionalGroup{} |
| 231 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 232 | |
| 233 | type GoSkipTest struct { |
| 234 | SkipInt32 *int32 "PB(varint,11,req,name=skip_int32)" |
| 235 | SkipFixed32 *uint32 "PB(fixed32,12,req,name=skip_fixed32)" |
| 236 | SkipFixed64 *uint64 "PB(fixed64,13,req,name=skip_fixed64)" |
| 237 | SkipString *string "PB(bytes,14,req,name=skip_string)" |
| 238 | Skipgroup *GoSkipTest_SkipGroup "PB(group,15,req,name=skipgroup)" |
| 239 | XXX_unrecognized []byte |
| 240 | } |
| 241 | func (this *GoSkipTest) Reset() { |
| 242 | *this = GoSkipTest{} |
| 243 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 244 | |
| 245 | type GoSkipTest_SkipGroup struct { |
| 246 | GroupInt32 *int32 "PB(varint,16,req,name=group_int32)" |
| 247 | GroupString *string "PB(bytes,17,req,name=group_string)" |
| 248 | XXX_unrecognized []byte |
| 249 | } |
| 250 | func (this *GoSkipTest_SkipGroup) Reset() { |
| 251 | *this = GoSkipTest_SkipGroup{} |
| 252 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 253 | |
| David Symonds | 5b7775e | 2010-12-01 10:09:04 +1100 | [diff] [blame] | 254 | type NonPackedTest struct { |
| 255 | A []int32 "PB(varint,1,rep,name=a)" |
| 256 | XXX_unrecognized []byte |
| 257 | } |
| 258 | func (this *NonPackedTest) Reset() { |
| 259 | *this = NonPackedTest{} |
| 260 | } |
| 261 | |
| 262 | type PackedTest struct { |
| 263 | B []int32 "PB(varint,1,rep,packed,name=b)" |
| 264 | XXX_unrecognized []byte |
| 265 | } |
| 266 | func (this *PackedTest) Reset() { |
| 267 | *this = PackedTest{} |
| 268 | } |
| 269 | |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 270 | type InnerMessage struct { |
| 271 | Host *string "PB(bytes,1,req,name=host)" |
| 272 | Port *int32 "PB(varint,2,opt,name=port,def=4000)" |
| 273 | Connected *bool "PB(varint,3,opt,name=connected)" |
| 274 | XXX_unrecognized []byte |
| 275 | } |
| 276 | func (this *InnerMessage) Reset() { |
| 277 | *this = InnerMessage{} |
| 278 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 279 | const Default_InnerMessage_Port int32 = 4000 |
| 280 | |
| 281 | type OtherMessage struct { |
| 282 | Key *int64 "PB(varint,1,opt,name=key)" |
| 283 | Value []byte "PB(bytes,2,opt,name=value)" |
| 284 | Weight *float32 "PB(fixed32,3,opt,name=weight)" |
| 285 | Inner *InnerMessage "PB(bytes,4,opt,name=inner)" |
| 286 | XXX_unrecognized []byte |
| 287 | } |
| 288 | func (this *OtherMessage) Reset() { |
| 289 | *this = OtherMessage{} |
| 290 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 291 | |
| 292 | type MyMessage struct { |
| 293 | Count *int32 "PB(varint,1,req,name=count)" |
| 294 | Name *string "PB(bytes,2,opt,name=name)" |
| 295 | Quote *string "PB(bytes,3,opt,name=quote)" |
| 296 | Pet []string "PB(bytes,4,rep,name=pet)" |
| 297 | Inner *InnerMessage "PB(bytes,5,opt,name=inner)" |
| 298 | Others []*OtherMessage "PB(bytes,6,rep,name=others)" |
| 299 | Bikeshed *MyMessage_Color "PB(varint,7,opt,name=bikeshed,enum=test_proto.MyMessage_Color)" |
| 300 | XXX_unrecognized []byte |
| 301 | } |
| 302 | func (this *MyMessage) Reset() { |
| 303 | *this = MyMessage{} |
| 304 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 305 | |
| 306 | type MessageList struct { |
| 307 | Message []*MessageList_Message "PB(group,1,rep,name=message)" |
| 308 | XXX_unrecognized []byte |
| 309 | } |
| 310 | func (this *MessageList) Reset() { |
| 311 | *this = MessageList{} |
| 312 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 313 | |
| 314 | type MessageList_Message struct { |
| 315 | Name *string "PB(bytes,2,req,name=name)" |
| 316 | Count *int32 "PB(varint,3,req,name=count)" |
| 317 | XXX_unrecognized []byte |
| 318 | } |
| 319 | func (this *MessageList_Message) Reset() { |
| 320 | *this = MessageList_Message{} |
| 321 | } |
| Rob Pike | aaa3a62 | 2010-03-20 22:32:34 -0700 | [diff] [blame] | 322 | |
| 323 | func init() { |
| 324 | proto.RegisterEnum("test_proto.FOO", FOO_name, FOO_value) |
| 325 | proto.RegisterEnum("test_proto.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value) |
| 326 | proto.RegisterEnum("test_proto.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value) |
| 327 | } |