test.pb.go.golden 11 KB

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