/protoc-gen-go/testdata/my_test/test.pb.go

https://code.google.com/p/goprotobuf/ · Go · 241 lines · 191 code · 44 blank · 6 comment · 4 complexity · c18a9a44d004b4cc43918a6608d3c478 MD5 · raw file

  1. // Code generated by protoc-gen-go from "my_test/test.proto"
  2. // DO NOT EDIT!
  3. package my_test
  4. import proto "code.google.com/p/goprotobuf/proto"
  5. import "math"
  6. // discarding unused import multi2 "multi/multi1.pb"
  7. // Reference proto and math imports to suppress error if they are not otherwise used.
  8. var _ = proto.GetString
  9. var _ = math.Inf
  10. type HatType int32
  11. const (
  12. HatType_FEDORA HatType = 1
  13. HatType_FEZ HatType = 2
  14. )
  15. var HatType_name = map[int32]string{
  16. 1: "FEDORA",
  17. 2: "FEZ",
  18. }
  19. var HatType_value = map[string]int32{
  20. "FEDORA": 1,
  21. "FEZ": 2,
  22. }
  23. func NewHatType(x HatType) *HatType {
  24. e := HatType(x)
  25. return &e
  26. }
  27. func (x HatType) String() string {
  28. return proto.EnumName(HatType_name, int32(x))
  29. }
  30. type Days int32
  31. const (
  32. Days_MONDAY Days = 1
  33. Days_TUESDAY Days = 2
  34. Days_LUNDI Days = 1
  35. )
  36. var Days_name = map[int32]string{
  37. 1: "MONDAY",
  38. 2: "TUESDAY",
  39. // Duplicate value: 1: "LUNDI",
  40. }
  41. var Days_value = map[string]int32{
  42. "MONDAY": 1,
  43. "TUESDAY": 2,
  44. "LUNDI": 1,
  45. }
  46. func NewDays(x Days) *Days {
  47. e := Days(x)
  48. return &e
  49. }
  50. func (x Days) String() string {
  51. return proto.EnumName(Days_name, int32(x))
  52. }
  53. type Request_Color int32
  54. const (
  55. Request_RED Request_Color = 0
  56. Request_GREEN Request_Color = 1
  57. Request_BLUE Request_Color = 2
  58. )
  59. var Request_Color_name = map[int32]string{
  60. 0: "RED",
  61. 1: "GREEN",
  62. 2: "BLUE",
  63. }
  64. var Request_Color_value = map[string]int32{
  65. "RED": 0,
  66. "GREEN": 1,
  67. "BLUE": 2,
  68. }
  69. func NewRequest_Color(x Request_Color) *Request_Color {
  70. e := Request_Color(x)
  71. return &e
  72. }
  73. func (x Request_Color) String() string {
  74. return proto.EnumName(Request_Color_name, int32(x))
  75. }
  76. type Reply_Entry_Game int32
  77. const (
  78. Reply_Entry_FOOTBALL Reply_Entry_Game = 1
  79. Reply_Entry_TENNIS Reply_Entry_Game = 2
  80. )
  81. var Reply_Entry_Game_name = map[int32]string{
  82. 1: "FOOTBALL",
  83. 2: "TENNIS",
  84. }
  85. var Reply_Entry_Game_value = map[string]int32{
  86. "FOOTBALL": 1,
  87. "TENNIS": 2,
  88. }
  89. func NewReply_Entry_Game(x Reply_Entry_Game) *Reply_Entry_Game {
  90. e := Reply_Entry_Game(x)
  91. return &e
  92. }
  93. func (x Reply_Entry_Game) String() string {
  94. return proto.EnumName(Reply_Entry_Game_name, int32(x))
  95. }
  96. type Request struct {
  97. Key []int64 `protobuf:"varint,1,rep,name=key" json:"key,omitempty"`
  98. Hue *Request_Color `protobuf:"varint,3,opt,name=hue,enum=my.test.Request_Color" json:"hue,omitempty"`
  99. Hat *HatType `protobuf:"varint,4,opt,name=hat,enum=my.test.HatType,def=1" json:"hat,omitempty"`
  100. Deadline *float32 `protobuf:"fixed32,7,opt,name=deadline,def=inf" json:"deadline,omitempty"`
  101. Somegroup *Request_SomeGroup `protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"`
  102. Reset_ *int32 `protobuf:"varint,12,opt,name=reset" json:"reset,omitempty"`
  103. XXX_unrecognized []byte `json:"-"`
  104. }
  105. func (this *Request) Reset() { *this = Request{} }
  106. func (this *Request) String() string { return proto.CompactTextString(this) }
  107. const Default_Request_Hat HatType = HatType_FEDORA
  108. var Default_Request_Deadline float32 = float32(math.Inf(1))
  109. type Request_SomeGroup struct {
  110. GroupField *int32 `protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"`
  111. XXX_unrecognized []byte `json:"-"`
  112. }
  113. func (this *Request_SomeGroup) Reset() { *this = Request_SomeGroup{} }
  114. func (this *Request_SomeGroup) String() string { return proto.CompactTextString(this) }
  115. type Reply struct {
  116. Found []*Reply_Entry `protobuf:"bytes,1,rep,name=found" json:"found,omitempty"`
  117. CompactKeys []int32 `protobuf:"varint,2,rep,packed,name=compact_keys" json:"compact_keys,omitempty"`
  118. XXX_extensions map[int32]proto.Extension `json:"-"`
  119. XXX_unrecognized []byte `json:"-"`
  120. }
  121. func (this *Reply) Reset() { *this = Reply{} }
  122. func (this *Reply) String() string { return proto.CompactTextString(this) }
  123. var extRange_Reply = []proto.ExtensionRange{
  124. {100, 536870911},
  125. }
  126. func (*Reply) ExtensionRangeArray() []proto.ExtensionRange {
  127. return extRange_Reply
  128. }
  129. func (this *Reply) ExtensionMap() map[int32]proto.Extension {
  130. if this.XXX_extensions == nil {
  131. this.XXX_extensions = make(map[int32]proto.Extension)
  132. }
  133. return this.XXX_extensions
  134. }
  135. type Reply_Entry struct {
  136. KeyThatNeeds_1234Camel_CasIng *int64 `protobuf:"varint,1,req,name=key_that_needs_1234camel_CasIng" json:"key_that_needs_1234camel_CasIng,omitempty"`
  137. Value *int64 `protobuf:"varint,2,opt,name=value,def=7" json:"value,omitempty"`
  138. XMyFieldName_2 *int64 `protobuf:"varint,3,opt,name=_my_field_name_2" json:"_my_field_name_2,omitempty"`
  139. XXX_unrecognized []byte `json:"-"`
  140. }
  141. func (this *Reply_Entry) Reset() { *this = Reply_Entry{} }
  142. func (this *Reply_Entry) String() string { return proto.CompactTextString(this) }
  143. const Default_Reply_Entry_Value int64 = 7
  144. type ReplyExtensions struct {
  145. XXX_unrecognized []byte `json:"-"`
  146. }
  147. func (this *ReplyExtensions) Reset() { *this = ReplyExtensions{} }
  148. func (this *ReplyExtensions) String() string { return proto.CompactTextString(this) }
  149. var E_ReplyExtensions_Time = &proto.ExtensionDesc{
  150. ExtendedType: (*Reply)(nil),
  151. ExtensionType: (*float64)(nil),
  152. Field: 101,
  153. Name: "my.test.ReplyExtensions.time",
  154. Tag: "fixed64,101,opt,name=time",
  155. }
  156. type OldReply struct {
  157. XXX_extensions map[int32]proto.Extension `json:"-"`
  158. XXX_unrecognized []byte `json:"-"`
  159. }
  160. func (this *OldReply) Reset() { *this = OldReply{} }
  161. func (this *OldReply) String() string { return proto.CompactTextString(this) }
  162. func (this *OldReply) Marshal() ([]byte, error) {
  163. return proto.MarshalMessageSet(this.ExtensionMap())
  164. }
  165. func (this *OldReply) Unmarshal(buf []byte) error {
  166. return proto.UnmarshalMessageSet(buf, this.ExtensionMap())
  167. }
  168. // ensure OldReply satisfies proto.Marshaler and proto.Unmarshaler
  169. var _ proto.Marshaler = (*OldReply)(nil)
  170. var _ proto.Unmarshaler = (*OldReply)(nil)
  171. var extRange_OldReply = []proto.ExtensionRange{
  172. {100, 536870911},
  173. }
  174. func (*OldReply) ExtensionRangeArray() []proto.ExtensionRange {
  175. return extRange_OldReply
  176. }
  177. func (this *OldReply) ExtensionMap() map[int32]proto.Extension {
  178. if this.XXX_extensions == nil {
  179. this.XXX_extensions = make(map[int32]proto.Extension)
  180. }
  181. return this.XXX_extensions
  182. }
  183. var E_Tag = &proto.ExtensionDesc{
  184. ExtendedType: (*Reply)(nil),
  185. ExtensionType: (*string)(nil),
  186. Field: 103,
  187. Name: "my.test.tag",
  188. Tag: "bytes,103,opt,name=tag",
  189. }
  190. func init() {
  191. proto.RegisterEnum("my.test.HatType", HatType_name, HatType_value)
  192. proto.RegisterEnum("my.test.Days", Days_name, Days_value)
  193. proto.RegisterEnum("my.test.Request_Color", Request_Color_name, Request_Color_value)
  194. proto.RegisterEnum("my.test.Reply_Entry_Game", Reply_Entry_Game_name, Reply_Entry_Game_value)
  195. proto.RegisterExtension(E_ReplyExtensions_Time)
  196. proto.RegisterExtension(E_Tag)
  197. }