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