issue261.pb.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: issue261.proto
  3. /*
  4. Package issue261 is a generated protocol buffer package.
  5. It is generated from these files:
  6. issue261.proto
  7. It has these top-level messages:
  8. MapStdTypes
  9. */
  10. package issue261
  11. import proto "github.com/gogo/protobuf/proto"
  12. import fmt "fmt"
  13. import math "math"
  14. import _ "github.com/gogo/protobuf/gogoproto"
  15. import _ "github.com/gogo/protobuf/types"
  16. import time "time"
  17. import strings "strings"
  18. import reflect "reflect"
  19. import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
  20. import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
  21. import io "io"
  22. // Reference imports to suppress errors if they are not otherwise used.
  23. var _ = proto.Marshal
  24. var _ = fmt.Errorf
  25. var _ = math.Inf
  26. var _ = time.Kitchen
  27. // This is a compile-time assertion to ensure that this generated file
  28. // is compatible with the proto package it is being compiled against.
  29. // A compilation error at this line likely means your copy of the
  30. // proto package needs to be updated.
  31. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  32. type MapStdTypes struct {
  33. NullableDuration map[int32]*time.Duration `protobuf:"bytes,3,rep,name=nullableDuration,stdduration" json:"nullableDuration,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"`
  34. }
  35. func (m *MapStdTypes) Reset() { *m = MapStdTypes{} }
  36. func (*MapStdTypes) ProtoMessage() {}
  37. func (*MapStdTypes) Descriptor() ([]byte, []int) { return fileDescriptorIssue261, []int{0} }
  38. func (m *MapStdTypes) GetNullableDuration() map[int32]*time.Duration {
  39. if m != nil {
  40. return m.NullableDuration
  41. }
  42. return nil
  43. }
  44. func init() {
  45. proto.RegisterType((*MapStdTypes)(nil), "issue261.MapStdTypes")
  46. }
  47. func (this *MapStdTypes) Equal(that interface{}) bool {
  48. if that == nil {
  49. if this == nil {
  50. return true
  51. }
  52. return false
  53. }
  54. that1, ok := that.(*MapStdTypes)
  55. if !ok {
  56. that2, ok := that.(MapStdTypes)
  57. if ok {
  58. that1 = &that2
  59. } else {
  60. return false
  61. }
  62. }
  63. if that1 == nil {
  64. if this == nil {
  65. return true
  66. }
  67. return false
  68. } else if this == nil {
  69. return false
  70. }
  71. if len(this.NullableDuration) != len(that1.NullableDuration) {
  72. return false
  73. }
  74. for i := range this.NullableDuration {
  75. if dthis, dthat := this.NullableDuration[i], that1.NullableDuration[i]; (dthis != nil && dthat != nil && *dthis != *dthat) || (dthis != nil && dthat == nil) || (dthis == nil && dthat != nil) {
  76. return false
  77. }
  78. }
  79. return true
  80. }
  81. func (this *MapStdTypes) GoString() string {
  82. if this == nil {
  83. return "nil"
  84. }
  85. s := make([]string, 0, 5)
  86. s = append(s, "&issue261.MapStdTypes{")
  87. keysForNullableDuration := make([]int32, 0, len(this.NullableDuration))
  88. for k := range this.NullableDuration {
  89. keysForNullableDuration = append(keysForNullableDuration, k)
  90. }
  91. github_com_gogo_protobuf_sortkeys.Int32s(keysForNullableDuration)
  92. mapStringForNullableDuration := "map[int32]*time.Duration{"
  93. for _, k := range keysForNullableDuration {
  94. mapStringForNullableDuration += fmt.Sprintf("%#v: %#v,", k, this.NullableDuration[k])
  95. }
  96. mapStringForNullableDuration += "}"
  97. if this.NullableDuration != nil {
  98. s = append(s, "NullableDuration: "+mapStringForNullableDuration+",\n")
  99. }
  100. s = append(s, "}")
  101. return strings.Join(s, "")
  102. }
  103. func valueToGoStringIssue261(v interface{}, typ string) string {
  104. rv := reflect.ValueOf(v)
  105. if rv.IsNil() {
  106. return "nil"
  107. }
  108. pv := reflect.Indirect(rv).Interface()
  109. return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
  110. }
  111. func (m *MapStdTypes) Marshal() (dAtA []byte, err error) {
  112. size := m.Size()
  113. dAtA = make([]byte, size)
  114. n, err := m.MarshalTo(dAtA)
  115. if err != nil {
  116. return nil, err
  117. }
  118. return dAtA[:n], nil
  119. }
  120. func (m *MapStdTypes) MarshalTo(dAtA []byte) (int, error) {
  121. var i int
  122. _ = i
  123. var l int
  124. _ = l
  125. if len(m.NullableDuration) > 0 {
  126. for k := range m.NullableDuration {
  127. dAtA[i] = 0x1a
  128. i++
  129. v := m.NullableDuration[k]
  130. msgSize := 0
  131. if v != nil {
  132. msgSize = github_com_gogo_protobuf_types.SizeOfStdDuration(*v)
  133. msgSize += 1 + sovIssue261(uint64(msgSize))
  134. }
  135. mapSize := 1 + sovIssue261(uint64(k)) + msgSize
  136. i = encodeVarintIssue261(dAtA, i, uint64(mapSize))
  137. dAtA[i] = 0x8
  138. i++
  139. i = encodeVarintIssue261(dAtA, i, uint64(k))
  140. if v != nil {
  141. dAtA[i] = 0x12
  142. i++
  143. i = encodeVarintIssue261(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*v)))
  144. n1, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*v, dAtA[i:])
  145. if err != nil {
  146. return 0, err
  147. }
  148. i += n1
  149. }
  150. }
  151. }
  152. return i, nil
  153. }
  154. func encodeVarintIssue261(dAtA []byte, offset int, v uint64) int {
  155. for v >= 1<<7 {
  156. dAtA[offset] = uint8(v&0x7f | 0x80)
  157. v >>= 7
  158. offset++
  159. }
  160. dAtA[offset] = uint8(v)
  161. return offset + 1
  162. }
  163. func (m *MapStdTypes) Size() (n int) {
  164. var l int
  165. _ = l
  166. if len(m.NullableDuration) > 0 {
  167. for k, v := range m.NullableDuration {
  168. _ = k
  169. _ = v
  170. l = 0
  171. if v != nil {
  172. l = github_com_gogo_protobuf_types.SizeOfStdDuration(*v)
  173. l += 1 + sovIssue261(uint64(l))
  174. }
  175. mapEntrySize := 1 + sovIssue261(uint64(k)) + l
  176. n += mapEntrySize + 1 + sovIssue261(uint64(mapEntrySize))
  177. }
  178. }
  179. return n
  180. }
  181. func sovIssue261(x uint64) (n int) {
  182. for {
  183. n++
  184. x >>= 7
  185. if x == 0 {
  186. break
  187. }
  188. }
  189. return n
  190. }
  191. func sozIssue261(x uint64) (n int) {
  192. return sovIssue261(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  193. }
  194. func (this *MapStdTypes) String() string {
  195. if this == nil {
  196. return "nil"
  197. }
  198. keysForNullableDuration := make([]int32, 0, len(this.NullableDuration))
  199. for k := range this.NullableDuration {
  200. keysForNullableDuration = append(keysForNullableDuration, k)
  201. }
  202. github_com_gogo_protobuf_sortkeys.Int32s(keysForNullableDuration)
  203. mapStringForNullableDuration := "map[int32]*time.Duration{"
  204. for _, k := range keysForNullableDuration {
  205. mapStringForNullableDuration += fmt.Sprintf("%v: %v,", k, this.NullableDuration[k])
  206. }
  207. mapStringForNullableDuration += "}"
  208. s := strings.Join([]string{`&MapStdTypes{`,
  209. `NullableDuration:` + mapStringForNullableDuration + `,`,
  210. `}`,
  211. }, "")
  212. return s
  213. }
  214. func valueToStringIssue261(v interface{}) string {
  215. rv := reflect.ValueOf(v)
  216. if rv.IsNil() {
  217. return "nil"
  218. }
  219. pv := reflect.Indirect(rv).Interface()
  220. return fmt.Sprintf("*%v", pv)
  221. }
  222. func (m *MapStdTypes) Unmarshal(dAtA []byte) error {
  223. l := len(dAtA)
  224. iNdEx := 0
  225. for iNdEx < l {
  226. preIndex := iNdEx
  227. var wire uint64
  228. for shift := uint(0); ; shift += 7 {
  229. if shift >= 64 {
  230. return ErrIntOverflowIssue261
  231. }
  232. if iNdEx >= l {
  233. return io.ErrUnexpectedEOF
  234. }
  235. b := dAtA[iNdEx]
  236. iNdEx++
  237. wire |= (uint64(b) & 0x7F) << shift
  238. if b < 0x80 {
  239. break
  240. }
  241. }
  242. fieldNum := int32(wire >> 3)
  243. wireType := int(wire & 0x7)
  244. if wireType == 4 {
  245. return fmt.Errorf("proto: MapStdTypes: wiretype end group for non-group")
  246. }
  247. if fieldNum <= 0 {
  248. return fmt.Errorf("proto: MapStdTypes: illegal tag %d (wire type %d)", fieldNum, wire)
  249. }
  250. switch fieldNum {
  251. case 3:
  252. if wireType != 2 {
  253. return fmt.Errorf("proto: wrong wireType = %d for field NullableDuration", wireType)
  254. }
  255. var msglen int
  256. for shift := uint(0); ; shift += 7 {
  257. if shift >= 64 {
  258. return ErrIntOverflowIssue261
  259. }
  260. if iNdEx >= l {
  261. return io.ErrUnexpectedEOF
  262. }
  263. b := dAtA[iNdEx]
  264. iNdEx++
  265. msglen |= (int(b) & 0x7F) << shift
  266. if b < 0x80 {
  267. break
  268. }
  269. }
  270. if msglen < 0 {
  271. return ErrInvalidLengthIssue261
  272. }
  273. postIndex := iNdEx + msglen
  274. if postIndex > l {
  275. return io.ErrUnexpectedEOF
  276. }
  277. if m.NullableDuration == nil {
  278. m.NullableDuration = make(map[int32]*time.Duration)
  279. }
  280. var mapkey int32
  281. mapvalue := new(time.Duration)
  282. for iNdEx < postIndex {
  283. entryPreIndex := iNdEx
  284. var wire uint64
  285. for shift := uint(0); ; shift += 7 {
  286. if shift >= 64 {
  287. return ErrIntOverflowIssue261
  288. }
  289. if iNdEx >= l {
  290. return io.ErrUnexpectedEOF
  291. }
  292. b := dAtA[iNdEx]
  293. iNdEx++
  294. wire |= (uint64(b) & 0x7F) << shift
  295. if b < 0x80 {
  296. break
  297. }
  298. }
  299. fieldNum := int32(wire >> 3)
  300. if fieldNum == 1 {
  301. for shift := uint(0); ; shift += 7 {
  302. if shift >= 64 {
  303. return ErrIntOverflowIssue261
  304. }
  305. if iNdEx >= l {
  306. return io.ErrUnexpectedEOF
  307. }
  308. b := dAtA[iNdEx]
  309. iNdEx++
  310. mapkey |= (int32(b) & 0x7F) << shift
  311. if b < 0x80 {
  312. break
  313. }
  314. }
  315. } else if fieldNum == 2 {
  316. var mapmsglen int
  317. for shift := uint(0); ; shift += 7 {
  318. if shift >= 64 {
  319. return ErrIntOverflowIssue261
  320. }
  321. if iNdEx >= l {
  322. return io.ErrUnexpectedEOF
  323. }
  324. b := dAtA[iNdEx]
  325. iNdEx++
  326. mapmsglen |= (int(b) & 0x7F) << shift
  327. if b < 0x80 {
  328. break
  329. }
  330. }
  331. if mapmsglen < 0 {
  332. return ErrInvalidLengthIssue261
  333. }
  334. postmsgIndex := iNdEx + mapmsglen
  335. if mapmsglen < 0 {
  336. return ErrInvalidLengthIssue261
  337. }
  338. if postmsgIndex > l {
  339. return io.ErrUnexpectedEOF
  340. }
  341. if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(mapvalue, dAtA[iNdEx:postmsgIndex]); err != nil {
  342. return err
  343. }
  344. iNdEx = postmsgIndex
  345. } else {
  346. iNdEx = entryPreIndex
  347. skippy, err := skipIssue261(dAtA[iNdEx:])
  348. if err != nil {
  349. return err
  350. }
  351. if skippy < 0 {
  352. return ErrInvalidLengthIssue261
  353. }
  354. if (iNdEx + skippy) > postIndex {
  355. return io.ErrUnexpectedEOF
  356. }
  357. iNdEx += skippy
  358. }
  359. }
  360. m.NullableDuration[mapkey] = mapvalue
  361. iNdEx = postIndex
  362. default:
  363. iNdEx = preIndex
  364. skippy, err := skipIssue261(dAtA[iNdEx:])
  365. if err != nil {
  366. return err
  367. }
  368. if skippy < 0 {
  369. return ErrInvalidLengthIssue261
  370. }
  371. if (iNdEx + skippy) > l {
  372. return io.ErrUnexpectedEOF
  373. }
  374. iNdEx += skippy
  375. }
  376. }
  377. if iNdEx > l {
  378. return io.ErrUnexpectedEOF
  379. }
  380. return nil
  381. }
  382. func skipIssue261(dAtA []byte) (n int, err error) {
  383. l := len(dAtA)
  384. iNdEx := 0
  385. for iNdEx < l {
  386. var wire uint64
  387. for shift := uint(0); ; shift += 7 {
  388. if shift >= 64 {
  389. return 0, ErrIntOverflowIssue261
  390. }
  391. if iNdEx >= l {
  392. return 0, io.ErrUnexpectedEOF
  393. }
  394. b := dAtA[iNdEx]
  395. iNdEx++
  396. wire |= (uint64(b) & 0x7F) << shift
  397. if b < 0x80 {
  398. break
  399. }
  400. }
  401. wireType := int(wire & 0x7)
  402. switch wireType {
  403. case 0:
  404. for shift := uint(0); ; shift += 7 {
  405. if shift >= 64 {
  406. return 0, ErrIntOverflowIssue261
  407. }
  408. if iNdEx >= l {
  409. return 0, io.ErrUnexpectedEOF
  410. }
  411. iNdEx++
  412. if dAtA[iNdEx-1] < 0x80 {
  413. break
  414. }
  415. }
  416. return iNdEx, nil
  417. case 1:
  418. iNdEx += 8
  419. return iNdEx, nil
  420. case 2:
  421. var length int
  422. for shift := uint(0); ; shift += 7 {
  423. if shift >= 64 {
  424. return 0, ErrIntOverflowIssue261
  425. }
  426. if iNdEx >= l {
  427. return 0, io.ErrUnexpectedEOF
  428. }
  429. b := dAtA[iNdEx]
  430. iNdEx++
  431. length |= (int(b) & 0x7F) << shift
  432. if b < 0x80 {
  433. break
  434. }
  435. }
  436. iNdEx += length
  437. if length < 0 {
  438. return 0, ErrInvalidLengthIssue261
  439. }
  440. return iNdEx, nil
  441. case 3:
  442. for {
  443. var innerWire uint64
  444. var start int = iNdEx
  445. for shift := uint(0); ; shift += 7 {
  446. if shift >= 64 {
  447. return 0, ErrIntOverflowIssue261
  448. }
  449. if iNdEx >= l {
  450. return 0, io.ErrUnexpectedEOF
  451. }
  452. b := dAtA[iNdEx]
  453. iNdEx++
  454. innerWire |= (uint64(b) & 0x7F) << shift
  455. if b < 0x80 {
  456. break
  457. }
  458. }
  459. innerWireType := int(innerWire & 0x7)
  460. if innerWireType == 4 {
  461. break
  462. }
  463. next, err := skipIssue261(dAtA[start:])
  464. if err != nil {
  465. return 0, err
  466. }
  467. iNdEx = start + next
  468. }
  469. return iNdEx, nil
  470. case 4:
  471. return iNdEx, nil
  472. case 5:
  473. iNdEx += 4
  474. return iNdEx, nil
  475. default:
  476. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  477. }
  478. }
  479. panic("unreachable")
  480. }
  481. var (
  482. ErrInvalidLengthIssue261 = fmt.Errorf("proto: negative length found during unmarshaling")
  483. ErrIntOverflowIssue261 = fmt.Errorf("proto: integer overflow")
  484. )
  485. func init() { proto.RegisterFile("issue261.proto", fileDescriptorIssue261) }
  486. var fileDescriptorIssue261 = []byte{
  487. // 266 bytes of a gzipped FileDescriptorProto
  488. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0x2c, 0x2e, 0x2e,
  489. 0x4d, 0x35, 0x32, 0x33, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf1, 0xa5, 0x74,
  490. 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0xd3, 0xf3, 0xf5,
  491. 0xc1, 0x0a, 0x92, 0x4a, 0xd3, 0xc0, 0x3c, 0x30, 0x07, 0xcc, 0x82, 0x68, 0x94, 0x92, 0x4b, 0xcf,
  492. 0xcf, 0x4f, 0xcf, 0x49, 0x45, 0xa8, 0x4a, 0x29, 0x2d, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0x83, 0xc8,
  493. 0x2b, 0x9d, 0x61, 0xe4, 0xe2, 0xf6, 0x4d, 0x2c, 0x08, 0x2e, 0x49, 0x09, 0xa9, 0x2c, 0x48, 0x2d,
  494. 0x16, 0x8a, 0xe5, 0x12, 0xc8, 0x2b, 0xcd, 0xc9, 0x49, 0x4c, 0xca, 0x49, 0x75, 0x81, 0xaa, 0x94,
  495. 0x60, 0x56, 0x60, 0xd6, 0xe0, 0x36, 0xd2, 0xd6, 0x83, 0xbb, 0x09, 0x49, 0x83, 0x9e, 0x1f, 0x9a,
  496. 0x6a, 0xd7, 0xbc, 0x92, 0xa2, 0x4a, 0x27, 0x96, 0x19, 0xf7, 0xe5, 0x19, 0x83, 0x30, 0x8c, 0x92,
  497. 0x8a, 0xe3, 0x12, 0xc5, 0xaa, 0x41, 0x48, 0x80, 0x8b, 0x39, 0x3b, 0xb5, 0x52, 0x82, 0x51, 0x81,
  498. 0x51, 0x83, 0x35, 0x08, 0xc4, 0x14, 0xd2, 0xe7, 0x62, 0x2d, 0x4b, 0xcc, 0x29, 0x4d, 0x95, 0x60,
  499. 0x52, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd4, 0x83, 0xf8, 0x44, 0x0f, 0xe6, 0x13, 0x3d, 0x98, 0x01,
  500. 0x41, 0x10, 0x75, 0x56, 0x4c, 0x16, 0x8c, 0x4e, 0x3a, 0x17, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28,
  501. 0xc7, 0xf0, 0xe1, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c,
  502. 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e,
  503. 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0x21, 0x89, 0x0d, 0x6c, 0x96, 0x31, 0x20, 0x00, 0x00,
  504. 0xff, 0xff, 0xf1, 0xf2, 0x28, 0x08, 0x6e, 0x01, 0x00, 0x00,
  505. }