etcdserver.pb.go 21 KB

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