etcdserver.pb.go 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  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. It has these top-level messages:
  9. Request
  10. Metadata
  11. */
  12. package etcdserverpb
  13. import proto "github.com/coreos/etcd/Godeps/_workspace/src/code.google.com/p/gogoprotobuf/proto"
  14. import json "encoding/json"
  15. import math "math"
  16. // discarding unused import gogoproto "code.google.com/p/gogoprotobuf/gogoproto/gogo.pb"
  17. import io "io"
  18. import code_google_com_p_gogoprotobuf_proto "github.com/coreos/etcd/Godeps/_workspace/src/code.google.com/p/gogoprotobuf/proto"
  19. // Reference proto, json, and math imports to suppress error if they are not otherwise used.
  20. var _ = proto.Marshal
  21. var _ = &json.SyntaxError{}
  22. var _ = math.Inf
  23. type Request struct {
  24. ID uint64 `protobuf:"varint,1,req" json:"ID"`
  25. Method string `protobuf:"bytes,2,req" json:"Method"`
  26. Path string `protobuf:"bytes,3,req" json:"Path"`
  27. Val string `protobuf:"bytes,4,req" json:"Val"`
  28. Dir bool `protobuf:"varint,5,req" json:"Dir"`
  29. PrevValue string `protobuf:"bytes,6,req" json:"PrevValue"`
  30. PrevIndex uint64 `protobuf:"varint,7,req" json:"PrevIndex"`
  31. PrevExist *bool `protobuf:"varint,8,req" json:"PrevExist,omitempty"`
  32. Expiration int64 `protobuf:"varint,9,req" json:"Expiration"`
  33. Wait bool `protobuf:"varint,10,req" json:"Wait"`
  34. Since uint64 `protobuf:"varint,11,req" json:"Since"`
  35. Recursive bool `protobuf:"varint,12,req" json:"Recursive"`
  36. Sorted bool `protobuf:"varint,13,req" json:"Sorted"`
  37. Quorum bool `protobuf:"varint,14,req" json:"Quorum"`
  38. Time int64 `protobuf:"varint,15,req" json:"Time"`
  39. Stream bool `protobuf:"varint,16,req" json:"Stream"`
  40. XXX_unrecognized []byte `json:"-"`
  41. }
  42. func (m *Request) Reset() { *m = Request{} }
  43. func (m *Request) String() string { return proto.CompactTextString(m) }
  44. func (*Request) ProtoMessage() {}
  45. type Metadata struct {
  46. NodeID uint64 `protobuf:"varint,1,req" json:"NodeID"`
  47. ClusterID uint64 `protobuf:"varint,2,req" json:"ClusterID"`
  48. XXX_unrecognized []byte `json:"-"`
  49. }
  50. func (m *Metadata) Reset() { *m = Metadata{} }
  51. func (m *Metadata) String() string { return proto.CompactTextString(m) }
  52. func (*Metadata) ProtoMessage() {}
  53. func init() {
  54. }
  55. func (m *Request) Unmarshal(data []byte) error {
  56. l := len(data)
  57. index := 0
  58. for index < l {
  59. var wire uint64
  60. for shift := uint(0); ; shift += 7 {
  61. if index >= l {
  62. return io.ErrUnexpectedEOF
  63. }
  64. b := data[index]
  65. index++
  66. wire |= (uint64(b) & 0x7F) << shift
  67. if b < 0x80 {
  68. break
  69. }
  70. }
  71. fieldNum := int32(wire >> 3)
  72. wireType := int(wire & 0x7)
  73. switch fieldNum {
  74. case 1:
  75. if wireType != 0 {
  76. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  77. }
  78. for shift := uint(0); ; shift += 7 {
  79. if index >= l {
  80. return io.ErrUnexpectedEOF
  81. }
  82. b := data[index]
  83. index++
  84. m.ID |= (uint64(b) & 0x7F) << shift
  85. if b < 0x80 {
  86. break
  87. }
  88. }
  89. case 2:
  90. if wireType != 2 {
  91. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  92. }
  93. var stringLen uint64
  94. for shift := uint(0); ; shift += 7 {
  95. if index >= l {
  96. return io.ErrUnexpectedEOF
  97. }
  98. b := data[index]
  99. index++
  100. stringLen |= (uint64(b) & 0x7F) << shift
  101. if b < 0x80 {
  102. break
  103. }
  104. }
  105. postIndex := index + int(stringLen)
  106. if postIndex > l {
  107. return io.ErrUnexpectedEOF
  108. }
  109. m.Method = string(data[index:postIndex])
  110. index = postIndex
  111. case 3:
  112. if wireType != 2 {
  113. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  114. }
  115. var stringLen uint64
  116. for shift := uint(0); ; shift += 7 {
  117. if index >= l {
  118. return io.ErrUnexpectedEOF
  119. }
  120. b := data[index]
  121. index++
  122. stringLen |= (uint64(b) & 0x7F) << shift
  123. if b < 0x80 {
  124. break
  125. }
  126. }
  127. postIndex := index + int(stringLen)
  128. if postIndex > l {
  129. return io.ErrUnexpectedEOF
  130. }
  131. m.Path = string(data[index:postIndex])
  132. index = postIndex
  133. case 4:
  134. if wireType != 2 {
  135. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  136. }
  137. var stringLen uint64
  138. for shift := uint(0); ; shift += 7 {
  139. if index >= l {
  140. return io.ErrUnexpectedEOF
  141. }
  142. b := data[index]
  143. index++
  144. stringLen |= (uint64(b) & 0x7F) << shift
  145. if b < 0x80 {
  146. break
  147. }
  148. }
  149. postIndex := index + int(stringLen)
  150. if postIndex > l {
  151. return io.ErrUnexpectedEOF
  152. }
  153. m.Val = string(data[index:postIndex])
  154. index = postIndex
  155. case 5:
  156. if wireType != 0 {
  157. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  158. }
  159. var v int
  160. for shift := uint(0); ; shift += 7 {
  161. if index >= l {
  162. return io.ErrUnexpectedEOF
  163. }
  164. b := data[index]
  165. index++
  166. v |= (int(b) & 0x7F) << shift
  167. if b < 0x80 {
  168. break
  169. }
  170. }
  171. m.Dir = bool(v != 0)
  172. case 6:
  173. if wireType != 2 {
  174. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  175. }
  176. var stringLen uint64
  177. for shift := uint(0); ; shift += 7 {
  178. if index >= l {
  179. return io.ErrUnexpectedEOF
  180. }
  181. b := data[index]
  182. index++
  183. stringLen |= (uint64(b) & 0x7F) << shift
  184. if b < 0x80 {
  185. break
  186. }
  187. }
  188. postIndex := index + int(stringLen)
  189. if postIndex > l {
  190. return io.ErrUnexpectedEOF
  191. }
  192. m.PrevValue = string(data[index:postIndex])
  193. index = postIndex
  194. case 7:
  195. if wireType != 0 {
  196. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  197. }
  198. for shift := uint(0); ; shift += 7 {
  199. if index >= l {
  200. return io.ErrUnexpectedEOF
  201. }
  202. b := data[index]
  203. index++
  204. m.PrevIndex |= (uint64(b) & 0x7F) << shift
  205. if b < 0x80 {
  206. break
  207. }
  208. }
  209. case 8:
  210. if wireType != 0 {
  211. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  212. }
  213. var v int
  214. for shift := uint(0); ; shift += 7 {
  215. if index >= l {
  216. return io.ErrUnexpectedEOF
  217. }
  218. b := data[index]
  219. index++
  220. v |= (int(b) & 0x7F) << shift
  221. if b < 0x80 {
  222. break
  223. }
  224. }
  225. b := bool(v != 0)
  226. m.PrevExist = &b
  227. case 9:
  228. if wireType != 0 {
  229. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  230. }
  231. for shift := uint(0); ; shift += 7 {
  232. if index >= l {
  233. return io.ErrUnexpectedEOF
  234. }
  235. b := data[index]
  236. index++
  237. m.Expiration |= (int64(b) & 0x7F) << shift
  238. if b < 0x80 {
  239. break
  240. }
  241. }
  242. case 10:
  243. if wireType != 0 {
  244. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  245. }
  246. var v int
  247. for shift := uint(0); ; shift += 7 {
  248. if index >= l {
  249. return io.ErrUnexpectedEOF
  250. }
  251. b := data[index]
  252. index++
  253. v |= (int(b) & 0x7F) << shift
  254. if b < 0x80 {
  255. break
  256. }
  257. }
  258. m.Wait = bool(v != 0)
  259. case 11:
  260. if wireType != 0 {
  261. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  262. }
  263. for shift := uint(0); ; shift += 7 {
  264. if index >= l {
  265. return io.ErrUnexpectedEOF
  266. }
  267. b := data[index]
  268. index++
  269. m.Since |= (uint64(b) & 0x7F) << shift
  270. if b < 0x80 {
  271. break
  272. }
  273. }
  274. case 12:
  275. if wireType != 0 {
  276. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  277. }
  278. var v int
  279. for shift := uint(0); ; shift += 7 {
  280. if index >= l {
  281. return io.ErrUnexpectedEOF
  282. }
  283. b := data[index]
  284. index++
  285. v |= (int(b) & 0x7F) << shift
  286. if b < 0x80 {
  287. break
  288. }
  289. }
  290. m.Recursive = bool(v != 0)
  291. case 13:
  292. if wireType != 0 {
  293. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  294. }
  295. var v int
  296. for shift := uint(0); ; shift += 7 {
  297. if index >= l {
  298. return io.ErrUnexpectedEOF
  299. }
  300. b := data[index]
  301. index++
  302. v |= (int(b) & 0x7F) << shift
  303. if b < 0x80 {
  304. break
  305. }
  306. }
  307. m.Sorted = bool(v != 0)
  308. case 14:
  309. if wireType != 0 {
  310. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  311. }
  312. var v int
  313. for shift := uint(0); ; shift += 7 {
  314. if index >= l {
  315. return io.ErrUnexpectedEOF
  316. }
  317. b := data[index]
  318. index++
  319. v |= (int(b) & 0x7F) << shift
  320. if b < 0x80 {
  321. break
  322. }
  323. }
  324. m.Quorum = bool(v != 0)
  325. case 15:
  326. if wireType != 0 {
  327. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  328. }
  329. for shift := uint(0); ; shift += 7 {
  330. if index >= l {
  331. return io.ErrUnexpectedEOF
  332. }
  333. b := data[index]
  334. index++
  335. m.Time |= (int64(b) & 0x7F) << shift
  336. if b < 0x80 {
  337. break
  338. }
  339. }
  340. case 16:
  341. if wireType != 0 {
  342. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  343. }
  344. var v int
  345. for shift := uint(0); ; shift += 7 {
  346. if index >= l {
  347. return io.ErrUnexpectedEOF
  348. }
  349. b := data[index]
  350. index++
  351. v |= (int(b) & 0x7F) << shift
  352. if b < 0x80 {
  353. break
  354. }
  355. }
  356. m.Stream = bool(v != 0)
  357. default:
  358. var sizeOfWire int
  359. for {
  360. sizeOfWire++
  361. wire >>= 7
  362. if wire == 0 {
  363. break
  364. }
  365. }
  366. index -= sizeOfWire
  367. skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:])
  368. if err != nil {
  369. return err
  370. }
  371. if (index + skippy) > l {
  372. return io.ErrUnexpectedEOF
  373. }
  374. m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
  375. index += skippy
  376. }
  377. }
  378. return nil
  379. }
  380. func (m *Metadata) Unmarshal(data []byte) error {
  381. l := len(data)
  382. index := 0
  383. for index < l {
  384. var wire uint64
  385. for shift := uint(0); ; shift += 7 {
  386. if index >= l {
  387. return io.ErrUnexpectedEOF
  388. }
  389. b := data[index]
  390. index++
  391. wire |= (uint64(b) & 0x7F) << shift
  392. if b < 0x80 {
  393. break
  394. }
  395. }
  396. fieldNum := int32(wire >> 3)
  397. wireType := int(wire & 0x7)
  398. switch fieldNum {
  399. case 1:
  400. if wireType != 0 {
  401. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  402. }
  403. for shift := uint(0); ; shift += 7 {
  404. if index >= l {
  405. return io.ErrUnexpectedEOF
  406. }
  407. b := data[index]
  408. index++
  409. m.NodeID |= (uint64(b) & 0x7F) << shift
  410. if b < 0x80 {
  411. break
  412. }
  413. }
  414. case 2:
  415. if wireType != 0 {
  416. return code_google_com_p_gogoprotobuf_proto.ErrWrongType
  417. }
  418. for shift := uint(0); ; shift += 7 {
  419. if index >= l {
  420. return io.ErrUnexpectedEOF
  421. }
  422. b := data[index]
  423. index++
  424. m.ClusterID |= (uint64(b) & 0x7F) << shift
  425. if b < 0x80 {
  426. break
  427. }
  428. }
  429. default:
  430. var sizeOfWire int
  431. for {
  432. sizeOfWire++
  433. wire >>= 7
  434. if wire == 0 {
  435. break
  436. }
  437. }
  438. index -= sizeOfWire
  439. skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:])
  440. if err != nil {
  441. return err
  442. }
  443. if (index + skippy) > l {
  444. return io.ErrUnexpectedEOF
  445. }
  446. m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
  447. index += skippy
  448. }
  449. }
  450. return nil
  451. }
  452. func (m *Request) Size() (n int) {
  453. var l int
  454. _ = l
  455. n += 1 + sovEtcdserver(uint64(m.ID))
  456. l = len(m.Method)
  457. n += 1 + l + sovEtcdserver(uint64(l))
  458. l = len(m.Path)
  459. n += 1 + l + sovEtcdserver(uint64(l))
  460. l = len(m.Val)
  461. n += 1 + l + sovEtcdserver(uint64(l))
  462. n += 2
  463. l = len(m.PrevValue)
  464. n += 1 + l + sovEtcdserver(uint64(l))
  465. n += 1 + sovEtcdserver(uint64(m.PrevIndex))
  466. if m.PrevExist != nil {
  467. n += 2
  468. }
  469. n += 1 + sovEtcdserver(uint64(m.Expiration))
  470. n += 2
  471. n += 1 + sovEtcdserver(uint64(m.Since))
  472. n += 2
  473. n += 2
  474. n += 2
  475. n += 1 + sovEtcdserver(uint64(m.Time))
  476. n += 3
  477. if m.XXX_unrecognized != nil {
  478. n += len(m.XXX_unrecognized)
  479. }
  480. return n
  481. }
  482. func (m *Metadata) Size() (n int) {
  483. var l int
  484. _ = l
  485. n += 1 + sovEtcdserver(uint64(m.NodeID))
  486. n += 1 + sovEtcdserver(uint64(m.ClusterID))
  487. if m.XXX_unrecognized != nil {
  488. n += len(m.XXX_unrecognized)
  489. }
  490. return n
  491. }
  492. func sovEtcdserver(x uint64) (n int) {
  493. for {
  494. n++
  495. x >>= 7
  496. if x == 0 {
  497. break
  498. }
  499. }
  500. return n
  501. }
  502. func sozEtcdserver(x uint64) (n int) {
  503. return sovEtcdserver(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  504. }
  505. func (m *Request) Marshal() (data []byte, err error) {
  506. size := m.Size()
  507. data = make([]byte, size)
  508. n, err := m.MarshalTo(data)
  509. if err != nil {
  510. return nil, err
  511. }
  512. return data[:n], nil
  513. }
  514. func (m *Request) MarshalTo(data []byte) (n int, err error) {
  515. var i int
  516. _ = i
  517. var l int
  518. _ = l
  519. data[i] = 0x8
  520. i++
  521. i = encodeVarintEtcdserver(data, i, uint64(m.ID))
  522. data[i] = 0x12
  523. i++
  524. i = encodeVarintEtcdserver(data, i, uint64(len(m.Method)))
  525. i += copy(data[i:], m.Method)
  526. data[i] = 0x1a
  527. i++
  528. i = encodeVarintEtcdserver(data, i, uint64(len(m.Path)))
  529. i += copy(data[i:], m.Path)
  530. data[i] = 0x22
  531. i++
  532. i = encodeVarintEtcdserver(data, i, uint64(len(m.Val)))
  533. i += copy(data[i:], m.Val)
  534. data[i] = 0x28
  535. i++
  536. if m.Dir {
  537. data[i] = 1
  538. } else {
  539. data[i] = 0
  540. }
  541. i++
  542. data[i] = 0x32
  543. i++
  544. i = encodeVarintEtcdserver(data, i, uint64(len(m.PrevValue)))
  545. i += copy(data[i:], m.PrevValue)
  546. data[i] = 0x38
  547. i++
  548. i = encodeVarintEtcdserver(data, i, uint64(m.PrevIndex))
  549. if m.PrevExist != nil {
  550. data[i] = 0x40
  551. i++
  552. if *m.PrevExist {
  553. data[i] = 1
  554. } else {
  555. data[i] = 0
  556. }
  557. i++
  558. }
  559. data[i] = 0x48
  560. i++
  561. i = encodeVarintEtcdserver(data, i, uint64(m.Expiration))
  562. data[i] = 0x50
  563. i++
  564. if m.Wait {
  565. data[i] = 1
  566. } else {
  567. data[i] = 0
  568. }
  569. i++
  570. data[i] = 0x58
  571. i++
  572. i = encodeVarintEtcdserver(data, i, uint64(m.Since))
  573. data[i] = 0x60
  574. i++
  575. if m.Recursive {
  576. data[i] = 1
  577. } else {
  578. data[i] = 0
  579. }
  580. i++
  581. data[i] = 0x68
  582. i++
  583. if m.Sorted {
  584. data[i] = 1
  585. } else {
  586. data[i] = 0
  587. }
  588. i++
  589. data[i] = 0x70
  590. i++
  591. if m.Quorum {
  592. data[i] = 1
  593. } else {
  594. data[i] = 0
  595. }
  596. i++
  597. data[i] = 0x78
  598. i++
  599. i = encodeVarintEtcdserver(data, i, uint64(m.Time))
  600. data[i] = 0x80
  601. i++
  602. data[i] = 0x1
  603. i++
  604. if m.Stream {
  605. data[i] = 1
  606. } else {
  607. data[i] = 0
  608. }
  609. i++
  610. if m.XXX_unrecognized != nil {
  611. i += copy(data[i:], m.XXX_unrecognized)
  612. }
  613. return i, nil
  614. }
  615. func (m *Metadata) Marshal() (data []byte, err error) {
  616. size := m.Size()
  617. data = make([]byte, size)
  618. n, err := m.MarshalTo(data)
  619. if err != nil {
  620. return nil, err
  621. }
  622. return data[:n], nil
  623. }
  624. func (m *Metadata) MarshalTo(data []byte) (n int, err error) {
  625. var i int
  626. _ = i
  627. var l int
  628. _ = l
  629. data[i] = 0x8
  630. i++
  631. i = encodeVarintEtcdserver(data, i, uint64(m.NodeID))
  632. data[i] = 0x10
  633. i++
  634. i = encodeVarintEtcdserver(data, i, uint64(m.ClusterID))
  635. if m.XXX_unrecognized != nil {
  636. i += copy(data[i:], m.XXX_unrecognized)
  637. }
  638. return i, nil
  639. }
  640. func encodeFixed64Etcdserver(data []byte, offset int, v uint64) int {
  641. data[offset] = uint8(v)
  642. data[offset+1] = uint8(v >> 8)
  643. data[offset+2] = uint8(v >> 16)
  644. data[offset+3] = uint8(v >> 24)
  645. data[offset+4] = uint8(v >> 32)
  646. data[offset+5] = uint8(v >> 40)
  647. data[offset+6] = uint8(v >> 48)
  648. data[offset+7] = uint8(v >> 56)
  649. return offset + 8
  650. }
  651. func encodeFixed32Etcdserver(data []byte, offset int, v uint32) int {
  652. data[offset] = uint8(v)
  653. data[offset+1] = uint8(v >> 8)
  654. data[offset+2] = uint8(v >> 16)
  655. data[offset+3] = uint8(v >> 24)
  656. return offset + 4
  657. }
  658. func encodeVarintEtcdserver(data []byte, offset int, v uint64) int {
  659. for v >= 1<<7 {
  660. data[offset] = uint8(v&0x7f | 0x80)
  661. v >>= 7
  662. offset++
  663. }
  664. data[offset] = uint8(v)
  665. return offset + 1
  666. }