test.pb.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. // Code generated by protoc-gen-go from "test.proto"
  2. // DO NOT EDIT!
  3. package test_proto
  4. import proto "goprotobuf.googlecode.com/hg/proto"
  5. import "math"
  6. import "os"
  7. // Reference proto, math & os imports to suppress error if they are not otherwise used.
  8. var _ = proto.GetString
  9. var _ = math.Inf
  10. var _ os.Error
  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. func (x FOO) String() string {
  26. return proto.EnumName(FOO_name, int32(x))
  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. func (x GoTest_KIND) String() string {
  79. return proto.EnumName(GoTest_KIND_name, int32(x))
  80. }
  81. type MyMessage_Color int32
  82. const (
  83. MyMessage_RED = 0
  84. MyMessage_GREEN = 1
  85. MyMessage_BLUE = 2
  86. )
  87. var MyMessage_Color_name = map[int32]string{
  88. 0: "RED",
  89. 1: "GREEN",
  90. 2: "BLUE",
  91. }
  92. var MyMessage_Color_value = map[string]int32{
  93. "RED": 0,
  94. "GREEN": 1,
  95. "BLUE": 2,
  96. }
  97. func NewMyMessage_Color(x int32) *MyMessage_Color {
  98. e := MyMessage_Color(x)
  99. return &e
  100. }
  101. func (x MyMessage_Color) String() string {
  102. return proto.EnumName(MyMessage_Color_name, int32(x))
  103. }
  104. type GoEnum struct {
  105. Foo *FOO "PB(varint,1,req,name=foo,enum=test_proto.FOO)"
  106. XXX_unrecognized []byte
  107. }
  108. func (this *GoEnum) Reset() { *this = GoEnum{} }
  109. func (this *GoEnum) String() string { return proto.CompactTextString(this) }
  110. type GoTestField struct {
  111. Label *string "PB(bytes,1,req)"
  112. Type *string "PB(bytes,2,req)"
  113. XXX_unrecognized []byte
  114. }
  115. func (this *GoTestField) Reset() { *this = GoTestField{} }
  116. func (this *GoTestField) String() string { return proto.CompactTextString(this) }
  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)"
  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)"
  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() { *this = GoTest{} }
  193. func (this *GoTest) String() string { return proto.CompactTextString(this) }
  194. const Default_GoTest_F_BoolDefaulted bool = true
  195. const Default_GoTest_F_Int32Defaulted int32 = 32
  196. const Default_GoTest_F_Int64Defaulted int64 = 64
  197. const Default_GoTest_F_Fixed32Defaulted uint32 = 320
  198. const Default_GoTest_F_Fixed64Defaulted uint64 = 640
  199. const Default_GoTest_F_Uint32Defaulted uint32 = 3200
  200. const Default_GoTest_F_Uint64Defaulted uint64 = 6400
  201. const Default_GoTest_F_FloatDefaulted float32 = 314159
  202. const Default_GoTest_F_DoubleDefaulted float64 = 271828
  203. const Default_GoTest_F_StringDefaulted string = "hello, \"world!\"\n"
  204. var Default_GoTest_F_BytesDefaulted []byte = []byte("Bignose")
  205. const Default_GoTest_F_Sint32Defaulted int32 = -32
  206. const Default_GoTest_F_Sint64Defaulted int64 = -64
  207. type GoTest_RequiredGroup struct {
  208. RequiredField *string "PB(bytes,71,req)"
  209. XXX_unrecognized []byte
  210. }
  211. func (this *GoTest_RequiredGroup) Reset() { *this = GoTest_RequiredGroup{} }
  212. func (this *GoTest_RequiredGroup) String() string { return proto.CompactTextString(this) }
  213. type GoTest_RepeatedGroup struct {
  214. RequiredField *string "PB(bytes,81,req)"
  215. XXX_unrecognized []byte
  216. }
  217. func (this *GoTest_RepeatedGroup) Reset() { *this = GoTest_RepeatedGroup{} }
  218. func (this *GoTest_RepeatedGroup) String() string { return proto.CompactTextString(this) }
  219. type GoTest_OptionalGroup struct {
  220. RequiredField *string "PB(bytes,91,req)"
  221. XXX_unrecognized []byte
  222. }
  223. func (this *GoTest_OptionalGroup) Reset() { *this = GoTest_OptionalGroup{} }
  224. func (this *GoTest_OptionalGroup) String() string { return proto.CompactTextString(this) }
  225. type GoSkipTest struct {
  226. SkipInt32 *int32 "PB(varint,11,req,name=skip_int32)"
  227. SkipFixed32 *uint32 "PB(fixed32,12,req,name=skip_fixed32)"
  228. SkipFixed64 *uint64 "PB(fixed64,13,req,name=skip_fixed64)"
  229. SkipString *string "PB(bytes,14,req,name=skip_string)"
  230. Skipgroup *GoSkipTest_SkipGroup "PB(group,15,req,name=SkipGroup)"
  231. XXX_unrecognized []byte
  232. }
  233. func (this *GoSkipTest) Reset() { *this = GoSkipTest{} }
  234. func (this *GoSkipTest) String() string { return proto.CompactTextString(this) }
  235. type GoSkipTest_SkipGroup struct {
  236. GroupInt32 *int32 "PB(varint,16,req,name=group_int32)"
  237. GroupString *string "PB(bytes,17,req,name=group_string)"
  238. XXX_unrecognized []byte
  239. }
  240. func (this *GoSkipTest_SkipGroup) Reset() { *this = GoSkipTest_SkipGroup{} }
  241. func (this *GoSkipTest_SkipGroup) String() string { return proto.CompactTextString(this) }
  242. type NonPackedTest struct {
  243. A []int32 "PB(varint,1,rep,name=a)"
  244. XXX_unrecognized []byte
  245. }
  246. func (this *NonPackedTest) Reset() { *this = NonPackedTest{} }
  247. func (this *NonPackedTest) String() string { return proto.CompactTextString(this) }
  248. type PackedTest struct {
  249. B []int32 "PB(varint,1,rep,packed,name=b)"
  250. XXX_unrecognized []byte
  251. }
  252. func (this *PackedTest) Reset() { *this = PackedTest{} }
  253. func (this *PackedTest) String() string { return proto.CompactTextString(this) }
  254. type InnerMessage struct {
  255. Host *string "PB(bytes,1,req,name=host)"
  256. Port *int32 "PB(varint,2,opt,name=port,def=4000)"
  257. Connected *bool "PB(varint,3,opt,name=connected)"
  258. XXX_unrecognized []byte
  259. }
  260. func (this *InnerMessage) Reset() { *this = InnerMessage{} }
  261. func (this *InnerMessage) String() string { return proto.CompactTextString(this) }
  262. const Default_InnerMessage_Port int32 = 4000
  263. type OtherMessage struct {
  264. Key *int64 "PB(varint,1,opt,name=key)"
  265. Value []byte "PB(bytes,2,opt,name=value)"
  266. Weight *float32 "PB(fixed32,3,opt,name=weight)"
  267. Inner *InnerMessage "PB(bytes,4,opt,name=inner)"
  268. XXX_unrecognized []byte
  269. }
  270. func (this *OtherMessage) Reset() { *this = OtherMessage{} }
  271. func (this *OtherMessage) String() string { return proto.CompactTextString(this) }
  272. type MyMessage struct {
  273. Count *int32 "PB(varint,1,req,name=count)"
  274. Name *string "PB(bytes,2,opt,name=name)"
  275. Quote *string "PB(bytes,3,opt,name=quote)"
  276. Pet []string "PB(bytes,4,rep,name=pet)"
  277. Inner *InnerMessage "PB(bytes,5,opt,name=inner)"
  278. Others []*OtherMessage "PB(bytes,6,rep,name=others)"
  279. Bikeshed *MyMessage_Color "PB(varint,7,opt,name=bikeshed,enum=test_proto.MyMessage_Color)"
  280. Somegroup *MyMessage_SomeGroup "PB(group,8,opt,name=SomeGroup)"
  281. XXX_extensions map[int32][]byte
  282. XXX_unrecognized []byte
  283. }
  284. func (this *MyMessage) Reset() { *this = MyMessage{} }
  285. func (this *MyMessage) String() string { return proto.CompactTextString(this) }
  286. var extRange_MyMessage = []proto.ExtensionRange{
  287. proto.ExtensionRange{100, 536870911},
  288. }
  289. func (*MyMessage) ExtensionRangeArray() []proto.ExtensionRange {
  290. return extRange_MyMessage
  291. }
  292. func (this *MyMessage) ExtensionMap() map[int32][]byte {
  293. if this.XXX_extensions == nil {
  294. this.XXX_extensions = make(map[int32][]byte)
  295. }
  296. return this.XXX_extensions
  297. }
  298. type MyMessage_SomeGroup struct {
  299. GroupField *int32 "PB(varint,9,opt,name=group_field)"
  300. XXX_unrecognized []byte
  301. }
  302. func (this *MyMessage_SomeGroup) Reset() { *this = MyMessage_SomeGroup{} }
  303. func (this *MyMessage_SomeGroup) String() string { return proto.CompactTextString(this) }
  304. type Ext struct {
  305. Data *string "PB(bytes,1,opt,name=data)"
  306. XXX_unrecognized []byte
  307. }
  308. func (this *Ext) Reset() { *this = Ext{} }
  309. func (this *Ext) String() string { return proto.CompactTextString(this) }
  310. var E_Ext_More = &proto.ExtensionDesc{
  311. ExtendedType: (*MyMessage)(nil),
  312. ExtensionType: (*Ext)(nil),
  313. Field: 103,
  314. Name: "test_proto.more",
  315. Tag: "PB(bytes,103,opt,name=more)",
  316. }
  317. type MessageList struct {
  318. Message []*MessageList_Message "PB(group,1,rep)"
  319. XXX_unrecognized []byte
  320. }
  321. func (this *MessageList) Reset() { *this = MessageList{} }
  322. func (this *MessageList) String() string { return proto.CompactTextString(this) }
  323. type MessageList_Message struct {
  324. Name *string "PB(bytes,2,req,name=name)"
  325. Count *int32 "PB(varint,3,req,name=count)"
  326. XXX_unrecognized []byte
  327. }
  328. func (this *MessageList_Message) Reset() { *this = MessageList_Message{} }
  329. func (this *MessageList_Message) String() string { return proto.CompactTextString(this) }
  330. func init() {
  331. proto.RegisterEnum("test_proto.FOO", FOO_name, FOO_value)
  332. proto.RegisterEnum("test_proto.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value)
  333. proto.RegisterEnum("test_proto.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value)
  334. proto.RegisterExtension(E_Ext_More)
  335. }