test.pb.go 11 KB

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