protosize.pb.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: protosize.proto
  3. /*
  4. Package protosize is a generated protocol buffer package.
  5. It is generated from these files:
  6. protosize.proto
  7. It has these top-level messages:
  8. SizeMessage
  9. */
  10. package protosize
  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 bytes "bytes"
  16. import io "io"
  17. // Reference imports to suppress errors if they are not otherwise used.
  18. var _ = proto.Marshal
  19. var _ = fmt.Errorf
  20. var _ = math.Inf
  21. // This is a compile-time assertion to ensure that this generated file
  22. // is compatible with the proto package it is being compiled against.
  23. // A compilation error at this line likely means your copy of the
  24. // proto package needs to be updated.
  25. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  26. type SizeMessage struct {
  27. Size *int64 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"`
  28. ProtoSize_ *int64 `protobuf:"varint,2,opt,name=proto_size,json=protoSize" json:"proto_size,omitempty"`
  29. Equal_ *bool `protobuf:"varint,3,opt,name=Equal" json:"Equal,omitempty"`
  30. String_ *string `protobuf:"bytes,4,opt,name=String" json:"String,omitempty"`
  31. XXX_unrecognized []byte `json:"-"`
  32. }
  33. func (m *SizeMessage) Reset() { *m = SizeMessage{} }
  34. func (m *SizeMessage) String() string { return proto.CompactTextString(m) }
  35. func (*SizeMessage) ProtoMessage() {}
  36. func (*SizeMessage) Descriptor() ([]byte, []int) { return fileDescriptorProtosize, []int{0} }
  37. func (m *SizeMessage) GetSize() int64 {
  38. if m != nil && m.Size != nil {
  39. return *m.Size
  40. }
  41. return 0
  42. }
  43. func (m *SizeMessage) GetProtoSize_() int64 {
  44. if m != nil && m.ProtoSize_ != nil {
  45. return *m.ProtoSize_
  46. }
  47. return 0
  48. }
  49. func (m *SizeMessage) GetEqual_() bool {
  50. if m != nil && m.Equal_ != nil {
  51. return *m.Equal_
  52. }
  53. return false
  54. }
  55. func (m *SizeMessage) GetString_() string {
  56. if m != nil && m.String_ != nil {
  57. return *m.String_
  58. }
  59. return ""
  60. }
  61. func init() {
  62. proto.RegisterType((*SizeMessage)(nil), "protosize.SizeMessage")
  63. }
  64. func (this *SizeMessage) Equal(that interface{}) bool {
  65. if that == nil {
  66. if this == nil {
  67. return true
  68. }
  69. return false
  70. }
  71. that1, ok := that.(*SizeMessage)
  72. if !ok {
  73. that2, ok := that.(SizeMessage)
  74. if ok {
  75. that1 = &that2
  76. } else {
  77. return false
  78. }
  79. }
  80. if that1 == nil {
  81. if this == nil {
  82. return true
  83. }
  84. return false
  85. } else if this == nil {
  86. return false
  87. }
  88. if this.Size != nil && that1.Size != nil {
  89. if *this.Size != *that1.Size {
  90. return false
  91. }
  92. } else if this.Size != nil {
  93. return false
  94. } else if that1.Size != nil {
  95. return false
  96. }
  97. if this.ProtoSize_ != nil && that1.ProtoSize_ != nil {
  98. if *this.ProtoSize_ != *that1.ProtoSize_ {
  99. return false
  100. }
  101. } else if this.ProtoSize_ != nil {
  102. return false
  103. } else if that1.ProtoSize_ != nil {
  104. return false
  105. }
  106. if this.Equal_ != nil && that1.Equal_ != nil {
  107. if *this.Equal_ != *that1.Equal_ {
  108. return false
  109. }
  110. } else if this.Equal_ != nil {
  111. return false
  112. } else if that1.Equal_ != nil {
  113. return false
  114. }
  115. if this.String_ != nil && that1.String_ != nil {
  116. if *this.String_ != *that1.String_ {
  117. return false
  118. }
  119. } else if this.String_ != nil {
  120. return false
  121. } else if that1.String_ != nil {
  122. return false
  123. }
  124. if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  125. return false
  126. }
  127. return true
  128. }
  129. func (m *SizeMessage) Marshal() (dAtA []byte, err error) {
  130. size := m.ProtoSize()
  131. dAtA = make([]byte, size)
  132. n, err := m.MarshalTo(dAtA)
  133. if err != nil {
  134. return nil, err
  135. }
  136. return dAtA[:n], nil
  137. }
  138. func (m *SizeMessage) MarshalTo(dAtA []byte) (int, error) {
  139. var i int
  140. _ = i
  141. var l int
  142. _ = l
  143. if m.Size != nil {
  144. dAtA[i] = 0x8
  145. i++
  146. i = encodeVarintProtosize(dAtA, i, uint64(*m.Size))
  147. }
  148. if m.ProtoSize_ != nil {
  149. dAtA[i] = 0x10
  150. i++
  151. i = encodeVarintProtosize(dAtA, i, uint64(*m.ProtoSize_))
  152. }
  153. if m.Equal_ != nil {
  154. dAtA[i] = 0x18
  155. i++
  156. if *m.Equal_ {
  157. dAtA[i] = 1
  158. } else {
  159. dAtA[i] = 0
  160. }
  161. i++
  162. }
  163. if m.String_ != nil {
  164. dAtA[i] = 0x22
  165. i++
  166. i = encodeVarintProtosize(dAtA, i, uint64(len(*m.String_)))
  167. i += copy(dAtA[i:], *m.String_)
  168. }
  169. if m.XXX_unrecognized != nil {
  170. i += copy(dAtA[i:], m.XXX_unrecognized)
  171. }
  172. return i, nil
  173. }
  174. func encodeVarintProtosize(dAtA []byte, offset int, v uint64) int {
  175. for v >= 1<<7 {
  176. dAtA[offset] = uint8(v&0x7f | 0x80)
  177. v >>= 7
  178. offset++
  179. }
  180. dAtA[offset] = uint8(v)
  181. return offset + 1
  182. }
  183. func NewPopulatedSizeMessage(r randyProtosize, easy bool) *SizeMessage {
  184. this := &SizeMessage{}
  185. if r.Intn(10) != 0 {
  186. v1 := int64(r.Int63())
  187. if r.Intn(2) == 0 {
  188. v1 *= -1
  189. }
  190. this.Size = &v1
  191. }
  192. if r.Intn(10) != 0 {
  193. v2 := int64(r.Int63())
  194. if r.Intn(2) == 0 {
  195. v2 *= -1
  196. }
  197. this.ProtoSize_ = &v2
  198. }
  199. if r.Intn(10) != 0 {
  200. v3 := bool(bool(r.Intn(2) == 0))
  201. this.Equal_ = &v3
  202. }
  203. if r.Intn(10) != 0 {
  204. v4 := string(randStringProtosize(r))
  205. this.String_ = &v4
  206. }
  207. if !easy && r.Intn(10) != 0 {
  208. this.XXX_unrecognized = randUnrecognizedProtosize(r, 5)
  209. }
  210. return this
  211. }
  212. type randyProtosize interface {
  213. Float32() float32
  214. Float64() float64
  215. Int63() int64
  216. Int31() int32
  217. Uint32() uint32
  218. Intn(n int) int
  219. }
  220. func randUTF8RuneProtosize(r randyProtosize) rune {
  221. ru := r.Intn(62)
  222. if ru < 10 {
  223. return rune(ru + 48)
  224. } else if ru < 36 {
  225. return rune(ru + 55)
  226. }
  227. return rune(ru + 61)
  228. }
  229. func randStringProtosize(r randyProtosize) string {
  230. v5 := r.Intn(100)
  231. tmps := make([]rune, v5)
  232. for i := 0; i < v5; i++ {
  233. tmps[i] = randUTF8RuneProtosize(r)
  234. }
  235. return string(tmps)
  236. }
  237. func randUnrecognizedProtosize(r randyProtosize, maxFieldNumber int) (dAtA []byte) {
  238. l := r.Intn(5)
  239. for i := 0; i < l; i++ {
  240. wire := r.Intn(4)
  241. if wire == 3 {
  242. wire = 5
  243. }
  244. fieldNumber := maxFieldNumber + r.Intn(100)
  245. dAtA = randFieldProtosize(dAtA, r, fieldNumber, wire)
  246. }
  247. return dAtA
  248. }
  249. func randFieldProtosize(dAtA []byte, r randyProtosize, fieldNumber int, wire int) []byte {
  250. key := uint32(fieldNumber)<<3 | uint32(wire)
  251. switch wire {
  252. case 0:
  253. dAtA = encodeVarintPopulateProtosize(dAtA, uint64(key))
  254. v6 := r.Int63()
  255. if r.Intn(2) == 0 {
  256. v6 *= -1
  257. }
  258. dAtA = encodeVarintPopulateProtosize(dAtA, uint64(v6))
  259. case 1:
  260. dAtA = encodeVarintPopulateProtosize(dAtA, uint64(key))
  261. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  262. case 2:
  263. dAtA = encodeVarintPopulateProtosize(dAtA, uint64(key))
  264. ll := r.Intn(100)
  265. dAtA = encodeVarintPopulateProtosize(dAtA, uint64(ll))
  266. for j := 0; j < ll; j++ {
  267. dAtA = append(dAtA, byte(r.Intn(256)))
  268. }
  269. default:
  270. dAtA = encodeVarintPopulateProtosize(dAtA, uint64(key))
  271. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  272. }
  273. return dAtA
  274. }
  275. func encodeVarintPopulateProtosize(dAtA []byte, v uint64) []byte {
  276. for v >= 1<<7 {
  277. dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
  278. v >>= 7
  279. }
  280. dAtA = append(dAtA, uint8(v))
  281. return dAtA
  282. }
  283. func (m *SizeMessage) ProtoSize() (n int) {
  284. var l int
  285. _ = l
  286. if m.Size != nil {
  287. n += 1 + sovProtosize(uint64(*m.Size))
  288. }
  289. if m.ProtoSize_ != nil {
  290. n += 1 + sovProtosize(uint64(*m.ProtoSize_))
  291. }
  292. if m.Equal_ != nil {
  293. n += 2
  294. }
  295. if m.String_ != nil {
  296. l = len(*m.String_)
  297. n += 1 + l + sovProtosize(uint64(l))
  298. }
  299. if m.XXX_unrecognized != nil {
  300. n += len(m.XXX_unrecognized)
  301. }
  302. return n
  303. }
  304. func sovProtosize(x uint64) (n int) {
  305. for {
  306. n++
  307. x >>= 7
  308. if x == 0 {
  309. break
  310. }
  311. }
  312. return n
  313. }
  314. func sozProtosize(x uint64) (n int) {
  315. return sovProtosize(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  316. }
  317. func (m *SizeMessage) Unmarshal(dAtA []byte) error {
  318. l := len(dAtA)
  319. iNdEx := 0
  320. for iNdEx < l {
  321. preIndex := iNdEx
  322. var wire uint64
  323. for shift := uint(0); ; shift += 7 {
  324. if shift >= 64 {
  325. return ErrIntOverflowProtosize
  326. }
  327. if iNdEx >= l {
  328. return io.ErrUnexpectedEOF
  329. }
  330. b := dAtA[iNdEx]
  331. iNdEx++
  332. wire |= (uint64(b) & 0x7F) << shift
  333. if b < 0x80 {
  334. break
  335. }
  336. }
  337. fieldNum := int32(wire >> 3)
  338. wireType := int(wire & 0x7)
  339. if wireType == 4 {
  340. return fmt.Errorf("proto: SizeMessage: wiretype end group for non-group")
  341. }
  342. if fieldNum <= 0 {
  343. return fmt.Errorf("proto: SizeMessage: illegal tag %d (wire type %d)", fieldNum, wire)
  344. }
  345. switch fieldNum {
  346. case 1:
  347. if wireType != 0 {
  348. return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType)
  349. }
  350. var v int64
  351. for shift := uint(0); ; shift += 7 {
  352. if shift >= 64 {
  353. return ErrIntOverflowProtosize
  354. }
  355. if iNdEx >= l {
  356. return io.ErrUnexpectedEOF
  357. }
  358. b := dAtA[iNdEx]
  359. iNdEx++
  360. v |= (int64(b) & 0x7F) << shift
  361. if b < 0x80 {
  362. break
  363. }
  364. }
  365. m.Size = &v
  366. case 2:
  367. if wireType != 0 {
  368. return fmt.Errorf("proto: wrong wireType = %d for field ProtoSize_", wireType)
  369. }
  370. var v int64
  371. for shift := uint(0); ; shift += 7 {
  372. if shift >= 64 {
  373. return ErrIntOverflowProtosize
  374. }
  375. if iNdEx >= l {
  376. return io.ErrUnexpectedEOF
  377. }
  378. b := dAtA[iNdEx]
  379. iNdEx++
  380. v |= (int64(b) & 0x7F) << shift
  381. if b < 0x80 {
  382. break
  383. }
  384. }
  385. m.ProtoSize_ = &v
  386. case 3:
  387. if wireType != 0 {
  388. return fmt.Errorf("proto: wrong wireType = %d for field Equal_", wireType)
  389. }
  390. var v int
  391. for shift := uint(0); ; shift += 7 {
  392. if shift >= 64 {
  393. return ErrIntOverflowProtosize
  394. }
  395. if iNdEx >= l {
  396. return io.ErrUnexpectedEOF
  397. }
  398. b := dAtA[iNdEx]
  399. iNdEx++
  400. v |= (int(b) & 0x7F) << shift
  401. if b < 0x80 {
  402. break
  403. }
  404. }
  405. b := bool(v != 0)
  406. m.Equal_ = &b
  407. case 4:
  408. if wireType != 2 {
  409. return fmt.Errorf("proto: wrong wireType = %d for field String_", wireType)
  410. }
  411. var stringLen uint64
  412. for shift := uint(0); ; shift += 7 {
  413. if shift >= 64 {
  414. return ErrIntOverflowProtosize
  415. }
  416. if iNdEx >= l {
  417. return io.ErrUnexpectedEOF
  418. }
  419. b := dAtA[iNdEx]
  420. iNdEx++
  421. stringLen |= (uint64(b) & 0x7F) << shift
  422. if b < 0x80 {
  423. break
  424. }
  425. }
  426. intStringLen := int(stringLen)
  427. if intStringLen < 0 {
  428. return ErrInvalidLengthProtosize
  429. }
  430. postIndex := iNdEx + intStringLen
  431. if postIndex > l {
  432. return io.ErrUnexpectedEOF
  433. }
  434. s := string(dAtA[iNdEx:postIndex])
  435. m.String_ = &s
  436. iNdEx = postIndex
  437. default:
  438. iNdEx = preIndex
  439. skippy, err := skipProtosize(dAtA[iNdEx:])
  440. if err != nil {
  441. return err
  442. }
  443. if skippy < 0 {
  444. return ErrInvalidLengthProtosize
  445. }
  446. if (iNdEx + skippy) > l {
  447. return io.ErrUnexpectedEOF
  448. }
  449. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  450. iNdEx += skippy
  451. }
  452. }
  453. if iNdEx > l {
  454. return io.ErrUnexpectedEOF
  455. }
  456. return nil
  457. }
  458. func skipProtosize(dAtA []byte) (n int, err error) {
  459. l := len(dAtA)
  460. iNdEx := 0
  461. for iNdEx < l {
  462. var wire uint64
  463. for shift := uint(0); ; shift += 7 {
  464. if shift >= 64 {
  465. return 0, ErrIntOverflowProtosize
  466. }
  467. if iNdEx >= l {
  468. return 0, io.ErrUnexpectedEOF
  469. }
  470. b := dAtA[iNdEx]
  471. iNdEx++
  472. wire |= (uint64(b) & 0x7F) << shift
  473. if b < 0x80 {
  474. break
  475. }
  476. }
  477. wireType := int(wire & 0x7)
  478. switch wireType {
  479. case 0:
  480. for shift := uint(0); ; shift += 7 {
  481. if shift >= 64 {
  482. return 0, ErrIntOverflowProtosize
  483. }
  484. if iNdEx >= l {
  485. return 0, io.ErrUnexpectedEOF
  486. }
  487. iNdEx++
  488. if dAtA[iNdEx-1] < 0x80 {
  489. break
  490. }
  491. }
  492. return iNdEx, nil
  493. case 1:
  494. iNdEx += 8
  495. return iNdEx, nil
  496. case 2:
  497. var length int
  498. for shift := uint(0); ; shift += 7 {
  499. if shift >= 64 {
  500. return 0, ErrIntOverflowProtosize
  501. }
  502. if iNdEx >= l {
  503. return 0, io.ErrUnexpectedEOF
  504. }
  505. b := dAtA[iNdEx]
  506. iNdEx++
  507. length |= (int(b) & 0x7F) << shift
  508. if b < 0x80 {
  509. break
  510. }
  511. }
  512. iNdEx += length
  513. if length < 0 {
  514. return 0, ErrInvalidLengthProtosize
  515. }
  516. return iNdEx, nil
  517. case 3:
  518. for {
  519. var innerWire uint64
  520. var start int = iNdEx
  521. for shift := uint(0); ; shift += 7 {
  522. if shift >= 64 {
  523. return 0, ErrIntOverflowProtosize
  524. }
  525. if iNdEx >= l {
  526. return 0, io.ErrUnexpectedEOF
  527. }
  528. b := dAtA[iNdEx]
  529. iNdEx++
  530. innerWire |= (uint64(b) & 0x7F) << shift
  531. if b < 0x80 {
  532. break
  533. }
  534. }
  535. innerWireType := int(innerWire & 0x7)
  536. if innerWireType == 4 {
  537. break
  538. }
  539. next, err := skipProtosize(dAtA[start:])
  540. if err != nil {
  541. return 0, err
  542. }
  543. iNdEx = start + next
  544. }
  545. return iNdEx, nil
  546. case 4:
  547. return iNdEx, nil
  548. case 5:
  549. iNdEx += 4
  550. return iNdEx, nil
  551. default:
  552. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  553. }
  554. }
  555. panic("unreachable")
  556. }
  557. var (
  558. ErrInvalidLengthProtosize = fmt.Errorf("proto: negative length found during unmarshaling")
  559. ErrIntOverflowProtosize = fmt.Errorf("proto: integer overflow")
  560. )
  561. func init() { proto.RegisterFile("protosize.proto", fileDescriptorProtosize) }
  562. var fileDescriptorProtosize = []byte{
  563. // 182 bytes of a gzipped FileDescriptorProto
  564. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x28, 0xca, 0x2f,
  565. 0xc9, 0x2f, 0xce, 0xac, 0x4a, 0xd5, 0x03, 0xb3, 0x84, 0x38, 0xe1, 0x02, 0x52, 0xba, 0xe9, 0x99,
  566. 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe9, 0xf9, 0xe9, 0xf9, 0xfa, 0x60, 0xa9,
  567. 0xa4, 0xd2, 0x34, 0x30, 0x0f, 0xcc, 0x01, 0xb3, 0x20, 0x3a, 0x95, 0xf2, 0xb8, 0xb8, 0x83, 0x33,
  568. 0xab, 0x52, 0x7d, 0x53, 0x8b, 0x8b, 0x13, 0xd3, 0x53, 0x85, 0x84, 0xb8, 0x58, 0x40, 0xa6, 0x48,
  569. 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0x81, 0xd9, 0x42, 0xb2, 0x5c, 0x5c, 0x60, 0xb5, 0xf1, 0x60,
  570. 0x19, 0x26, 0xb0, 0x0c, 0xc4, 0x42, 0x90, 0x4e, 0x21, 0x11, 0x2e, 0x56, 0xd7, 0xc2, 0xd2, 0xc4,
  571. 0x1c, 0x09, 0x66, 0x05, 0x46, 0x0d, 0x8e, 0x20, 0x08, 0x47, 0x48, 0x8c, 0x8b, 0x2d, 0xb8, 0xa4,
  572. 0x28, 0x33, 0x2f, 0x5d, 0x82, 0x45, 0x81, 0x51, 0x83, 0x33, 0x08, 0xca, 0x73, 0x92, 0xf8, 0xf1,
  573. 0x50, 0x8e, 0x71, 0xc5, 0x23, 0x39, 0xc6, 0x1d, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc,
  574. 0xf0, 0x48, 0x8e, 0x71, 0xc1, 0x63, 0x39, 0x46, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8b, 0xf7,
  575. 0x87, 0xb3, 0xd5, 0x00, 0x00, 0x00,
  576. }