1
0

log.pb.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984
  1. package alils
  2. import "github.com/gogo/protobuf/proto"
  3. import "fmt"
  4. import "math"
  5. // discarding unused import gogoproto "."
  6. import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
  7. import "io"
  8. // Reference imports to suppress errors if they are not otherwise used.
  9. var _ = proto.Marshal
  10. var _ = fmt.Errorf
  11. var _ = math.Inf
  12. type Log struct {
  13. Time *uint32 `protobuf:"varint,1,req,name=Time" json:"Time,omitempty"`
  14. Contents []*Log_Content `protobuf:"bytes,2,rep,name=Contents" json:"Contents,omitempty"`
  15. XXX_unrecognized []byte `json:"-"`
  16. }
  17. func (m *Log) Reset() { *m = Log{} }
  18. func (m *Log) String() string { return proto.CompactTextString(m) }
  19. func (*Log) ProtoMessage() {}
  20. func (m *Log) GetTime() uint32 {
  21. if m != nil && m.Time != nil {
  22. return *m.Time
  23. }
  24. return 0
  25. }
  26. func (m *Log) GetContents() []*Log_Content {
  27. if m != nil {
  28. return m.Contents
  29. }
  30. return nil
  31. }
  32. type Log_Content struct {
  33. Key *string `protobuf:"bytes,1,req,name=Key" json:"Key,omitempty"`
  34. Value *string `protobuf:"bytes,2,req,name=Value" json:"Value,omitempty"`
  35. XXX_unrecognized []byte `json:"-"`
  36. }
  37. func (m *Log_Content) Reset() { *m = Log_Content{} }
  38. func (m *Log_Content) String() string { return proto.CompactTextString(m) }
  39. func (*Log_Content) ProtoMessage() {}
  40. func (m *Log_Content) GetKey() string {
  41. if m != nil && m.Key != nil {
  42. return *m.Key
  43. }
  44. return ""
  45. }
  46. func (m *Log_Content) GetValue() string {
  47. if m != nil && m.Value != nil {
  48. return *m.Value
  49. }
  50. return ""
  51. }
  52. type LogGroup struct {
  53. Logs []*Log `protobuf:"bytes,1,rep,name=Logs" json:"Logs,omitempty"`
  54. Reserved *string `protobuf:"bytes,2,opt,name=Reserved" json:"Reserved,omitempty"`
  55. Topic *string `protobuf:"bytes,3,opt,name=Topic" json:"Topic,omitempty"`
  56. Source *string `protobuf:"bytes,4,opt,name=Source" json:"Source,omitempty"`
  57. XXX_unrecognized []byte `json:"-"`
  58. }
  59. func (m *LogGroup) Reset() { *m = LogGroup{} }
  60. func (m *LogGroup) String() string { return proto.CompactTextString(m) }
  61. func (*LogGroup) ProtoMessage() {}
  62. func (m *LogGroup) GetLogs() []*Log {
  63. if m != nil {
  64. return m.Logs
  65. }
  66. return nil
  67. }
  68. func (m *LogGroup) GetReserved() string {
  69. if m != nil && m.Reserved != nil {
  70. return *m.Reserved
  71. }
  72. return ""
  73. }
  74. func (m *LogGroup) GetTopic() string {
  75. if m != nil && m.Topic != nil {
  76. return *m.Topic
  77. }
  78. return ""
  79. }
  80. func (m *LogGroup) GetSource() string {
  81. if m != nil && m.Source != nil {
  82. return *m.Source
  83. }
  84. return ""
  85. }
  86. type LogGroupList struct {
  87. LogGroups []*LogGroup `protobuf:"bytes,1,rep,name=logGroups" json:"logGroups,omitempty"`
  88. XXX_unrecognized []byte `json:"-"`
  89. }
  90. func (m *LogGroupList) Reset() { *m = LogGroupList{} }
  91. func (m *LogGroupList) String() string { return proto.CompactTextString(m) }
  92. func (*LogGroupList) ProtoMessage() {}
  93. func (m *LogGroupList) GetLogGroups() []*LogGroup {
  94. if m != nil {
  95. return m.LogGroups
  96. }
  97. return nil
  98. }
  99. func (m *Log) Marshal() (data []byte, err error) {
  100. size := m.Size()
  101. data = make([]byte, size)
  102. n, err := m.MarshalTo(data)
  103. if err != nil {
  104. return nil, err
  105. }
  106. return data[:n], nil
  107. }
  108. func (m *Log) MarshalTo(data []byte) (int, error) {
  109. var i int
  110. _ = i
  111. var l int
  112. _ = l
  113. if m.Time == nil {
  114. return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Time")
  115. } else {
  116. data[i] = 0x8
  117. i++
  118. i = encodeVarintLog(data, i, uint64(*m.Time))
  119. }
  120. if len(m.Contents) > 0 {
  121. for _, msg := range m.Contents {
  122. data[i] = 0x12
  123. i++
  124. i = encodeVarintLog(data, i, uint64(msg.Size()))
  125. n, err := msg.MarshalTo(data[i:])
  126. if err != nil {
  127. return 0, err
  128. }
  129. i += n
  130. }
  131. }
  132. if m.XXX_unrecognized != nil {
  133. i += copy(data[i:], m.XXX_unrecognized)
  134. }
  135. return i, nil
  136. }
  137. func (m *Log_Content) Marshal() (data []byte, err error) {
  138. size := m.Size()
  139. data = make([]byte, size)
  140. n, err := m.MarshalTo(data)
  141. if err != nil {
  142. return nil, err
  143. }
  144. return data[:n], nil
  145. }
  146. func (m *Log_Content) MarshalTo(data []byte) (int, error) {
  147. var i int
  148. _ = i
  149. var l int
  150. _ = l
  151. if m.Key == nil {
  152. return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Key")
  153. } else {
  154. data[i] = 0xa
  155. i++
  156. i = encodeVarintLog(data, i, uint64(len(*m.Key)))
  157. i += copy(data[i:], *m.Key)
  158. }
  159. if m.Value == nil {
  160. return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Value")
  161. } else {
  162. data[i] = 0x12
  163. i++
  164. i = encodeVarintLog(data, i, uint64(len(*m.Value)))
  165. i += copy(data[i:], *m.Value)
  166. }
  167. if m.XXX_unrecognized != nil {
  168. i += copy(data[i:], m.XXX_unrecognized)
  169. }
  170. return i, nil
  171. }
  172. func (m *LogGroup) Marshal() (data []byte, err error) {
  173. size := m.Size()
  174. data = make([]byte, size)
  175. n, err := m.MarshalTo(data)
  176. if err != nil {
  177. return nil, err
  178. }
  179. return data[:n], nil
  180. }
  181. func (m *LogGroup) MarshalTo(data []byte) (int, error) {
  182. var i int
  183. _ = i
  184. var l int
  185. _ = l
  186. if len(m.Logs) > 0 {
  187. for _, msg := range m.Logs {
  188. data[i] = 0xa
  189. i++
  190. i = encodeVarintLog(data, i, uint64(msg.Size()))
  191. n, err := msg.MarshalTo(data[i:])
  192. if err != nil {
  193. return 0, err
  194. }
  195. i += n
  196. }
  197. }
  198. if m.Reserved != nil {
  199. data[i] = 0x12
  200. i++
  201. i = encodeVarintLog(data, i, uint64(len(*m.Reserved)))
  202. i += copy(data[i:], *m.Reserved)
  203. }
  204. if m.Topic != nil {
  205. data[i] = 0x1a
  206. i++
  207. i = encodeVarintLog(data, i, uint64(len(*m.Topic)))
  208. i += copy(data[i:], *m.Topic)
  209. }
  210. if m.Source != nil {
  211. data[i] = 0x22
  212. i++
  213. i = encodeVarintLog(data, i, uint64(len(*m.Source)))
  214. i += copy(data[i:], *m.Source)
  215. }
  216. if m.XXX_unrecognized != nil {
  217. i += copy(data[i:], m.XXX_unrecognized)
  218. }
  219. return i, nil
  220. }
  221. func (m *LogGroupList) Marshal() (data []byte, err error) {
  222. size := m.Size()
  223. data = make([]byte, size)
  224. n, err := m.MarshalTo(data)
  225. if err != nil {
  226. return nil, err
  227. }
  228. return data[:n], nil
  229. }
  230. func (m *LogGroupList) MarshalTo(data []byte) (int, error) {
  231. var i int
  232. _ = i
  233. var l int
  234. _ = l
  235. if len(m.LogGroups) > 0 {
  236. for _, msg := range m.LogGroups {
  237. data[i] = 0xa
  238. i++
  239. i = encodeVarintLog(data, i, uint64(msg.Size()))
  240. n, err := msg.MarshalTo(data[i:])
  241. if err != nil {
  242. return 0, err
  243. }
  244. i += n
  245. }
  246. }
  247. if m.XXX_unrecognized != nil {
  248. i += copy(data[i:], m.XXX_unrecognized)
  249. }
  250. return i, nil
  251. }
  252. func encodeFixed64Log(data []byte, offset int, v uint64) int {
  253. data[offset] = uint8(v)
  254. data[offset+1] = uint8(v >> 8)
  255. data[offset+2] = uint8(v >> 16)
  256. data[offset+3] = uint8(v >> 24)
  257. data[offset+4] = uint8(v >> 32)
  258. data[offset+5] = uint8(v >> 40)
  259. data[offset+6] = uint8(v >> 48)
  260. data[offset+7] = uint8(v >> 56)
  261. return offset + 8
  262. }
  263. func encodeFixed32Log(data []byte, offset int, v uint32) int {
  264. data[offset] = uint8(v)
  265. data[offset+1] = uint8(v >> 8)
  266. data[offset+2] = uint8(v >> 16)
  267. data[offset+3] = uint8(v >> 24)
  268. return offset + 4
  269. }
  270. func encodeVarintLog(data []byte, offset int, v uint64) int {
  271. for v >= 1<<7 {
  272. data[offset] = uint8(v&0x7f | 0x80)
  273. v >>= 7
  274. offset++
  275. }
  276. data[offset] = uint8(v)
  277. return offset + 1
  278. }
  279. func (m *Log) Size() (n int) {
  280. var l int
  281. _ = l
  282. if m.Time != nil {
  283. n += 1 + sovLog(uint64(*m.Time))
  284. }
  285. if len(m.Contents) > 0 {
  286. for _, e := range m.Contents {
  287. l = e.Size()
  288. n += 1 + l + sovLog(uint64(l))
  289. }
  290. }
  291. if m.XXX_unrecognized != nil {
  292. n += len(m.XXX_unrecognized)
  293. }
  294. return n
  295. }
  296. func (m *Log_Content) Size() (n int) {
  297. var l int
  298. _ = l
  299. if m.Key != nil {
  300. l = len(*m.Key)
  301. n += 1 + l + sovLog(uint64(l))
  302. }
  303. if m.Value != nil {
  304. l = len(*m.Value)
  305. n += 1 + l + sovLog(uint64(l))
  306. }
  307. if m.XXX_unrecognized != nil {
  308. n += len(m.XXX_unrecognized)
  309. }
  310. return n
  311. }
  312. func (m *LogGroup) Size() (n int) {
  313. var l int
  314. _ = l
  315. if len(m.Logs) > 0 {
  316. for _, e := range m.Logs {
  317. l = e.Size()
  318. n += 1 + l + sovLog(uint64(l))
  319. }
  320. }
  321. if m.Reserved != nil {
  322. l = len(*m.Reserved)
  323. n += 1 + l + sovLog(uint64(l))
  324. }
  325. if m.Topic != nil {
  326. l = len(*m.Topic)
  327. n += 1 + l + sovLog(uint64(l))
  328. }
  329. if m.Source != nil {
  330. l = len(*m.Source)
  331. n += 1 + l + sovLog(uint64(l))
  332. }
  333. if m.XXX_unrecognized != nil {
  334. n += len(m.XXX_unrecognized)
  335. }
  336. return n
  337. }
  338. func (m *LogGroupList) Size() (n int) {
  339. var l int
  340. _ = l
  341. if len(m.LogGroups) > 0 {
  342. for _, e := range m.LogGroups {
  343. l = e.Size()
  344. n += 1 + l + sovLog(uint64(l))
  345. }
  346. }
  347. if m.XXX_unrecognized != nil {
  348. n += len(m.XXX_unrecognized)
  349. }
  350. return n
  351. }
  352. func sovLog(x uint64) (n int) {
  353. for {
  354. n++
  355. x >>= 7
  356. if x == 0 {
  357. break
  358. }
  359. }
  360. return n
  361. }
  362. func sozLog(x uint64) (n int) {
  363. return sovLog(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  364. }
  365. func (m *Log) Unmarshal(data []byte) error {
  366. var hasFields [1]uint64
  367. l := len(data)
  368. iNdEx := 0
  369. for iNdEx < l {
  370. preIndex := iNdEx
  371. var wire uint64
  372. for shift := uint(0); ; shift += 7 {
  373. if shift >= 64 {
  374. return ErrIntOverflowLog
  375. }
  376. if iNdEx >= l {
  377. return io.ErrUnexpectedEOF
  378. }
  379. b := data[iNdEx]
  380. iNdEx++
  381. wire |= (uint64(b) & 0x7F) << shift
  382. if b < 0x80 {
  383. break
  384. }
  385. }
  386. fieldNum := int32(wire >> 3)
  387. wireType := int(wire & 0x7)
  388. if wireType == 4 {
  389. return fmt.Errorf("proto: Log: wiretype end group for non-group")
  390. }
  391. if fieldNum <= 0 {
  392. return fmt.Errorf("proto: Log: illegal tag %d (wire type %d)", fieldNum, wire)
  393. }
  394. switch fieldNum {
  395. case 1:
  396. if wireType != 0 {
  397. return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
  398. }
  399. var v uint32
  400. for shift := uint(0); ; shift += 7 {
  401. if shift >= 64 {
  402. return ErrIntOverflowLog
  403. }
  404. if iNdEx >= l {
  405. return io.ErrUnexpectedEOF
  406. }
  407. b := data[iNdEx]
  408. iNdEx++
  409. v |= (uint32(b) & 0x7F) << shift
  410. if b < 0x80 {
  411. break
  412. }
  413. }
  414. m.Time = &v
  415. hasFields[0] |= uint64(0x00000001)
  416. case 2:
  417. if wireType != 2 {
  418. return fmt.Errorf("proto: wrong wireType = %d for field Contents", wireType)
  419. }
  420. var msglen int
  421. for shift := uint(0); ; shift += 7 {
  422. if shift >= 64 {
  423. return ErrIntOverflowLog
  424. }
  425. if iNdEx >= l {
  426. return io.ErrUnexpectedEOF
  427. }
  428. b := data[iNdEx]
  429. iNdEx++
  430. msglen |= (int(b) & 0x7F) << shift
  431. if b < 0x80 {
  432. break
  433. }
  434. }
  435. if msglen < 0 {
  436. return ErrInvalidLengthLog
  437. }
  438. postIndex := iNdEx + msglen
  439. if postIndex > l {
  440. return io.ErrUnexpectedEOF
  441. }
  442. m.Contents = append(m.Contents, &Log_Content{})
  443. if err := m.Contents[len(m.Contents)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  444. return err
  445. }
  446. iNdEx = postIndex
  447. default:
  448. iNdEx = preIndex
  449. skippy, err := skipLog(data[iNdEx:])
  450. if err != nil {
  451. return err
  452. }
  453. if skippy < 0 {
  454. return ErrInvalidLengthLog
  455. }
  456. if (iNdEx + skippy) > l {
  457. return io.ErrUnexpectedEOF
  458. }
  459. m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
  460. iNdEx += skippy
  461. }
  462. }
  463. if hasFields[0]&uint64(0x00000001) == 0 {
  464. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Time")
  465. }
  466. if iNdEx > l {
  467. return io.ErrUnexpectedEOF
  468. }
  469. return nil
  470. }
  471. func (m *Log_Content) Unmarshal(data []byte) error {
  472. var hasFields [1]uint64
  473. l := len(data)
  474. iNdEx := 0
  475. for iNdEx < l {
  476. preIndex := iNdEx
  477. var wire uint64
  478. for shift := uint(0); ; shift += 7 {
  479. if shift >= 64 {
  480. return ErrIntOverflowLog
  481. }
  482. if iNdEx >= l {
  483. return io.ErrUnexpectedEOF
  484. }
  485. b := data[iNdEx]
  486. iNdEx++
  487. wire |= (uint64(b) & 0x7F) << shift
  488. if b < 0x80 {
  489. break
  490. }
  491. }
  492. fieldNum := int32(wire >> 3)
  493. wireType := int(wire & 0x7)
  494. if wireType == 4 {
  495. return fmt.Errorf("proto: Content: wiretype end group for non-group")
  496. }
  497. if fieldNum <= 0 {
  498. return fmt.Errorf("proto: Content: illegal tag %d (wire type %d)", fieldNum, wire)
  499. }
  500. switch fieldNum {
  501. case 1:
  502. if wireType != 2 {
  503. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  504. }
  505. var stringLen uint64
  506. for shift := uint(0); ; shift += 7 {
  507. if shift >= 64 {
  508. return ErrIntOverflowLog
  509. }
  510. if iNdEx >= l {
  511. return io.ErrUnexpectedEOF
  512. }
  513. b := data[iNdEx]
  514. iNdEx++
  515. stringLen |= (uint64(b) & 0x7F) << shift
  516. if b < 0x80 {
  517. break
  518. }
  519. }
  520. intStringLen := int(stringLen)
  521. if intStringLen < 0 {
  522. return ErrInvalidLengthLog
  523. }
  524. postIndex := iNdEx + intStringLen
  525. if postIndex > l {
  526. return io.ErrUnexpectedEOF
  527. }
  528. s := string(data[iNdEx:postIndex])
  529. m.Key = &s
  530. iNdEx = postIndex
  531. hasFields[0] |= uint64(0x00000001)
  532. case 2:
  533. if wireType != 2 {
  534. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  535. }
  536. var stringLen uint64
  537. for shift := uint(0); ; shift += 7 {
  538. if shift >= 64 {
  539. return ErrIntOverflowLog
  540. }
  541. if iNdEx >= l {
  542. return io.ErrUnexpectedEOF
  543. }
  544. b := data[iNdEx]
  545. iNdEx++
  546. stringLen |= (uint64(b) & 0x7F) << shift
  547. if b < 0x80 {
  548. break
  549. }
  550. }
  551. intStringLen := int(stringLen)
  552. if intStringLen < 0 {
  553. return ErrInvalidLengthLog
  554. }
  555. postIndex := iNdEx + intStringLen
  556. if postIndex > l {
  557. return io.ErrUnexpectedEOF
  558. }
  559. s := string(data[iNdEx:postIndex])
  560. m.Value = &s
  561. iNdEx = postIndex
  562. hasFields[0] |= uint64(0x00000002)
  563. default:
  564. iNdEx = preIndex
  565. skippy, err := skipLog(data[iNdEx:])
  566. if err != nil {
  567. return err
  568. }
  569. if skippy < 0 {
  570. return ErrInvalidLengthLog
  571. }
  572. if (iNdEx + skippy) > l {
  573. return io.ErrUnexpectedEOF
  574. }
  575. m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
  576. iNdEx += skippy
  577. }
  578. }
  579. if hasFields[0]&uint64(0x00000001) == 0 {
  580. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Key")
  581. }
  582. if hasFields[0]&uint64(0x00000002) == 0 {
  583. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Value")
  584. }
  585. if iNdEx > l {
  586. return io.ErrUnexpectedEOF
  587. }
  588. return nil
  589. }
  590. func (m *LogGroup) Unmarshal(data []byte) error {
  591. l := len(data)
  592. iNdEx := 0
  593. for iNdEx < l {
  594. preIndex := iNdEx
  595. var wire uint64
  596. for shift := uint(0); ; shift += 7 {
  597. if shift >= 64 {
  598. return ErrIntOverflowLog
  599. }
  600. if iNdEx >= l {
  601. return io.ErrUnexpectedEOF
  602. }
  603. b := data[iNdEx]
  604. iNdEx++
  605. wire |= (uint64(b) & 0x7F) << shift
  606. if b < 0x80 {
  607. break
  608. }
  609. }
  610. fieldNum := int32(wire >> 3)
  611. wireType := int(wire & 0x7)
  612. if wireType == 4 {
  613. return fmt.Errorf("proto: LogGroup: wiretype end group for non-group")
  614. }
  615. if fieldNum <= 0 {
  616. return fmt.Errorf("proto: LogGroup: illegal tag %d (wire type %d)", fieldNum, wire)
  617. }
  618. switch fieldNum {
  619. case 1:
  620. if wireType != 2 {
  621. return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType)
  622. }
  623. var msglen int
  624. for shift := uint(0); ; shift += 7 {
  625. if shift >= 64 {
  626. return ErrIntOverflowLog
  627. }
  628. if iNdEx >= l {
  629. return io.ErrUnexpectedEOF
  630. }
  631. b := data[iNdEx]
  632. iNdEx++
  633. msglen |= (int(b) & 0x7F) << shift
  634. if b < 0x80 {
  635. break
  636. }
  637. }
  638. if msglen < 0 {
  639. return ErrInvalidLengthLog
  640. }
  641. postIndex := iNdEx + msglen
  642. if postIndex > l {
  643. return io.ErrUnexpectedEOF
  644. }
  645. m.Logs = append(m.Logs, &Log{})
  646. if err := m.Logs[len(m.Logs)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  647. return err
  648. }
  649. iNdEx = postIndex
  650. case 2:
  651. if wireType != 2 {
  652. return fmt.Errorf("proto: wrong wireType = %d for field Reserved", wireType)
  653. }
  654. var stringLen uint64
  655. for shift := uint(0); ; shift += 7 {
  656. if shift >= 64 {
  657. return ErrIntOverflowLog
  658. }
  659. if iNdEx >= l {
  660. return io.ErrUnexpectedEOF
  661. }
  662. b := data[iNdEx]
  663. iNdEx++
  664. stringLen |= (uint64(b) & 0x7F) << shift
  665. if b < 0x80 {
  666. break
  667. }
  668. }
  669. intStringLen := int(stringLen)
  670. if intStringLen < 0 {
  671. return ErrInvalidLengthLog
  672. }
  673. postIndex := iNdEx + intStringLen
  674. if postIndex > l {
  675. return io.ErrUnexpectedEOF
  676. }
  677. s := string(data[iNdEx:postIndex])
  678. m.Reserved = &s
  679. iNdEx = postIndex
  680. case 3:
  681. if wireType != 2 {
  682. return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType)
  683. }
  684. var stringLen uint64
  685. for shift := uint(0); ; shift += 7 {
  686. if shift >= 64 {
  687. return ErrIntOverflowLog
  688. }
  689. if iNdEx >= l {
  690. return io.ErrUnexpectedEOF
  691. }
  692. b := data[iNdEx]
  693. iNdEx++
  694. stringLen |= (uint64(b) & 0x7F) << shift
  695. if b < 0x80 {
  696. break
  697. }
  698. }
  699. intStringLen := int(stringLen)
  700. if intStringLen < 0 {
  701. return ErrInvalidLengthLog
  702. }
  703. postIndex := iNdEx + intStringLen
  704. if postIndex > l {
  705. return io.ErrUnexpectedEOF
  706. }
  707. s := string(data[iNdEx:postIndex])
  708. m.Topic = &s
  709. iNdEx = postIndex
  710. case 4:
  711. if wireType != 2 {
  712. return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType)
  713. }
  714. var stringLen uint64
  715. for shift := uint(0); ; shift += 7 {
  716. if shift >= 64 {
  717. return ErrIntOverflowLog
  718. }
  719. if iNdEx >= l {
  720. return io.ErrUnexpectedEOF
  721. }
  722. b := data[iNdEx]
  723. iNdEx++
  724. stringLen |= (uint64(b) & 0x7F) << shift
  725. if b < 0x80 {
  726. break
  727. }
  728. }
  729. intStringLen := int(stringLen)
  730. if intStringLen < 0 {
  731. return ErrInvalidLengthLog
  732. }
  733. postIndex := iNdEx + intStringLen
  734. if postIndex > l {
  735. return io.ErrUnexpectedEOF
  736. }
  737. s := string(data[iNdEx:postIndex])
  738. m.Source = &s
  739. iNdEx = postIndex
  740. default:
  741. iNdEx = preIndex
  742. skippy, err := skipLog(data[iNdEx:])
  743. if err != nil {
  744. return err
  745. }
  746. if skippy < 0 {
  747. return ErrInvalidLengthLog
  748. }
  749. if (iNdEx + skippy) > l {
  750. return io.ErrUnexpectedEOF
  751. }
  752. m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
  753. iNdEx += skippy
  754. }
  755. }
  756. if iNdEx > l {
  757. return io.ErrUnexpectedEOF
  758. }
  759. return nil
  760. }
  761. func (m *LogGroupList) Unmarshal(data []byte) error {
  762. l := len(data)
  763. iNdEx := 0
  764. for iNdEx < l {
  765. preIndex := iNdEx
  766. var wire uint64
  767. for shift := uint(0); ; shift += 7 {
  768. if shift >= 64 {
  769. return ErrIntOverflowLog
  770. }
  771. if iNdEx >= l {
  772. return io.ErrUnexpectedEOF
  773. }
  774. b := data[iNdEx]
  775. iNdEx++
  776. wire |= (uint64(b) & 0x7F) << shift
  777. if b < 0x80 {
  778. break
  779. }
  780. }
  781. fieldNum := int32(wire >> 3)
  782. wireType := int(wire & 0x7)
  783. if wireType == 4 {
  784. return fmt.Errorf("proto: LogGroupList: wiretype end group for non-group")
  785. }
  786. if fieldNum <= 0 {
  787. return fmt.Errorf("proto: LogGroupList: illegal tag %d (wire type %d)", fieldNum, wire)
  788. }
  789. switch fieldNum {
  790. case 1:
  791. if wireType != 2 {
  792. return fmt.Errorf("proto: wrong wireType = %d for field LogGroups", wireType)
  793. }
  794. var msglen int
  795. for shift := uint(0); ; shift += 7 {
  796. if shift >= 64 {
  797. return ErrIntOverflowLog
  798. }
  799. if iNdEx >= l {
  800. return io.ErrUnexpectedEOF
  801. }
  802. b := data[iNdEx]
  803. iNdEx++
  804. msglen |= (int(b) & 0x7F) << shift
  805. if b < 0x80 {
  806. break
  807. }
  808. }
  809. if msglen < 0 {
  810. return ErrInvalidLengthLog
  811. }
  812. postIndex := iNdEx + msglen
  813. if postIndex > l {
  814. return io.ErrUnexpectedEOF
  815. }
  816. m.LogGroups = append(m.LogGroups, &LogGroup{})
  817. if err := m.LogGroups[len(m.LogGroups)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  818. return err
  819. }
  820. iNdEx = postIndex
  821. default:
  822. iNdEx = preIndex
  823. skippy, err := skipLog(data[iNdEx:])
  824. if err != nil {
  825. return err
  826. }
  827. if skippy < 0 {
  828. return ErrInvalidLengthLog
  829. }
  830. if (iNdEx + skippy) > l {
  831. return io.ErrUnexpectedEOF
  832. }
  833. m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
  834. iNdEx += skippy
  835. }
  836. }
  837. if iNdEx > l {
  838. return io.ErrUnexpectedEOF
  839. }
  840. return nil
  841. }
  842. func skipLog(data []byte) (n int, err error) {
  843. l := len(data)
  844. iNdEx := 0
  845. for iNdEx < l {
  846. var wire uint64
  847. for shift := uint(0); ; shift += 7 {
  848. if shift >= 64 {
  849. return 0, ErrIntOverflowLog
  850. }
  851. if iNdEx >= l {
  852. return 0, io.ErrUnexpectedEOF
  853. }
  854. b := data[iNdEx]
  855. iNdEx++
  856. wire |= (uint64(b) & 0x7F) << shift
  857. if b < 0x80 {
  858. break
  859. }
  860. }
  861. wireType := int(wire & 0x7)
  862. switch wireType {
  863. case 0:
  864. for shift := uint(0); ; shift += 7 {
  865. if shift >= 64 {
  866. return 0, ErrIntOverflowLog
  867. }
  868. if iNdEx >= l {
  869. return 0, io.ErrUnexpectedEOF
  870. }
  871. iNdEx++
  872. if data[iNdEx-1] < 0x80 {
  873. break
  874. }
  875. }
  876. return iNdEx, nil
  877. case 1:
  878. iNdEx += 8
  879. return iNdEx, nil
  880. case 2:
  881. var length int
  882. for shift := uint(0); ; shift += 7 {
  883. if shift >= 64 {
  884. return 0, ErrIntOverflowLog
  885. }
  886. if iNdEx >= l {
  887. return 0, io.ErrUnexpectedEOF
  888. }
  889. b := data[iNdEx]
  890. iNdEx++
  891. length |= (int(b) & 0x7F) << shift
  892. if b < 0x80 {
  893. break
  894. }
  895. }
  896. iNdEx += length
  897. if length < 0 {
  898. return 0, ErrInvalidLengthLog
  899. }
  900. return iNdEx, nil
  901. case 3:
  902. for {
  903. var innerWire uint64
  904. var start int = iNdEx
  905. for shift := uint(0); ; shift += 7 {
  906. if shift >= 64 {
  907. return 0, ErrIntOverflowLog
  908. }
  909. if iNdEx >= l {
  910. return 0, io.ErrUnexpectedEOF
  911. }
  912. b := data[iNdEx]
  913. iNdEx++
  914. innerWire |= (uint64(b) & 0x7F) << shift
  915. if b < 0x80 {
  916. break
  917. }
  918. }
  919. innerWireType := int(innerWire & 0x7)
  920. if innerWireType == 4 {
  921. break
  922. }
  923. next, err := skipLog(data[start:])
  924. if err != nil {
  925. return 0, err
  926. }
  927. iNdEx = start + next
  928. }
  929. return iNdEx, nil
  930. case 4:
  931. return iNdEx, nil
  932. case 5:
  933. iNdEx += 4
  934. return iNdEx, nil
  935. default:
  936. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  937. }
  938. }
  939. panic("unreachable")
  940. }
  941. var (
  942. ErrInvalidLengthLog = fmt.Errorf("proto: negative length found during unmarshaling")
  943. ErrIntOverflowLog = fmt.Errorf("proto: integer overflow")
  944. )