test.pb.go.golden 7.1 KB

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