test.pb.go 10 KB

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