enumcustomname.pb.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: enumcustomname.proto
  3. /*
  4. Package enumcustomname is a generated protocol buffer package.
  5. Package enumcustomname tests the behavior of enum_customname and
  6. enumvalue_customname extensions.
  7. It is generated from these files:
  8. enumcustomname.proto
  9. It has these top-level messages:
  10. OnlyEnums
  11. */
  12. package enumcustomname
  13. import proto "github.com/gogo/protobuf/proto"
  14. import fmt "fmt"
  15. import math "math"
  16. import _ "github.com/gogo/protobuf/gogoproto"
  17. import test "github.com/gogo/protobuf/test"
  18. import strconv "strconv"
  19. // Reference imports to suppress errors if they are not otherwise used.
  20. var _ = proto.Marshal
  21. var _ = fmt.Errorf
  22. var _ = math.Inf
  23. // This is a compile-time assertion to ensure that this generated file
  24. // is compatible with the proto package it is being compiled against.
  25. // A compilation error at this line likely means your copy of the
  26. // proto package needs to be updated.
  27. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  28. type MyCustomEnum int32
  29. const (
  30. // The following field will take on the custom name and the prefix, joined
  31. // by an underscore.
  32. MyCustomEnum_MyBetterNameA MyCustomEnum = 0
  33. MyCustomEnum_B MyCustomEnum = 1
  34. )
  35. var MyCustomEnum_name = map[int32]string{
  36. 0: "A",
  37. 1: "B",
  38. }
  39. var MyCustomEnum_value = map[string]int32{
  40. "A": 0,
  41. "B": 1,
  42. }
  43. func (x MyCustomEnum) Enum() *MyCustomEnum {
  44. p := new(MyCustomEnum)
  45. *p = x
  46. return p
  47. }
  48. func (x MyCustomEnum) String() string {
  49. return proto.EnumName(MyCustomEnum_name, int32(x))
  50. }
  51. func (x *MyCustomEnum) UnmarshalJSON(data []byte) error {
  52. value, err := proto.UnmarshalJSONEnum(MyCustomEnum_value, data, "MyCustomEnum")
  53. if err != nil {
  54. return err
  55. }
  56. *x = MyCustomEnum(value)
  57. return nil
  58. }
  59. func (MyCustomEnum) EnumDescriptor() ([]byte, []int) { return fileDescriptorEnumcustomname, []int{0} }
  60. type MyCustomUnprefixedEnum int32
  61. const (
  62. MyBetterNameUnprefixedA MyCustomUnprefixedEnum = 0
  63. UNPREFIXED_B MyCustomUnprefixedEnum = 1
  64. )
  65. var MyCustomUnprefixedEnum_name = map[int32]string{
  66. 0: "UNPREFIXED_A",
  67. 1: "UNPREFIXED_B",
  68. }
  69. var MyCustomUnprefixedEnum_value = map[string]int32{
  70. "UNPREFIXED_A": 0,
  71. "UNPREFIXED_B": 1,
  72. }
  73. func (x MyCustomUnprefixedEnum) Enum() *MyCustomUnprefixedEnum {
  74. p := new(MyCustomUnprefixedEnum)
  75. *p = x
  76. return p
  77. }
  78. func (x MyCustomUnprefixedEnum) MarshalJSON() ([]byte, error) {
  79. return proto.MarshalJSONEnum(MyCustomUnprefixedEnum_name, int32(x))
  80. }
  81. func (x *MyCustomUnprefixedEnum) UnmarshalJSON(data []byte) error {
  82. value, err := proto.UnmarshalJSONEnum(MyCustomUnprefixedEnum_value, data, "MyCustomUnprefixedEnum")
  83. if err != nil {
  84. return err
  85. }
  86. *x = MyCustomUnprefixedEnum(value)
  87. return nil
  88. }
  89. func (MyCustomUnprefixedEnum) EnumDescriptor() ([]byte, []int) {
  90. return fileDescriptorEnumcustomname, []int{1}
  91. }
  92. type MyEnumWithEnumStringer int32
  93. const (
  94. MyEnumWithEnumStringer_EnumValueStringerA MyEnumWithEnumStringer = 0
  95. MyEnumWithEnumStringer_STRINGER_B MyEnumWithEnumStringer = 1
  96. )
  97. var MyEnumWithEnumStringer_name = map[int32]string{
  98. 0: "STRINGER_A",
  99. 1: "STRINGER_B",
  100. }
  101. var MyEnumWithEnumStringer_value = map[string]int32{
  102. "STRINGER_A": 0,
  103. "STRINGER_B": 1,
  104. }
  105. func (x MyEnumWithEnumStringer) Enum() *MyEnumWithEnumStringer {
  106. p := new(MyEnumWithEnumStringer)
  107. *p = x
  108. return p
  109. }
  110. func (x MyEnumWithEnumStringer) MarshalJSON() ([]byte, error) {
  111. return proto.MarshalJSONEnum(MyEnumWithEnumStringer_name, int32(x))
  112. }
  113. func (x *MyEnumWithEnumStringer) UnmarshalJSON(data []byte) error {
  114. value, err := proto.UnmarshalJSONEnum(MyEnumWithEnumStringer_value, data, "MyEnumWithEnumStringer")
  115. if err != nil {
  116. return err
  117. }
  118. *x = MyEnumWithEnumStringer(value)
  119. return nil
  120. }
  121. func (MyEnumWithEnumStringer) EnumDescriptor() ([]byte, []int) {
  122. return fileDescriptorEnumcustomname, []int{2}
  123. }
  124. type OnlyEnums struct {
  125. MyEnum *MyCustomEnum `protobuf:"varint,1,opt,name=my_enum,json=myEnum,enum=enumcustomname.MyCustomEnum" json:"my_enum,omitempty"`
  126. MyEnumDefaultA *MyCustomEnum `protobuf:"varint,2,opt,name=my_enum_default_a,json=myEnumDefaultA,enum=enumcustomname.MyCustomEnum,def=0" json:"my_enum_default_a,omitempty"`
  127. MyEnumDefaultB *MyCustomEnum `protobuf:"varint,3,opt,name=my_enum_default_b,json=myEnumDefaultB,enum=enumcustomname.MyCustomEnum,def=1" json:"my_enum_default_b,omitempty"`
  128. MyUnprefixedEnum *MyCustomUnprefixedEnum `protobuf:"varint,4,opt,name=my_unprefixed_enum,json=myUnprefixedEnum,enum=enumcustomname.MyCustomUnprefixedEnum" json:"my_unprefixed_enum,omitempty"`
  129. MyUnprefixedEnumDefaultA *MyCustomUnprefixedEnum `protobuf:"varint,5,opt,name=my_unprefixed_enum_default_a,json=myUnprefixedEnumDefaultA,enum=enumcustomname.MyCustomUnprefixedEnum,def=0" json:"my_unprefixed_enum_default_a,omitempty"`
  130. MyUnprefixedEnumDefaultB *MyCustomUnprefixedEnum `protobuf:"varint,6,opt,name=my_unprefixed_enum_default_b,json=myUnprefixedEnumDefaultB,enum=enumcustomname.MyCustomUnprefixedEnum,def=1" json:"my_unprefixed_enum_default_b,omitempty"`
  131. YetAnotherTestEnum *test.YetAnotherTestEnum `protobuf:"varint,7,opt,name=yet_another_test_enum,json=yetAnotherTestEnum,enum=test.YetAnotherTestEnum" json:"yet_another_test_enum,omitempty"`
  132. YetAnotherTestEnumDefaultAa *test.YetAnotherTestEnum `protobuf:"varint,8,opt,name=yet_another_test_enum_default_aa,json=yetAnotherTestEnumDefaultAa,enum=test.YetAnotherTestEnum,def=0" json:"yet_another_test_enum_default_aa,omitempty"`
  133. YetAnotherTestEnumDefaultBb *test.YetAnotherTestEnum `protobuf:"varint,9,opt,name=yet_another_test_enum_default_bb,json=yetAnotherTestEnumDefaultBb,enum=test.YetAnotherTestEnum,def=1" json:"yet_another_test_enum_default_bb,omitempty"`
  134. YetYetAnotherTestEnum *test.YetYetAnotherTestEnum `protobuf:"varint,10,opt,name=yet_yet_another_test_enum,json=yetYetAnotherTestEnum,enum=test.YetYetAnotherTestEnum" json:"yet_yet_another_test_enum,omitempty"`
  135. YetYetAnotherTestEnumDefaultCc *test.YetYetAnotherTestEnum `protobuf:"varint,11,opt,name=yet_yet_another_test_enum_default_cc,json=yetYetAnotherTestEnumDefaultCc,enum=test.YetYetAnotherTestEnum,def=0" json:"yet_yet_another_test_enum_default_cc,omitempty"`
  136. YetYetAnotherTestEnumDefaultDd *test.YetYetAnotherTestEnum `protobuf:"varint,12,opt,name=yet_yet_another_test_enum_default_dd,json=yetYetAnotherTestEnumDefaultDd,enum=test.YetYetAnotherTestEnum,def=1" json:"yet_yet_another_test_enum_default_dd,omitempty"`
  137. XXX_unrecognized []byte `json:"-"`
  138. }
  139. func (m *OnlyEnums) Reset() { *m = OnlyEnums{} }
  140. func (m *OnlyEnums) String() string { return proto.CompactTextString(m) }
  141. func (*OnlyEnums) ProtoMessage() {}
  142. func (*OnlyEnums) Descriptor() ([]byte, []int) { return fileDescriptorEnumcustomname, []int{0} }
  143. const Default_OnlyEnums_MyEnumDefaultA MyCustomEnum = MyCustomEnum_MyBetterNameA
  144. const Default_OnlyEnums_MyEnumDefaultB MyCustomEnum = MyCustomEnum_B
  145. const Default_OnlyEnums_MyUnprefixedEnumDefaultA MyCustomUnprefixedEnum = MyBetterNameUnprefixedA
  146. const Default_OnlyEnums_MyUnprefixedEnumDefaultB MyCustomUnprefixedEnum = UNPREFIXED_B
  147. const Default_OnlyEnums_YetAnotherTestEnumDefaultAa test.YetAnotherTestEnum = test.AA
  148. const Default_OnlyEnums_YetAnotherTestEnumDefaultBb test.YetAnotherTestEnum = test.BetterYetBB
  149. const Default_OnlyEnums_YetYetAnotherTestEnumDefaultCc test.YetYetAnotherTestEnum = test.YetYetAnotherTestEnum_CC
  150. const Default_OnlyEnums_YetYetAnotherTestEnumDefaultDd test.YetYetAnotherTestEnum = test.YetYetAnotherTestEnum_BetterYetDD
  151. func (m *OnlyEnums) GetMyEnum() MyCustomEnum {
  152. if m != nil && m.MyEnum != nil {
  153. return *m.MyEnum
  154. }
  155. return MyCustomEnum_MyBetterNameA
  156. }
  157. func (m *OnlyEnums) GetMyEnumDefaultA() MyCustomEnum {
  158. if m != nil && m.MyEnumDefaultA != nil {
  159. return *m.MyEnumDefaultA
  160. }
  161. return Default_OnlyEnums_MyEnumDefaultA
  162. }
  163. func (m *OnlyEnums) GetMyEnumDefaultB() MyCustomEnum {
  164. if m != nil && m.MyEnumDefaultB != nil {
  165. return *m.MyEnumDefaultB
  166. }
  167. return Default_OnlyEnums_MyEnumDefaultB
  168. }
  169. func (m *OnlyEnums) GetMyUnprefixedEnum() MyCustomUnprefixedEnum {
  170. if m != nil && m.MyUnprefixedEnum != nil {
  171. return *m.MyUnprefixedEnum
  172. }
  173. return MyBetterNameUnprefixedA
  174. }
  175. func (m *OnlyEnums) GetMyUnprefixedEnumDefaultA() MyCustomUnprefixedEnum {
  176. if m != nil && m.MyUnprefixedEnumDefaultA != nil {
  177. return *m.MyUnprefixedEnumDefaultA
  178. }
  179. return Default_OnlyEnums_MyUnprefixedEnumDefaultA
  180. }
  181. func (m *OnlyEnums) GetMyUnprefixedEnumDefaultB() MyCustomUnprefixedEnum {
  182. if m != nil && m.MyUnprefixedEnumDefaultB != nil {
  183. return *m.MyUnprefixedEnumDefaultB
  184. }
  185. return Default_OnlyEnums_MyUnprefixedEnumDefaultB
  186. }
  187. func (m *OnlyEnums) GetYetAnotherTestEnum() test.YetAnotherTestEnum {
  188. if m != nil && m.YetAnotherTestEnum != nil {
  189. return *m.YetAnotherTestEnum
  190. }
  191. return test.AA
  192. }
  193. func (m *OnlyEnums) GetYetAnotherTestEnumDefaultAa() test.YetAnotherTestEnum {
  194. if m != nil && m.YetAnotherTestEnumDefaultAa != nil {
  195. return *m.YetAnotherTestEnumDefaultAa
  196. }
  197. return Default_OnlyEnums_YetAnotherTestEnumDefaultAa
  198. }
  199. func (m *OnlyEnums) GetYetAnotherTestEnumDefaultBb() test.YetAnotherTestEnum {
  200. if m != nil && m.YetAnotherTestEnumDefaultBb != nil {
  201. return *m.YetAnotherTestEnumDefaultBb
  202. }
  203. return Default_OnlyEnums_YetAnotherTestEnumDefaultBb
  204. }
  205. func (m *OnlyEnums) GetYetYetAnotherTestEnum() test.YetYetAnotherTestEnum {
  206. if m != nil && m.YetYetAnotherTestEnum != nil {
  207. return *m.YetYetAnotherTestEnum
  208. }
  209. return test.YetYetAnotherTestEnum_CC
  210. }
  211. func (m *OnlyEnums) GetYetYetAnotherTestEnumDefaultCc() test.YetYetAnotherTestEnum {
  212. if m != nil && m.YetYetAnotherTestEnumDefaultCc != nil {
  213. return *m.YetYetAnotherTestEnumDefaultCc
  214. }
  215. return Default_OnlyEnums_YetYetAnotherTestEnumDefaultCc
  216. }
  217. func (m *OnlyEnums) GetYetYetAnotherTestEnumDefaultDd() test.YetYetAnotherTestEnum {
  218. if m != nil && m.YetYetAnotherTestEnumDefaultDd != nil {
  219. return *m.YetYetAnotherTestEnumDefaultDd
  220. }
  221. return Default_OnlyEnums_YetYetAnotherTestEnumDefaultDd
  222. }
  223. func init() {
  224. proto.RegisterType((*OnlyEnums)(nil), "enumcustomname.OnlyEnums")
  225. proto.RegisterEnum("enumcustomname.MyCustomEnum", MyCustomEnum_name, MyCustomEnum_value)
  226. proto.RegisterEnum("enumcustomname.MyCustomUnprefixedEnum", MyCustomUnprefixedEnum_name, MyCustomUnprefixedEnum_value)
  227. proto.RegisterEnum("enumcustomname.MyEnumWithEnumStringer", MyEnumWithEnumStringer_name, MyEnumWithEnumStringer_value)
  228. }
  229. func (x MyEnumWithEnumStringer) String() string {
  230. s, ok := MyEnumWithEnumStringer_name[int32(x)]
  231. if ok {
  232. return s
  233. }
  234. return strconv.Itoa(int(x))
  235. }
  236. func init() { proto.RegisterFile("enumcustomname.proto", fileDescriptorEnumcustomname) }
  237. var fileDescriptorEnumcustomname = []byte{
  238. // 551 bytes of a gzipped FileDescriptorProto
  239. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0x4f, 0x8f, 0xd2, 0x40,
  240. 0x18, 0xc6, 0x29, 0xba, 0x2c, 0x3b, 0x22, 0xe9, 0x4e, 0x14, 0x47, 0x30, 0x4d, 0xb3, 0x31, 0xc6,
  241. 0x60, 0x16, 0x12, 0x8f, 0x78, 0x9a, 0x52, 0x34, 0x1b, 0x03, 0x9a, 0xee, 0xe2, 0xbf, 0x4b, 0xd3,
  242. 0x96, 0xe1, 0x4f, 0xc2, 0xb4, 0x9b, 0x32, 0x8d, 0xf6, 0x1b, 0x18, 0xbe, 0x03, 0x27, 0x39, 0x78,
  243. 0xf4, 0xbc, 0x67, 0x3f, 0x98, 0x99, 0xe9, 0xc2, 0x42, 0x5b, 0x0a, 0xf1, 0x34, 0xed, 0x9b, 0xe7,
  244. 0x7d, 0x7e, 0xf3, 0x3e, 0x79, 0x07, 0x3c, 0x22, 0x6e, 0x40, 0x9d, 0x60, 0xc6, 0x3c, 0xea, 0x5a,
  245. 0x94, 0x34, 0xae, 0x7d, 0x8f, 0x79, 0xb0, 0xbc, 0x5d, 0xad, 0x9e, 0x8f, 0x26, 0x6c, 0x1c, 0xd8,
  246. 0x0d, 0xc7, 0xa3, 0xcd, 0x91, 0x37, 0xf2, 0x9a, 0x42, 0x66, 0x07, 0x43, 0xf1, 0x27, 0x7e, 0xc4,
  247. 0x57, 0xd4, 0x5e, 0x7d, 0xb5, 0x53, 0xce, 0xc8, 0x8c, 0x35, 0xd9, 0x98, 0xf0, 0x33, 0x12, 0x9f,
  248. 0xfd, 0x2d, 0x82, 0x93, 0x0f, 0xee, 0x34, 0xec, 0xb8, 0x01, 0x9d, 0xc1, 0x26, 0x38, 0xa6, 0xa1,
  249. 0xc9, 0xf1, 0x48, 0x52, 0xa5, 0x97, 0xe5, 0xd7, 0x95, 0x46, 0xec, 0x86, 0x5d, 0xa1, 0x34, 0x0a,
  250. 0x54, 0x9c, 0x50, 0x07, 0xa7, 0xb7, 0x0d, 0xe6, 0x80, 0x0c, 0xad, 0x60, 0xca, 0x4c, 0x0b, 0xe5,
  251. 0xb3, 0x5a, 0x5b, 0x12, 0x36, 0xca, 0x51, 0xb7, 0x1e, 0x75, 0xe0, 0x34, 0x17, 0x1b, 0xdd, 0xcb,
  252. 0x76, 0xd1, 0x62, 0x2e, 0x1a, 0xec, 0x01, 0x48, 0x43, 0x33, 0x70, 0xaf, 0x7d, 0x32, 0x9c, 0xfc,
  253. 0x20, 0x83, 0x68, 0x8e, 0xfb, 0xc2, 0x46, 0x4d, 0xda, 0xf4, 0xd7, 0x42, 0x31, 0x91, 0x4c, 0x63,
  254. 0x15, 0xe8, 0x82, 0x67, 0x49, 0xbf, 0x8d, 0x31, 0x8f, 0x0e, 0x73, 0x6e, 0x95, 0xfa, 0xbd, 0x8f,
  255. 0x46, 0xe7, 0xed, 0xc5, 0x97, 0x8e, 0x6e, 0x62, 0x03, 0xc5, 0x39, 0xeb, 0x14, 0xb2, 0x79, 0x36,
  256. 0x2a, 0xfc, 0x07, 0x4f, 0xdb, 0xc9, 0xd3, 0xe0, 0x7b, 0xf0, 0x38, 0x24, 0xcc, 0xb4, 0x5c, 0x8f,
  257. 0x8d, 0x89, 0x6f, 0xf2, 0xa5, 0x88, 0x22, 0x3b, 0x16, 0x20, 0xd4, 0x10, 0x6b, 0xf2, 0x95, 0x30,
  258. 0x1c, 0x29, 0xae, 0xc8, 0x8c, 0x89, 0xa8, 0x60, 0x98, 0xa8, 0x41, 0x07, 0xa8, 0xa9, 0x66, 0x77,
  259. 0x79, 0x59, 0xa8, 0x98, 0xed, 0xdb, 0xca, 0x63, 0x6c, 0xd4, 0x92, 0xde, 0xab, 0x80, 0xac, 0xfd,
  260. 0x10, 0xdb, 0x46, 0x27, 0xfb, 0x20, 0x9a, 0x96, 0x01, 0xd1, 0x6c, 0xd8, 0x07, 0x4f, 0x39, 0x24,
  261. 0x3d, 0x1a, 0x20, 0xdc, 0x6b, 0x6b, 0xf7, 0x94, 0x74, 0x78, 0xa8, 0xc9, 0x32, 0xa4, 0xe0, 0xf9,
  262. 0x4e, 0xdb, 0xf5, 0xfd, 0x1d, 0x07, 0x3d, 0xd8, 0x4b, 0x68, 0xe5, 0xdb, 0x6d, 0x43, 0x49, 0xa5,
  263. 0xdc, 0x4e, 0xd1, 0x76, 0x0e, 0xc3, 0x0d, 0x06, 0xa8, 0x74, 0x00, 0x4e, 0xd7, 0xb3, 0x71, 0xfa,
  264. 0xa0, 0xfe, 0x06, 0x14, 0xa2, 0x87, 0x09, 0x11, 0x90, 0xb0, 0x9c, 0xab, 0x9e, 0xce, 0x17, 0xea,
  265. 0xc3, 0x6e, 0xa8, 0x11, 0xc6, 0x88, 0xdf, 0xb3, 0x28, 0xc1, 0xf0, 0x08, 0x48, 0x9a, 0x2c, 0x55,
  266. 0xe5, 0x9b, 0xa5, 0x52, 0xea, 0x86, 0x6d, 0xb1, 0xc1, 0xbc, 0xa5, 0xfe, 0x1d, 0xc8, 0xf1, 0x25,
  267. 0x86, 0xe7, 0x60, 0xeb, 0xd9, 0xc8, 0xb9, 0x6a, 0x6d, 0xbe, 0x50, 0x9f, 0x6c, 0x3a, 0xde, 0x75,
  268. 0x60, 0x28, 0x6f, 0xc9, 0x39, 0xe6, 0xec, 0xe7, 0x2f, 0x25, 0xf7, 0x7b, 0xa9, 0xe4, 0x6e, 0x96,
  269. 0x4a, 0x65, 0x85, 0xdb, 0x86, 0xd4, 0xbf, 0x81, 0x4a, 0x74, 0xeb, 0xcf, 0x13, 0x36, 0xe6, 0xe7,
  270. 0x25, 0xf3, 0x27, 0xee, 0x88, 0xf8, 0xf0, 0x05, 0x00, 0x97, 0x57, 0xc6, 0x45, 0xef, 0x5d, 0xc7,
  271. 0x10, 0xf0, 0xca, 0x7c, 0xa1, 0x42, 0xae, 0xf8, 0x64, 0x4d, 0x03, 0xb2, 0x92, 0x61, 0x58, 0xde,
  272. 0xd0, 0x71, 0x6a, 0x91, 0x13, 0xff, 0x2c, 0x15, 0xe9, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbe,
  273. 0x65, 0x55, 0xe7, 0xdb, 0x05, 0x00, 0x00,
  274. }