test.pb.go.golden 6.8 KB

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