snapshot_request.pb.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. // Code generated by protoc-gen-gogo.
  2. // source: snapshot_request.proto
  3. // DO NOT EDIT!
  4. package protobuf
  5. import proto "github.com/coreos/etcd/third_party/code.google.com/p/gogoprotobuf/proto"
  6. import json "encoding/json"
  7. import math "math"
  8. // discarding unused import gogoproto "code.google.com/p/gogoprotobuf/gogoproto/gogo.pb"
  9. import io7 "io"
  10. import code_google_com_p_gogoprotobuf_proto14 "github.com/coreos/etcd/third_party/code.google.com/p/gogoprotobuf/proto"
  11. import fmt21 "fmt"
  12. import strings14 "strings"
  13. import reflect14 "reflect"
  14. import fmt22 "fmt"
  15. import strings15 "strings"
  16. import code_google_com_p_gogoprotobuf_proto15 "github.com/coreos/etcd/third_party/code.google.com/p/gogoprotobuf/proto"
  17. import sort7 "sort"
  18. import strconv7 "strconv"
  19. import reflect15 "reflect"
  20. import fmt23 "fmt"
  21. import bytes7 "bytes"
  22. // Reference proto, json, and math imports to suppress error if they are not otherwise used.
  23. var _ = proto.Marshal
  24. var _ = &json.SyntaxError{}
  25. var _ = math.Inf
  26. type SnapshotRequest struct {
  27. LeaderName *string `protobuf:"bytes,1,req" json:"LeaderName,omitempty"`
  28. LastIndex *uint64 `protobuf:"varint,2,req" json:"LastIndex,omitempty"`
  29. LastTerm *uint64 `protobuf:"varint,3,req" json:"LastTerm,omitempty"`
  30. XXX_unrecognized []byte `json:"-"`
  31. }
  32. func (m *SnapshotRequest) Reset() { *m = SnapshotRequest{} }
  33. func (*SnapshotRequest) ProtoMessage() {}
  34. func (m *SnapshotRequest) GetLeaderName() string {
  35. if m != nil && m.LeaderName != nil {
  36. return *m.LeaderName
  37. }
  38. return ""
  39. }
  40. func (m *SnapshotRequest) GetLastIndex() uint64 {
  41. if m != nil && m.LastIndex != nil {
  42. return *m.LastIndex
  43. }
  44. return 0
  45. }
  46. func (m *SnapshotRequest) GetLastTerm() uint64 {
  47. if m != nil && m.LastTerm != nil {
  48. return *m.LastTerm
  49. }
  50. return 0
  51. }
  52. func init() {
  53. }
  54. func (m *SnapshotRequest) Unmarshal(data []byte) error {
  55. l := len(data)
  56. index := 0
  57. for index < l {
  58. var wire uint64
  59. for shift := uint(0); ; shift += 7 {
  60. if index >= l {
  61. return io7.ErrUnexpectedEOF
  62. }
  63. b := data[index]
  64. index++
  65. wire |= (uint64(b) & 0x7F) << shift
  66. if b < 0x80 {
  67. break
  68. }
  69. }
  70. fieldNum := int32(wire >> 3)
  71. wireType := int(wire & 0x7)
  72. switch fieldNum {
  73. case 1:
  74. if wireType != 2 {
  75. return code_google_com_p_gogoprotobuf_proto14.ErrWrongType
  76. }
  77. var stringLen uint64
  78. for shift := uint(0); ; shift += 7 {
  79. if index >= l {
  80. return io7.ErrUnexpectedEOF
  81. }
  82. b := data[index]
  83. index++
  84. stringLen |= (uint64(b) & 0x7F) << shift
  85. if b < 0x80 {
  86. break
  87. }
  88. }
  89. postIndex := index + int(stringLen)
  90. if postIndex > l {
  91. return io7.ErrUnexpectedEOF
  92. }
  93. s := string(data[index:postIndex])
  94. m.LeaderName = &s
  95. index = postIndex
  96. case 2:
  97. if wireType != 0 {
  98. return code_google_com_p_gogoprotobuf_proto14.ErrWrongType
  99. }
  100. var v uint64
  101. for shift := uint(0); ; shift += 7 {
  102. if index >= l {
  103. return io7.ErrUnexpectedEOF
  104. }
  105. b := data[index]
  106. index++
  107. v |= (uint64(b) & 0x7F) << shift
  108. if b < 0x80 {
  109. break
  110. }
  111. }
  112. m.LastIndex = &v
  113. case 3:
  114. if wireType != 0 {
  115. return code_google_com_p_gogoprotobuf_proto14.ErrWrongType
  116. }
  117. var v uint64
  118. for shift := uint(0); ; shift += 7 {
  119. if index >= l {
  120. return io7.ErrUnexpectedEOF
  121. }
  122. b := data[index]
  123. index++
  124. v |= (uint64(b) & 0x7F) << shift
  125. if b < 0x80 {
  126. break
  127. }
  128. }
  129. m.LastTerm = &v
  130. default:
  131. var sizeOfWire int
  132. for {
  133. sizeOfWire++
  134. wire >>= 7
  135. if wire == 0 {
  136. break
  137. }
  138. }
  139. index -= sizeOfWire
  140. skippy, err := code_google_com_p_gogoprotobuf_proto14.Skip(data[index:])
  141. if err != nil {
  142. return err
  143. }
  144. if (index + skippy) > l {
  145. return io7.ErrUnexpectedEOF
  146. }
  147. m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
  148. index += skippy
  149. }
  150. }
  151. return nil
  152. }
  153. func (this *SnapshotRequest) String() string {
  154. if this == nil {
  155. return "nil"
  156. }
  157. s := strings14.Join([]string{`&SnapshotRequest{`,
  158. `LeaderName:` + valueToStringSnapshotRequest(this.LeaderName) + `,`,
  159. `LastIndex:` + valueToStringSnapshotRequest(this.LastIndex) + `,`,
  160. `LastTerm:` + valueToStringSnapshotRequest(this.LastTerm) + `,`,
  161. `XXX_unrecognized:` + fmt21.Sprintf("%v", this.XXX_unrecognized) + `,`,
  162. `}`,
  163. }, "")
  164. return s
  165. }
  166. func valueToStringSnapshotRequest(v interface{}) string {
  167. rv := reflect14.ValueOf(v)
  168. if rv.IsNil() {
  169. return "nil"
  170. }
  171. pv := reflect14.Indirect(rv).Interface()
  172. return fmt21.Sprintf("*%v", pv)
  173. }
  174. func (m *SnapshotRequest) Size() (n int) {
  175. var l int
  176. _ = l
  177. if m.LeaderName != nil {
  178. l = len(*m.LeaderName)
  179. n += 1 + l + sovSnapshotRequest(uint64(l))
  180. }
  181. if m.LastIndex != nil {
  182. n += 1 + sovSnapshotRequest(uint64(*m.LastIndex))
  183. }
  184. if m.LastTerm != nil {
  185. n += 1 + sovSnapshotRequest(uint64(*m.LastTerm))
  186. }
  187. if m.XXX_unrecognized != nil {
  188. n += len(m.XXX_unrecognized)
  189. }
  190. return n
  191. }
  192. func sovSnapshotRequest(x uint64) (n int) {
  193. for {
  194. n++
  195. x >>= 7
  196. if x == 0 {
  197. break
  198. }
  199. }
  200. return n
  201. }
  202. func sozSnapshotRequest(x uint64) (n int) {
  203. return sovSnapshotRequest(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  204. }
  205. func NewPopulatedSnapshotRequest(r randySnapshotRequest, easy bool) *SnapshotRequest {
  206. this := &SnapshotRequest{}
  207. v1 := randStringSnapshotRequest(r)
  208. this.LeaderName = &v1
  209. v2 := uint64(r.Uint32())
  210. this.LastIndex = &v2
  211. v3 := uint64(r.Uint32())
  212. this.LastTerm = &v3
  213. if !easy && r.Intn(10) != 0 {
  214. this.XXX_unrecognized = randUnrecognizedSnapshotRequest(r, 4)
  215. }
  216. return this
  217. }
  218. type randySnapshotRequest interface {
  219. Float32() float32
  220. Float64() float64
  221. Int63() int64
  222. Int31() int32
  223. Uint32() uint32
  224. Intn(n int) int
  225. }
  226. func randUTF8RuneSnapshotRequest(r randySnapshotRequest) rune {
  227. res := rune(r.Uint32() % 1112064)
  228. if 55296 <= res {
  229. res += 2047
  230. }
  231. return res
  232. }
  233. func randStringSnapshotRequest(r randySnapshotRequest) string {
  234. v4 := r.Intn(100)
  235. tmps := make([]rune, v4)
  236. for i := 0; i < v4; i++ {
  237. tmps[i] = randUTF8RuneSnapshotRequest(r)
  238. }
  239. return string(tmps)
  240. }
  241. func randUnrecognizedSnapshotRequest(r randySnapshotRequest, maxFieldNumber int) (data []byte) {
  242. l := r.Intn(5)
  243. for i := 0; i < l; i++ {
  244. wire := r.Intn(4)
  245. if wire == 3 {
  246. wire = 5
  247. }
  248. fieldNumber := maxFieldNumber + r.Intn(100)
  249. data = randFieldSnapshotRequest(data, r, fieldNumber, wire)
  250. }
  251. return data
  252. }
  253. func randFieldSnapshotRequest(data []byte, r randySnapshotRequest, fieldNumber int, wire int) []byte {
  254. key := uint32(fieldNumber)<<3 | uint32(wire)
  255. switch wire {
  256. case 0:
  257. data = encodeVarintPopulateSnapshotRequest(data, uint64(key))
  258. data = encodeVarintPopulateSnapshotRequest(data, uint64(r.Int63()))
  259. case 1:
  260. data = encodeVarintPopulateSnapshotRequest(data, uint64(key))
  261. data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  262. case 2:
  263. data = encodeVarintPopulateSnapshotRequest(data, uint64(key))
  264. ll := r.Intn(100)
  265. data = encodeVarintPopulateSnapshotRequest(data, uint64(ll))
  266. for j := 0; j < ll; j++ {
  267. data = append(data, byte(r.Intn(256)))
  268. }
  269. default:
  270. data = encodeVarintPopulateSnapshotRequest(data, uint64(key))
  271. data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  272. }
  273. return data
  274. }
  275. func encodeVarintPopulateSnapshotRequest(data []byte, v uint64) []byte {
  276. for v >= 1<<7 {
  277. data = append(data, uint8(uint64(v)&0x7f|0x80))
  278. v >>= 7
  279. }
  280. data = append(data, uint8(v))
  281. return data
  282. }
  283. func (m *SnapshotRequest) Marshal() (data []byte, err error) {
  284. size := m.Size()
  285. data = make([]byte, size)
  286. n, err := m.MarshalTo(data)
  287. if err != nil {
  288. return nil, err
  289. }
  290. return data[:n], nil
  291. }
  292. func (m *SnapshotRequest) MarshalTo(data []byte) (n int, err error) {
  293. var i int
  294. _ = i
  295. var l int
  296. _ = l
  297. if m.LeaderName != nil {
  298. data[i] = 0xa
  299. i++
  300. i = encodeVarintSnapshotRequest(data, i, uint64(len(*m.LeaderName)))
  301. i += copy(data[i:], *m.LeaderName)
  302. }
  303. if m.LastIndex != nil {
  304. data[i] = 0x10
  305. i++
  306. i = encodeVarintSnapshotRequest(data, i, uint64(*m.LastIndex))
  307. }
  308. if m.LastTerm != nil {
  309. data[i] = 0x18
  310. i++
  311. i = encodeVarintSnapshotRequest(data, i, uint64(*m.LastTerm))
  312. }
  313. if m.XXX_unrecognized != nil {
  314. i += copy(data[i:], m.XXX_unrecognized)
  315. }
  316. return i, nil
  317. }
  318. func encodeFixed64SnapshotRequest(data []byte, offset int, v uint64) int {
  319. data[offset] = uint8(v)
  320. data[offset+1] = uint8(v >> 8)
  321. data[offset+2] = uint8(v >> 16)
  322. data[offset+3] = uint8(v >> 24)
  323. data[offset+4] = uint8(v >> 32)
  324. data[offset+5] = uint8(v >> 40)
  325. data[offset+6] = uint8(v >> 48)
  326. data[offset+7] = uint8(v >> 56)
  327. return offset + 8
  328. }
  329. func encodeFixed32SnapshotRequest(data []byte, offset int, v uint32) int {
  330. data[offset] = uint8(v)
  331. data[offset+1] = uint8(v >> 8)
  332. data[offset+2] = uint8(v >> 16)
  333. data[offset+3] = uint8(v >> 24)
  334. return offset + 4
  335. }
  336. func encodeVarintSnapshotRequest(data []byte, offset int, v uint64) int {
  337. for v >= 1<<7 {
  338. data[offset] = uint8(v&0x7f | 0x80)
  339. v >>= 7
  340. offset++
  341. }
  342. data[offset] = uint8(v)
  343. return offset + 1
  344. }
  345. func (this *SnapshotRequest) GoString() string {
  346. if this == nil {
  347. return "nil"
  348. }
  349. s := strings15.Join([]string{`&protobuf.SnapshotRequest{` + `LeaderName:` + valueToGoStringSnapshotRequest(this.LeaderName, "string"), `LastIndex:` + valueToGoStringSnapshotRequest(this.LastIndex, "uint64"), `LastTerm:` + valueToGoStringSnapshotRequest(this.LastTerm, "uint64"), `XXX_unrecognized:` + fmt22.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ")
  350. return s
  351. }
  352. func valueToGoStringSnapshotRequest(v interface{}, typ string) string {
  353. rv := reflect15.ValueOf(v)
  354. if rv.IsNil() {
  355. return "nil"
  356. }
  357. pv := reflect15.Indirect(rv).Interface()
  358. return fmt22.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
  359. }
  360. func extensionToGoStringSnapshotRequest(e map[int32]code_google_com_p_gogoprotobuf_proto15.Extension) string {
  361. if e == nil {
  362. return "nil"
  363. }
  364. s := "map[int32]proto.Extension{"
  365. keys := make([]int, 0, len(e))
  366. for k := range e {
  367. keys = append(keys, int(k))
  368. }
  369. sort7.Ints(keys)
  370. ss := []string{}
  371. for _, k := range keys {
  372. ss = append(ss, strconv7.Itoa(k)+": "+e[int32(k)].GoString())
  373. }
  374. s += strings15.Join(ss, ",") + "}"
  375. return s
  376. }
  377. func (this *SnapshotRequest) VerboseEqual(that interface{}) error {
  378. if that == nil {
  379. if this == nil {
  380. return nil
  381. }
  382. return fmt23.Errorf("that == nil && this != nil")
  383. }
  384. that1, ok := that.(*SnapshotRequest)
  385. if !ok {
  386. return fmt23.Errorf("that is not of type *SnapshotRequest")
  387. }
  388. if that1 == nil {
  389. if this == nil {
  390. return nil
  391. }
  392. return fmt23.Errorf("that is type *SnapshotRequest but is nil && this != nil")
  393. } else if this == nil {
  394. return fmt23.Errorf("that is type *SnapshotRequestbut is not nil && this == nil")
  395. }
  396. if this.LeaderName != nil && that1.LeaderName != nil {
  397. if *this.LeaderName != *that1.LeaderName {
  398. return fmt23.Errorf("LeaderName this(%v) Not Equal that(%v)", *this.LeaderName, *that1.LeaderName)
  399. }
  400. } else if this.LeaderName != nil {
  401. return fmt23.Errorf("this.LeaderName == nil && that.LeaderName != nil")
  402. } else if that1.LeaderName != nil {
  403. return fmt23.Errorf("LeaderName this(%v) Not Equal that(%v)", this.LeaderName, that1.LeaderName)
  404. }
  405. if this.LastIndex != nil && that1.LastIndex != nil {
  406. if *this.LastIndex != *that1.LastIndex {
  407. return fmt23.Errorf("LastIndex this(%v) Not Equal that(%v)", *this.LastIndex, *that1.LastIndex)
  408. }
  409. } else if this.LastIndex != nil {
  410. return fmt23.Errorf("this.LastIndex == nil && that.LastIndex != nil")
  411. } else if that1.LastIndex != nil {
  412. return fmt23.Errorf("LastIndex this(%v) Not Equal that(%v)", this.LastIndex, that1.LastIndex)
  413. }
  414. if this.LastTerm != nil && that1.LastTerm != nil {
  415. if *this.LastTerm != *that1.LastTerm {
  416. return fmt23.Errorf("LastTerm this(%v) Not Equal that(%v)", *this.LastTerm, *that1.LastTerm)
  417. }
  418. } else if this.LastTerm != nil {
  419. return fmt23.Errorf("this.LastTerm == nil && that.LastTerm != nil")
  420. } else if that1.LastTerm != nil {
  421. return fmt23.Errorf("LastTerm this(%v) Not Equal that(%v)", this.LastTerm, that1.LastTerm)
  422. }
  423. if !bytes7.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  424. return fmt23.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
  425. }
  426. return nil
  427. }
  428. func (this *SnapshotRequest) Equal(that interface{}) bool {
  429. if that == nil {
  430. if this == nil {
  431. return true
  432. }
  433. return false
  434. }
  435. that1, ok := that.(*SnapshotRequest)
  436. if !ok {
  437. return false
  438. }
  439. if that1 == nil {
  440. if this == nil {
  441. return true
  442. }
  443. return false
  444. } else if this == nil {
  445. return false
  446. }
  447. if this.LeaderName != nil && that1.LeaderName != nil {
  448. if *this.LeaderName != *that1.LeaderName {
  449. return false
  450. }
  451. } else if this.LeaderName != nil {
  452. return false
  453. } else if that1.LeaderName != nil {
  454. return false
  455. }
  456. if this.LastIndex != nil && that1.LastIndex != nil {
  457. if *this.LastIndex != *that1.LastIndex {
  458. return false
  459. }
  460. } else if this.LastIndex != nil {
  461. return false
  462. } else if that1.LastIndex != nil {
  463. return false
  464. }
  465. if this.LastTerm != nil && that1.LastTerm != nil {
  466. if *this.LastTerm != *that1.LastTerm {
  467. return false
  468. }
  469. } else if this.LastTerm != nil {
  470. return false
  471. } else if that1.LastTerm != nil {
  472. return false
  473. }
  474. if !bytes7.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  475. return false
  476. }
  477. return true
  478. }