etcdserver.pb.go 21 KB

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