test.pb.go.golden 5.1 KB

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