raft.pb.go 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: raft.proto
  3. /*
  4. Package raftpb is a generated protocol buffer package.
  5. It is generated from these files:
  6. raft.proto
  7. It has these top-level messages:
  8. Entry
  9. SnapshotMetadata
  10. Snapshot
  11. Message
  12. HardState
  13. ConfState
  14. ConfChange
  15. */
  16. package raftpb
  17. import (
  18. "fmt"
  19. proto "github.com/golang/protobuf/proto"
  20. math "math"
  21. _ "github.com/gogo/protobuf/gogoproto"
  22. io "io"
  23. )
  24. // Reference imports to suppress errors if they are not otherwise used.
  25. var _ = proto.Marshal
  26. var _ = fmt.Errorf
  27. var _ = math.Inf
  28. // This is a compile-time assertion to ensure that this generated file
  29. // is compatible with the proto package it is being compiled against.
  30. // A compilation error at this line likely means your copy of the
  31. // proto package needs to be updated.
  32. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  33. type EntryType int32
  34. const (
  35. EntryNormal EntryType = 0
  36. EntryConfChange EntryType = 1
  37. )
  38. var EntryType_name = map[int32]string{
  39. 0: "EntryNormal",
  40. 1: "EntryConfChange",
  41. }
  42. var EntryType_value = map[string]int32{
  43. "EntryNormal": 0,
  44. "EntryConfChange": 1,
  45. }
  46. func (x EntryType) Enum() *EntryType {
  47. p := new(EntryType)
  48. *p = x
  49. return p
  50. }
  51. func (x EntryType) String() string {
  52. return proto.EnumName(EntryType_name, int32(x))
  53. }
  54. func (x *EntryType) UnmarshalJSON(data []byte) error {
  55. value, err := proto.UnmarshalJSONEnum(EntryType_value, data, "EntryType")
  56. if err != nil {
  57. return err
  58. }
  59. *x = EntryType(value)
  60. return nil
  61. }
  62. func (EntryType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{0} }
  63. type MessageType int32
  64. const (
  65. MsgHup MessageType = 0
  66. MsgBeat MessageType = 1
  67. MsgProp MessageType = 2
  68. MsgApp MessageType = 3
  69. MsgAppResp MessageType = 4
  70. MsgVote MessageType = 5
  71. MsgVoteResp MessageType = 6
  72. MsgSnap MessageType = 7
  73. MsgHeartbeat MessageType = 8
  74. MsgHeartbeatResp MessageType = 9
  75. MsgUnreachable MessageType = 10
  76. MsgSnapStatus MessageType = 11
  77. MsgCheckQuorum MessageType = 12
  78. MsgTransferLeader MessageType = 13
  79. MsgTimeoutNow MessageType = 14
  80. MsgReadIndex MessageType = 15
  81. MsgReadIndexResp MessageType = 16
  82. MsgPreVote MessageType = 17
  83. MsgPreVoteResp MessageType = 18
  84. )
  85. var MessageType_name = map[int32]string{
  86. 0: "MsgHup",
  87. 1: "MsgBeat",
  88. 2: "MsgProp",
  89. 3: "MsgApp",
  90. 4: "MsgAppResp",
  91. 5: "MsgVote",
  92. 6: "MsgVoteResp",
  93. 7: "MsgSnap",
  94. 8: "MsgHeartbeat",
  95. 9: "MsgHeartbeatResp",
  96. 10: "MsgUnreachable",
  97. 11: "MsgSnapStatus",
  98. 12: "MsgCheckQuorum",
  99. 13: "MsgTransferLeader",
  100. 14: "MsgTimeoutNow",
  101. 15: "MsgReadIndex",
  102. 16: "MsgReadIndexResp",
  103. 17: "MsgPreVote",
  104. 18: "MsgPreVoteResp",
  105. }
  106. var MessageType_value = map[string]int32{
  107. "MsgHup": 0,
  108. "MsgBeat": 1,
  109. "MsgProp": 2,
  110. "MsgApp": 3,
  111. "MsgAppResp": 4,
  112. "MsgVote": 5,
  113. "MsgVoteResp": 6,
  114. "MsgSnap": 7,
  115. "MsgHeartbeat": 8,
  116. "MsgHeartbeatResp": 9,
  117. "MsgUnreachable": 10,
  118. "MsgSnapStatus": 11,
  119. "MsgCheckQuorum": 12,
  120. "MsgTransferLeader": 13,
  121. "MsgTimeoutNow": 14,
  122. "MsgReadIndex": 15,
  123. "MsgReadIndexResp": 16,
  124. "MsgPreVote": 17,
  125. "MsgPreVoteResp": 18,
  126. }
  127. func (x MessageType) Enum() *MessageType {
  128. p := new(MessageType)
  129. *p = x
  130. return p
  131. }
  132. func (x MessageType) String() string {
  133. return proto.EnumName(MessageType_name, int32(x))
  134. }
  135. func (x *MessageType) UnmarshalJSON(data []byte) error {
  136. value, err := proto.UnmarshalJSONEnum(MessageType_value, data, "MessageType")
  137. if err != nil {
  138. return err
  139. }
  140. *x = MessageType(value)
  141. return nil
  142. }
  143. func (MessageType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{1} }
  144. type ConfChangeType int32
  145. const (
  146. ConfChangeAddNode ConfChangeType = 0
  147. ConfChangeRemoveNode ConfChangeType = 1
  148. ConfChangeUpdateNode ConfChangeType = 2
  149. ConfChangeAddLearnerNode ConfChangeType = 3
  150. )
  151. var ConfChangeType_name = map[int32]string{
  152. 0: "ConfChangeAddNode",
  153. 1: "ConfChangeRemoveNode",
  154. 2: "ConfChangeUpdateNode",
  155. 3: "ConfChangeAddLearnerNode",
  156. }
  157. var ConfChangeType_value = map[string]int32{
  158. "ConfChangeAddNode": 0,
  159. "ConfChangeRemoveNode": 1,
  160. "ConfChangeUpdateNode": 2,
  161. "ConfChangeAddLearnerNode": 3,
  162. }
  163. func (x ConfChangeType) Enum() *ConfChangeType {
  164. p := new(ConfChangeType)
  165. *p = x
  166. return p
  167. }
  168. func (x ConfChangeType) String() string {
  169. return proto.EnumName(ConfChangeType_name, int32(x))
  170. }
  171. func (x *ConfChangeType) UnmarshalJSON(data []byte) error {
  172. value, err := proto.UnmarshalJSONEnum(ConfChangeType_value, data, "ConfChangeType")
  173. if err != nil {
  174. return err
  175. }
  176. *x = ConfChangeType(value)
  177. return nil
  178. }
  179. func (ConfChangeType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{2} }
  180. type Entry struct {
  181. Term uint64 `protobuf:"varint,2,opt,name=Term" json:"Term"`
  182. Index uint64 `protobuf:"varint,3,opt,name=Index" json:"Index"`
  183. Type EntryType `protobuf:"varint,1,opt,name=Type,enum=raftpb.EntryType" json:"Type"`
  184. Data []byte `protobuf:"bytes,4,opt,name=Data" json:"Data,omitempty"`
  185. XXX_unrecognized []byte `json:"-"`
  186. }
  187. func (m *Entry) Reset() { *m = Entry{} }
  188. func (m *Entry) String() string { return proto.CompactTextString(m) }
  189. func (*Entry) ProtoMessage() {}
  190. func (*Entry) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{0} }
  191. type SnapshotMetadata struct {
  192. ConfState ConfState `protobuf:"bytes,1,opt,name=conf_state,json=confState" json:"conf_state"`
  193. Index uint64 `protobuf:"varint,2,opt,name=index" json:"index"`
  194. Term uint64 `protobuf:"varint,3,opt,name=term" json:"term"`
  195. XXX_unrecognized []byte `json:"-"`
  196. }
  197. func (m *SnapshotMetadata) Reset() { *m = SnapshotMetadata{} }
  198. func (m *SnapshotMetadata) String() string { return proto.CompactTextString(m) }
  199. func (*SnapshotMetadata) ProtoMessage() {}
  200. func (*SnapshotMetadata) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{1} }
  201. type Snapshot struct {
  202. Data []byte `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
  203. Metadata SnapshotMetadata `protobuf:"bytes,2,opt,name=metadata" json:"metadata"`
  204. XXX_unrecognized []byte `json:"-"`
  205. }
  206. func (m *Snapshot) Reset() { *m = Snapshot{} }
  207. func (m *Snapshot) String() string { return proto.CompactTextString(m) }
  208. func (*Snapshot) ProtoMessage() {}
  209. func (*Snapshot) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{2} }
  210. type Message struct {
  211. Type MessageType `protobuf:"varint,1,opt,name=type,enum=raftpb.MessageType" json:"type"`
  212. To uint64 `protobuf:"varint,2,opt,name=to" json:"to"`
  213. From uint64 `protobuf:"varint,3,opt,name=from" json:"from"`
  214. Term uint64 `protobuf:"varint,4,opt,name=term" json:"term"`
  215. LogTerm uint64 `protobuf:"varint,5,opt,name=logTerm" json:"logTerm"`
  216. Index uint64 `protobuf:"varint,6,opt,name=index" json:"index"`
  217. Entries []Entry `protobuf:"bytes,7,rep,name=entries" json:"entries"`
  218. Commit uint64 `protobuf:"varint,8,opt,name=commit" json:"commit"`
  219. Snapshot Snapshot `protobuf:"bytes,9,opt,name=snapshot" json:"snapshot"`
  220. Reject bool `protobuf:"varint,10,opt,name=reject" json:"reject"`
  221. RejectHint uint64 `protobuf:"varint,11,opt,name=rejectHint" json:"rejectHint"`
  222. Context []byte `protobuf:"bytes,12,opt,name=context" json:"context,omitempty"`
  223. XXX_unrecognized []byte `json:"-"`
  224. }
  225. func (m *Message) Reset() { *m = Message{} }
  226. func (m *Message) String() string { return proto.CompactTextString(m) }
  227. func (*Message) ProtoMessage() {}
  228. func (*Message) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{3} }
  229. type HardState struct {
  230. Term uint64 `protobuf:"varint,1,opt,name=term" json:"term"`
  231. Vote uint64 `protobuf:"varint,2,opt,name=vote" json:"vote"`
  232. Commit uint64 `protobuf:"varint,3,opt,name=commit" json:"commit"`
  233. XXX_unrecognized []byte `json:"-"`
  234. }
  235. func (m *HardState) Reset() { *m = HardState{} }
  236. func (m *HardState) String() string { return proto.CompactTextString(m) }
  237. func (*HardState) ProtoMessage() {}
  238. func (*HardState) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{4} }
  239. type ConfState struct {
  240. Nodes []uint64 `protobuf:"varint,1,rep,name=nodes" json:"nodes,omitempty"`
  241. Learners []uint64 `protobuf:"varint,2,rep,name=learners" json:"learners,omitempty"`
  242. XXX_unrecognized []byte `json:"-"`
  243. }
  244. func (m *ConfState) Reset() { *m = ConfState{} }
  245. func (m *ConfState) String() string { return proto.CompactTextString(m) }
  246. func (*ConfState) ProtoMessage() {}
  247. func (*ConfState) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{5} }
  248. type ConfChange struct {
  249. ID uint64 `protobuf:"varint,1,opt,name=ID" json:"ID"`
  250. Type ConfChangeType `protobuf:"varint,2,opt,name=Type,enum=raftpb.ConfChangeType" json:"Type"`
  251. NodeID uint64 `protobuf:"varint,3,opt,name=NodeID" json:"NodeID"`
  252. Context []byte `protobuf:"bytes,4,opt,name=Context" json:"Context,omitempty"`
  253. XXX_unrecognized []byte `json:"-"`
  254. }
  255. func (m *ConfChange) Reset() { *m = ConfChange{} }
  256. func (m *ConfChange) String() string { return proto.CompactTextString(m) }
  257. func (*ConfChange) ProtoMessage() {}
  258. func (*ConfChange) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{6} }
  259. func init() {
  260. proto.RegisterType((*Entry)(nil), "raftpb.Entry")
  261. proto.RegisterType((*SnapshotMetadata)(nil), "raftpb.SnapshotMetadata")
  262. proto.RegisterType((*Snapshot)(nil), "raftpb.Snapshot")
  263. proto.RegisterType((*Message)(nil), "raftpb.Message")
  264. proto.RegisterType((*HardState)(nil), "raftpb.HardState")
  265. proto.RegisterType((*ConfState)(nil), "raftpb.ConfState")
  266. proto.RegisterType((*ConfChange)(nil), "raftpb.ConfChange")
  267. proto.RegisterEnum("raftpb.EntryType", EntryType_name, EntryType_value)
  268. proto.RegisterEnum("raftpb.MessageType", MessageType_name, MessageType_value)
  269. proto.RegisterEnum("raftpb.ConfChangeType", ConfChangeType_name, ConfChangeType_value)
  270. }
  271. func (m *Entry) Marshal() (dAtA []byte, err error) {
  272. size := m.Size()
  273. dAtA = make([]byte, size)
  274. n, err := m.MarshalTo(dAtA)
  275. if err != nil {
  276. return nil, err
  277. }
  278. return dAtA[:n], nil
  279. }
  280. func (m *Entry) MarshalTo(dAtA []byte) (int, error) {
  281. var i int
  282. _ = i
  283. var l int
  284. _ = l
  285. dAtA[i] = 0x8
  286. i++
  287. i = encodeVarintRaft(dAtA, i, uint64(m.Type))
  288. dAtA[i] = 0x10
  289. i++
  290. i = encodeVarintRaft(dAtA, i, uint64(m.Term))
  291. dAtA[i] = 0x18
  292. i++
  293. i = encodeVarintRaft(dAtA, i, uint64(m.Index))
  294. if m.Data != nil {
  295. dAtA[i] = 0x22
  296. i++
  297. i = encodeVarintRaft(dAtA, i, uint64(len(m.Data)))
  298. i += copy(dAtA[i:], m.Data)
  299. }
  300. if m.XXX_unrecognized != nil {
  301. i += copy(dAtA[i:], m.XXX_unrecognized)
  302. }
  303. return i, nil
  304. }
  305. func (m *SnapshotMetadata) Marshal() (dAtA []byte, err error) {
  306. size := m.Size()
  307. dAtA = make([]byte, size)
  308. n, err := m.MarshalTo(dAtA)
  309. if err != nil {
  310. return nil, err
  311. }
  312. return dAtA[:n], nil
  313. }
  314. func (m *SnapshotMetadata) MarshalTo(dAtA []byte) (int, error) {
  315. var i int
  316. _ = i
  317. var l int
  318. _ = l
  319. dAtA[i] = 0xa
  320. i++
  321. i = encodeVarintRaft(dAtA, i, uint64(m.ConfState.Size()))
  322. n1, err := m.ConfState.MarshalTo(dAtA[i:])
  323. if err != nil {
  324. return 0, err
  325. }
  326. i += n1
  327. dAtA[i] = 0x10
  328. i++
  329. i = encodeVarintRaft(dAtA, i, uint64(m.Index))
  330. dAtA[i] = 0x18
  331. i++
  332. i = encodeVarintRaft(dAtA, i, uint64(m.Term))
  333. if m.XXX_unrecognized != nil {
  334. i += copy(dAtA[i:], m.XXX_unrecognized)
  335. }
  336. return i, nil
  337. }
  338. func (m *Snapshot) Marshal() (dAtA []byte, err error) {
  339. size := m.Size()
  340. dAtA = make([]byte, size)
  341. n, err := m.MarshalTo(dAtA)
  342. if err != nil {
  343. return nil, err
  344. }
  345. return dAtA[:n], nil
  346. }
  347. func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) {
  348. var i int
  349. _ = i
  350. var l int
  351. _ = l
  352. if m.Data != nil {
  353. dAtA[i] = 0xa
  354. i++
  355. i = encodeVarintRaft(dAtA, i, uint64(len(m.Data)))
  356. i += copy(dAtA[i:], m.Data)
  357. }
  358. dAtA[i] = 0x12
  359. i++
  360. i = encodeVarintRaft(dAtA, i, uint64(m.Metadata.Size()))
  361. n2, err := m.Metadata.MarshalTo(dAtA[i:])
  362. if err != nil {
  363. return 0, err
  364. }
  365. i += n2
  366. if m.XXX_unrecognized != nil {
  367. i += copy(dAtA[i:], m.XXX_unrecognized)
  368. }
  369. return i, nil
  370. }
  371. func (m *Message) Marshal() (dAtA []byte, err error) {
  372. size := m.Size()
  373. dAtA = make([]byte, size)
  374. n, err := m.MarshalTo(dAtA)
  375. if err != nil {
  376. return nil, err
  377. }
  378. return dAtA[:n], nil
  379. }
  380. func (m *Message) MarshalTo(dAtA []byte) (int, error) {
  381. var i int
  382. _ = i
  383. var l int
  384. _ = l
  385. dAtA[i] = 0x8
  386. i++
  387. i = encodeVarintRaft(dAtA, i, uint64(m.Type))
  388. dAtA[i] = 0x10
  389. i++
  390. i = encodeVarintRaft(dAtA, i, uint64(m.To))
  391. dAtA[i] = 0x18
  392. i++
  393. i = encodeVarintRaft(dAtA, i, uint64(m.From))
  394. dAtA[i] = 0x20
  395. i++
  396. i = encodeVarintRaft(dAtA, i, uint64(m.Term))
  397. dAtA[i] = 0x28
  398. i++
  399. i = encodeVarintRaft(dAtA, i, uint64(m.LogTerm))
  400. dAtA[i] = 0x30
  401. i++
  402. i = encodeVarintRaft(dAtA, i, uint64(m.Index))
  403. if len(m.Entries) > 0 {
  404. for _, msg := range m.Entries {
  405. dAtA[i] = 0x3a
  406. i++
  407. i = encodeVarintRaft(dAtA, i, uint64(msg.Size()))
  408. n, err := msg.MarshalTo(dAtA[i:])
  409. if err != nil {
  410. return 0, err
  411. }
  412. i += n
  413. }
  414. }
  415. dAtA[i] = 0x40
  416. i++
  417. i = encodeVarintRaft(dAtA, i, uint64(m.Commit))
  418. dAtA[i] = 0x4a
  419. i++
  420. i = encodeVarintRaft(dAtA, i, uint64(m.Snapshot.Size()))
  421. n3, err := m.Snapshot.MarshalTo(dAtA[i:])
  422. if err != nil {
  423. return 0, err
  424. }
  425. i += n3
  426. dAtA[i] = 0x50
  427. i++
  428. if m.Reject {
  429. dAtA[i] = 1
  430. } else {
  431. dAtA[i] = 0
  432. }
  433. i++
  434. dAtA[i] = 0x58
  435. i++
  436. i = encodeVarintRaft(dAtA, i, uint64(m.RejectHint))
  437. if m.Context != nil {
  438. dAtA[i] = 0x62
  439. i++
  440. i = encodeVarintRaft(dAtA, i, uint64(len(m.Context)))
  441. i += copy(dAtA[i:], m.Context)
  442. }
  443. if m.XXX_unrecognized != nil {
  444. i += copy(dAtA[i:], m.XXX_unrecognized)
  445. }
  446. return i, nil
  447. }
  448. func (m *HardState) Marshal() (dAtA []byte, err error) {
  449. size := m.Size()
  450. dAtA = make([]byte, size)
  451. n, err := m.MarshalTo(dAtA)
  452. if err != nil {
  453. return nil, err
  454. }
  455. return dAtA[:n], nil
  456. }
  457. func (m *HardState) MarshalTo(dAtA []byte) (int, error) {
  458. var i int
  459. _ = i
  460. var l int
  461. _ = l
  462. dAtA[i] = 0x8
  463. i++
  464. i = encodeVarintRaft(dAtA, i, uint64(m.Term))
  465. dAtA[i] = 0x10
  466. i++
  467. i = encodeVarintRaft(dAtA, i, uint64(m.Vote))
  468. dAtA[i] = 0x18
  469. i++
  470. i = encodeVarintRaft(dAtA, i, uint64(m.Commit))
  471. if m.XXX_unrecognized != nil {
  472. i += copy(dAtA[i:], m.XXX_unrecognized)
  473. }
  474. return i, nil
  475. }
  476. func (m *ConfState) Marshal() (dAtA []byte, err error) {
  477. size := m.Size()
  478. dAtA = make([]byte, size)
  479. n, err := m.MarshalTo(dAtA)
  480. if err != nil {
  481. return nil, err
  482. }
  483. return dAtA[:n], nil
  484. }
  485. func (m *ConfState) MarshalTo(dAtA []byte) (int, error) {
  486. var i int
  487. _ = i
  488. var l int
  489. _ = l
  490. if len(m.Nodes) > 0 {
  491. for _, num := range m.Nodes {
  492. dAtA[i] = 0x8
  493. i++
  494. i = encodeVarintRaft(dAtA, i, uint64(num))
  495. }
  496. }
  497. if len(m.Learners) > 0 {
  498. for _, num := range m.Learners {
  499. dAtA[i] = 0x10
  500. i++
  501. i = encodeVarintRaft(dAtA, i, uint64(num))
  502. }
  503. }
  504. if m.XXX_unrecognized != nil {
  505. i += copy(dAtA[i:], m.XXX_unrecognized)
  506. }
  507. return i, nil
  508. }
  509. func (m *ConfChange) Marshal() (dAtA []byte, err error) {
  510. size := m.Size()
  511. dAtA = make([]byte, size)
  512. n, err := m.MarshalTo(dAtA)
  513. if err != nil {
  514. return nil, err
  515. }
  516. return dAtA[:n], nil
  517. }
  518. func (m *ConfChange) MarshalTo(dAtA []byte) (int, error) {
  519. var i int
  520. _ = i
  521. var l int
  522. _ = l
  523. dAtA[i] = 0x8
  524. i++
  525. i = encodeVarintRaft(dAtA, i, uint64(m.ID))
  526. dAtA[i] = 0x10
  527. i++
  528. i = encodeVarintRaft(dAtA, i, uint64(m.Type))
  529. dAtA[i] = 0x18
  530. i++
  531. i = encodeVarintRaft(dAtA, i, uint64(m.NodeID))
  532. if m.Context != nil {
  533. dAtA[i] = 0x22
  534. i++
  535. i = encodeVarintRaft(dAtA, i, uint64(len(m.Context)))
  536. i += copy(dAtA[i:], m.Context)
  537. }
  538. if m.XXX_unrecognized != nil {
  539. i += copy(dAtA[i:], m.XXX_unrecognized)
  540. }
  541. return i, nil
  542. }
  543. func encodeVarintRaft(dAtA []byte, offset int, v uint64) int {
  544. for v >= 1<<7 {
  545. dAtA[offset] = uint8(v&0x7f | 0x80)
  546. v >>= 7
  547. offset++
  548. }
  549. dAtA[offset] = uint8(v)
  550. return offset + 1
  551. }
  552. func (m *Entry) Size() (n int) {
  553. var l int
  554. _ = l
  555. n += 1 + sovRaft(uint64(m.Type))
  556. n += 1 + sovRaft(uint64(m.Term))
  557. n += 1 + sovRaft(uint64(m.Index))
  558. if m.Data != nil {
  559. l = len(m.Data)
  560. n += 1 + l + sovRaft(uint64(l))
  561. }
  562. if m.XXX_unrecognized != nil {
  563. n += len(m.XXX_unrecognized)
  564. }
  565. return n
  566. }
  567. func (m *SnapshotMetadata) Size() (n int) {
  568. var l int
  569. _ = l
  570. l = m.ConfState.Size()
  571. n += 1 + l + sovRaft(uint64(l))
  572. n += 1 + sovRaft(uint64(m.Index))
  573. n += 1 + sovRaft(uint64(m.Term))
  574. if m.XXX_unrecognized != nil {
  575. n += len(m.XXX_unrecognized)
  576. }
  577. return n
  578. }
  579. func (m *Snapshot) Size() (n int) {
  580. var l int
  581. _ = l
  582. if m.Data != nil {
  583. l = len(m.Data)
  584. n += 1 + l + sovRaft(uint64(l))
  585. }
  586. l = m.Metadata.Size()
  587. n += 1 + l + sovRaft(uint64(l))
  588. if m.XXX_unrecognized != nil {
  589. n += len(m.XXX_unrecognized)
  590. }
  591. return n
  592. }
  593. func (m *Message) Size() (n int) {
  594. var l int
  595. _ = l
  596. n += 1 + sovRaft(uint64(m.Type))
  597. n += 1 + sovRaft(uint64(m.To))
  598. n += 1 + sovRaft(uint64(m.From))
  599. n += 1 + sovRaft(uint64(m.Term))
  600. n += 1 + sovRaft(uint64(m.LogTerm))
  601. n += 1 + sovRaft(uint64(m.Index))
  602. if len(m.Entries) > 0 {
  603. for _, e := range m.Entries {
  604. l = e.Size()
  605. n += 1 + l + sovRaft(uint64(l))
  606. }
  607. }
  608. n += 1 + sovRaft(uint64(m.Commit))
  609. l = m.Snapshot.Size()
  610. n += 1 + l + sovRaft(uint64(l))
  611. n += 2
  612. n += 1 + sovRaft(uint64(m.RejectHint))
  613. if m.Context != nil {
  614. l = len(m.Context)
  615. n += 1 + l + sovRaft(uint64(l))
  616. }
  617. if m.XXX_unrecognized != nil {
  618. n += len(m.XXX_unrecognized)
  619. }
  620. return n
  621. }
  622. func (m *HardState) Size() (n int) {
  623. var l int
  624. _ = l
  625. n += 1 + sovRaft(uint64(m.Term))
  626. n += 1 + sovRaft(uint64(m.Vote))
  627. n += 1 + sovRaft(uint64(m.Commit))
  628. if m.XXX_unrecognized != nil {
  629. n += len(m.XXX_unrecognized)
  630. }
  631. return n
  632. }
  633. func (m *ConfState) Size() (n int) {
  634. var l int
  635. _ = l
  636. if len(m.Nodes) > 0 {
  637. for _, e := range m.Nodes {
  638. n += 1 + sovRaft(uint64(e))
  639. }
  640. }
  641. if len(m.Learners) > 0 {
  642. for _, e := range m.Learners {
  643. n += 1 + sovRaft(uint64(e))
  644. }
  645. }
  646. if m.XXX_unrecognized != nil {
  647. n += len(m.XXX_unrecognized)
  648. }
  649. return n
  650. }
  651. func (m *ConfChange) Size() (n int) {
  652. var l int
  653. _ = l
  654. n += 1 + sovRaft(uint64(m.ID))
  655. n += 1 + sovRaft(uint64(m.Type))
  656. n += 1 + sovRaft(uint64(m.NodeID))
  657. if m.Context != nil {
  658. l = len(m.Context)
  659. n += 1 + l + sovRaft(uint64(l))
  660. }
  661. if m.XXX_unrecognized != nil {
  662. n += len(m.XXX_unrecognized)
  663. }
  664. return n
  665. }
  666. func sovRaft(x uint64) (n int) {
  667. for {
  668. n++
  669. x >>= 7
  670. if x == 0 {
  671. break
  672. }
  673. }
  674. return n
  675. }
  676. func sozRaft(x uint64) (n int) {
  677. return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  678. }
  679. func (m *Entry) Unmarshal(dAtA []byte) error {
  680. l := len(dAtA)
  681. iNdEx := 0
  682. for iNdEx < l {
  683. preIndex := iNdEx
  684. var wire uint64
  685. for shift := uint(0); ; shift += 7 {
  686. if shift >= 64 {
  687. return ErrIntOverflowRaft
  688. }
  689. if iNdEx >= l {
  690. return io.ErrUnexpectedEOF
  691. }
  692. b := dAtA[iNdEx]
  693. iNdEx++
  694. wire |= (uint64(b) & 0x7F) << shift
  695. if b < 0x80 {
  696. break
  697. }
  698. }
  699. fieldNum := int32(wire >> 3)
  700. wireType := int(wire & 0x7)
  701. if wireType == 4 {
  702. return fmt.Errorf("proto: Entry: wiretype end group for non-group")
  703. }
  704. if fieldNum <= 0 {
  705. return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire)
  706. }
  707. switch fieldNum {
  708. case 1:
  709. if wireType != 0 {
  710. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  711. }
  712. m.Type = 0
  713. for shift := uint(0); ; shift += 7 {
  714. if shift >= 64 {
  715. return ErrIntOverflowRaft
  716. }
  717. if iNdEx >= l {
  718. return io.ErrUnexpectedEOF
  719. }
  720. b := dAtA[iNdEx]
  721. iNdEx++
  722. m.Type |= (EntryType(b) & 0x7F) << shift
  723. if b < 0x80 {
  724. break
  725. }
  726. }
  727. case 2:
  728. if wireType != 0 {
  729. return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  730. }
  731. m.Term = 0
  732. for shift := uint(0); ; shift += 7 {
  733. if shift >= 64 {
  734. return ErrIntOverflowRaft
  735. }
  736. if iNdEx >= l {
  737. return io.ErrUnexpectedEOF
  738. }
  739. b := dAtA[iNdEx]
  740. iNdEx++
  741. m.Term |= (uint64(b) & 0x7F) << shift
  742. if b < 0x80 {
  743. break
  744. }
  745. }
  746. case 3:
  747. if wireType != 0 {
  748. return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  749. }
  750. m.Index = 0
  751. for shift := uint(0); ; shift += 7 {
  752. if shift >= 64 {
  753. return ErrIntOverflowRaft
  754. }
  755. if iNdEx >= l {
  756. return io.ErrUnexpectedEOF
  757. }
  758. b := dAtA[iNdEx]
  759. iNdEx++
  760. m.Index |= (uint64(b) & 0x7F) << shift
  761. if b < 0x80 {
  762. break
  763. }
  764. }
  765. case 4:
  766. if wireType != 2 {
  767. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  768. }
  769. var byteLen int
  770. for shift := uint(0); ; shift += 7 {
  771. if shift >= 64 {
  772. return ErrIntOverflowRaft
  773. }
  774. if iNdEx >= l {
  775. return io.ErrUnexpectedEOF
  776. }
  777. b := dAtA[iNdEx]
  778. iNdEx++
  779. byteLen |= (int(b) & 0x7F) << shift
  780. if b < 0x80 {
  781. break
  782. }
  783. }
  784. if byteLen < 0 {
  785. return ErrInvalidLengthRaft
  786. }
  787. postIndex := iNdEx + byteLen
  788. if postIndex > l {
  789. return io.ErrUnexpectedEOF
  790. }
  791. m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  792. if m.Data == nil {
  793. m.Data = []byte{}
  794. }
  795. iNdEx = postIndex
  796. default:
  797. iNdEx = preIndex
  798. skippy, err := skipRaft(dAtA[iNdEx:])
  799. if err != nil {
  800. return err
  801. }
  802. if skippy < 0 {
  803. return ErrInvalidLengthRaft
  804. }
  805. if (iNdEx + skippy) > l {
  806. return io.ErrUnexpectedEOF
  807. }
  808. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  809. iNdEx += skippy
  810. }
  811. }
  812. if iNdEx > l {
  813. return io.ErrUnexpectedEOF
  814. }
  815. return nil
  816. }
  817. func (m *SnapshotMetadata) Unmarshal(dAtA []byte) error {
  818. l := len(dAtA)
  819. iNdEx := 0
  820. for iNdEx < l {
  821. preIndex := iNdEx
  822. var wire uint64
  823. for shift := uint(0); ; shift += 7 {
  824. if shift >= 64 {
  825. return ErrIntOverflowRaft
  826. }
  827. if iNdEx >= l {
  828. return io.ErrUnexpectedEOF
  829. }
  830. b := dAtA[iNdEx]
  831. iNdEx++
  832. wire |= (uint64(b) & 0x7F) << shift
  833. if b < 0x80 {
  834. break
  835. }
  836. }
  837. fieldNum := int32(wire >> 3)
  838. wireType := int(wire & 0x7)
  839. if wireType == 4 {
  840. return fmt.Errorf("proto: SnapshotMetadata: wiretype end group for non-group")
  841. }
  842. if fieldNum <= 0 {
  843. return fmt.Errorf("proto: SnapshotMetadata: illegal tag %d (wire type %d)", fieldNum, wire)
  844. }
  845. switch fieldNum {
  846. case 1:
  847. if wireType != 2 {
  848. return fmt.Errorf("proto: wrong wireType = %d for field ConfState", wireType)
  849. }
  850. var msglen int
  851. for shift := uint(0); ; shift += 7 {
  852. if shift >= 64 {
  853. return ErrIntOverflowRaft
  854. }
  855. if iNdEx >= l {
  856. return io.ErrUnexpectedEOF
  857. }
  858. b := dAtA[iNdEx]
  859. iNdEx++
  860. msglen |= (int(b) & 0x7F) << shift
  861. if b < 0x80 {
  862. break
  863. }
  864. }
  865. if msglen < 0 {
  866. return ErrInvalidLengthRaft
  867. }
  868. postIndex := iNdEx + msglen
  869. if postIndex > l {
  870. return io.ErrUnexpectedEOF
  871. }
  872. if err := m.ConfState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  873. return err
  874. }
  875. iNdEx = postIndex
  876. case 2:
  877. if wireType != 0 {
  878. return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  879. }
  880. m.Index = 0
  881. for shift := uint(0); ; shift += 7 {
  882. if shift >= 64 {
  883. return ErrIntOverflowRaft
  884. }
  885. if iNdEx >= l {
  886. return io.ErrUnexpectedEOF
  887. }
  888. b := dAtA[iNdEx]
  889. iNdEx++
  890. m.Index |= (uint64(b) & 0x7F) << shift
  891. if b < 0x80 {
  892. break
  893. }
  894. }
  895. case 3:
  896. if wireType != 0 {
  897. return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  898. }
  899. m.Term = 0
  900. for shift := uint(0); ; shift += 7 {
  901. if shift >= 64 {
  902. return ErrIntOverflowRaft
  903. }
  904. if iNdEx >= l {
  905. return io.ErrUnexpectedEOF
  906. }
  907. b := dAtA[iNdEx]
  908. iNdEx++
  909. m.Term |= (uint64(b) & 0x7F) << shift
  910. if b < 0x80 {
  911. break
  912. }
  913. }
  914. default:
  915. iNdEx = preIndex
  916. skippy, err := skipRaft(dAtA[iNdEx:])
  917. if err != nil {
  918. return err
  919. }
  920. if skippy < 0 {
  921. return ErrInvalidLengthRaft
  922. }
  923. if (iNdEx + skippy) > l {
  924. return io.ErrUnexpectedEOF
  925. }
  926. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  927. iNdEx += skippy
  928. }
  929. }
  930. if iNdEx > l {
  931. return io.ErrUnexpectedEOF
  932. }
  933. return nil
  934. }
  935. func (m *Snapshot) Unmarshal(dAtA []byte) error {
  936. l := len(dAtA)
  937. iNdEx := 0
  938. for iNdEx < l {
  939. preIndex := iNdEx
  940. var wire uint64
  941. for shift := uint(0); ; shift += 7 {
  942. if shift >= 64 {
  943. return ErrIntOverflowRaft
  944. }
  945. if iNdEx >= l {
  946. return io.ErrUnexpectedEOF
  947. }
  948. b := dAtA[iNdEx]
  949. iNdEx++
  950. wire |= (uint64(b) & 0x7F) << shift
  951. if b < 0x80 {
  952. break
  953. }
  954. }
  955. fieldNum := int32(wire >> 3)
  956. wireType := int(wire & 0x7)
  957. if wireType == 4 {
  958. return fmt.Errorf("proto: Snapshot: wiretype end group for non-group")
  959. }
  960. if fieldNum <= 0 {
  961. return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire)
  962. }
  963. switch fieldNum {
  964. case 1:
  965. if wireType != 2 {
  966. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  967. }
  968. var byteLen int
  969. for shift := uint(0); ; shift += 7 {
  970. if shift >= 64 {
  971. return ErrIntOverflowRaft
  972. }
  973. if iNdEx >= l {
  974. return io.ErrUnexpectedEOF
  975. }
  976. b := dAtA[iNdEx]
  977. iNdEx++
  978. byteLen |= (int(b) & 0x7F) << shift
  979. if b < 0x80 {
  980. break
  981. }
  982. }
  983. if byteLen < 0 {
  984. return ErrInvalidLengthRaft
  985. }
  986. postIndex := iNdEx + byteLen
  987. if postIndex > l {
  988. return io.ErrUnexpectedEOF
  989. }
  990. m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  991. if m.Data == nil {
  992. m.Data = []byte{}
  993. }
  994. iNdEx = postIndex
  995. case 2:
  996. if wireType != 2 {
  997. return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType)
  998. }
  999. var msglen int
  1000. for shift := uint(0); ; shift += 7 {
  1001. if shift >= 64 {
  1002. return ErrIntOverflowRaft
  1003. }
  1004. if iNdEx >= l {
  1005. return io.ErrUnexpectedEOF
  1006. }
  1007. b := dAtA[iNdEx]
  1008. iNdEx++
  1009. msglen |= (int(b) & 0x7F) << shift
  1010. if b < 0x80 {
  1011. break
  1012. }
  1013. }
  1014. if msglen < 0 {
  1015. return ErrInvalidLengthRaft
  1016. }
  1017. postIndex := iNdEx + msglen
  1018. if postIndex > l {
  1019. return io.ErrUnexpectedEOF
  1020. }
  1021. if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1022. return err
  1023. }
  1024. iNdEx = postIndex
  1025. default:
  1026. iNdEx = preIndex
  1027. skippy, err := skipRaft(dAtA[iNdEx:])
  1028. if err != nil {
  1029. return err
  1030. }
  1031. if skippy < 0 {
  1032. return ErrInvalidLengthRaft
  1033. }
  1034. if (iNdEx + skippy) > l {
  1035. return io.ErrUnexpectedEOF
  1036. }
  1037. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1038. iNdEx += skippy
  1039. }
  1040. }
  1041. if iNdEx > l {
  1042. return io.ErrUnexpectedEOF
  1043. }
  1044. return nil
  1045. }
  1046. func (m *Message) Unmarshal(dAtA []byte) error {
  1047. l := len(dAtA)
  1048. iNdEx := 0
  1049. for iNdEx < l {
  1050. preIndex := iNdEx
  1051. var wire uint64
  1052. for shift := uint(0); ; shift += 7 {
  1053. if shift >= 64 {
  1054. return ErrIntOverflowRaft
  1055. }
  1056. if iNdEx >= l {
  1057. return io.ErrUnexpectedEOF
  1058. }
  1059. b := dAtA[iNdEx]
  1060. iNdEx++
  1061. wire |= (uint64(b) & 0x7F) << shift
  1062. if b < 0x80 {
  1063. break
  1064. }
  1065. }
  1066. fieldNum := int32(wire >> 3)
  1067. wireType := int(wire & 0x7)
  1068. if wireType == 4 {
  1069. return fmt.Errorf("proto: Message: wiretype end group for non-group")
  1070. }
  1071. if fieldNum <= 0 {
  1072. return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire)
  1073. }
  1074. switch fieldNum {
  1075. case 1:
  1076. if wireType != 0 {
  1077. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1078. }
  1079. m.Type = 0
  1080. for shift := uint(0); ; shift += 7 {
  1081. if shift >= 64 {
  1082. return ErrIntOverflowRaft
  1083. }
  1084. if iNdEx >= l {
  1085. return io.ErrUnexpectedEOF
  1086. }
  1087. b := dAtA[iNdEx]
  1088. iNdEx++
  1089. m.Type |= (MessageType(b) & 0x7F) << shift
  1090. if b < 0x80 {
  1091. break
  1092. }
  1093. }
  1094. case 2:
  1095. if wireType != 0 {
  1096. return fmt.Errorf("proto: wrong wireType = %d for field To", wireType)
  1097. }
  1098. m.To = 0
  1099. for shift := uint(0); ; shift += 7 {
  1100. if shift >= 64 {
  1101. return ErrIntOverflowRaft
  1102. }
  1103. if iNdEx >= l {
  1104. return io.ErrUnexpectedEOF
  1105. }
  1106. b := dAtA[iNdEx]
  1107. iNdEx++
  1108. m.To |= (uint64(b) & 0x7F) << shift
  1109. if b < 0x80 {
  1110. break
  1111. }
  1112. }
  1113. case 3:
  1114. if wireType != 0 {
  1115. return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
  1116. }
  1117. m.From = 0
  1118. for shift := uint(0); ; shift += 7 {
  1119. if shift >= 64 {
  1120. return ErrIntOverflowRaft
  1121. }
  1122. if iNdEx >= l {
  1123. return io.ErrUnexpectedEOF
  1124. }
  1125. b := dAtA[iNdEx]
  1126. iNdEx++
  1127. m.From |= (uint64(b) & 0x7F) << shift
  1128. if b < 0x80 {
  1129. break
  1130. }
  1131. }
  1132. case 4:
  1133. if wireType != 0 {
  1134. return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  1135. }
  1136. m.Term = 0
  1137. for shift := uint(0); ; shift += 7 {
  1138. if shift >= 64 {
  1139. return ErrIntOverflowRaft
  1140. }
  1141. if iNdEx >= l {
  1142. return io.ErrUnexpectedEOF
  1143. }
  1144. b := dAtA[iNdEx]
  1145. iNdEx++
  1146. m.Term |= (uint64(b) & 0x7F) << shift
  1147. if b < 0x80 {
  1148. break
  1149. }
  1150. }
  1151. case 5:
  1152. if wireType != 0 {
  1153. return fmt.Errorf("proto: wrong wireType = %d for field LogTerm", wireType)
  1154. }
  1155. m.LogTerm = 0
  1156. for shift := uint(0); ; shift += 7 {
  1157. if shift >= 64 {
  1158. return ErrIntOverflowRaft
  1159. }
  1160. if iNdEx >= l {
  1161. return io.ErrUnexpectedEOF
  1162. }
  1163. b := dAtA[iNdEx]
  1164. iNdEx++
  1165. m.LogTerm |= (uint64(b) & 0x7F) << shift
  1166. if b < 0x80 {
  1167. break
  1168. }
  1169. }
  1170. case 6:
  1171. if wireType != 0 {
  1172. return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  1173. }
  1174. m.Index = 0
  1175. for shift := uint(0); ; shift += 7 {
  1176. if shift >= 64 {
  1177. return ErrIntOverflowRaft
  1178. }
  1179. if iNdEx >= l {
  1180. return io.ErrUnexpectedEOF
  1181. }
  1182. b := dAtA[iNdEx]
  1183. iNdEx++
  1184. m.Index |= (uint64(b) & 0x7F) << shift
  1185. if b < 0x80 {
  1186. break
  1187. }
  1188. }
  1189. case 7:
  1190. if wireType != 2 {
  1191. return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType)
  1192. }
  1193. var msglen int
  1194. for shift := uint(0); ; shift += 7 {
  1195. if shift >= 64 {
  1196. return ErrIntOverflowRaft
  1197. }
  1198. if iNdEx >= l {
  1199. return io.ErrUnexpectedEOF
  1200. }
  1201. b := dAtA[iNdEx]
  1202. iNdEx++
  1203. msglen |= (int(b) & 0x7F) << shift
  1204. if b < 0x80 {
  1205. break
  1206. }
  1207. }
  1208. if msglen < 0 {
  1209. return ErrInvalidLengthRaft
  1210. }
  1211. postIndex := iNdEx + msglen
  1212. if postIndex > l {
  1213. return io.ErrUnexpectedEOF
  1214. }
  1215. m.Entries = append(m.Entries, Entry{})
  1216. if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1217. return err
  1218. }
  1219. iNdEx = postIndex
  1220. case 8:
  1221. if wireType != 0 {
  1222. return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType)
  1223. }
  1224. m.Commit = 0
  1225. for shift := uint(0); ; shift += 7 {
  1226. if shift >= 64 {
  1227. return ErrIntOverflowRaft
  1228. }
  1229. if iNdEx >= l {
  1230. return io.ErrUnexpectedEOF
  1231. }
  1232. b := dAtA[iNdEx]
  1233. iNdEx++
  1234. m.Commit |= (uint64(b) & 0x7F) << shift
  1235. if b < 0x80 {
  1236. break
  1237. }
  1238. }
  1239. case 9:
  1240. if wireType != 2 {
  1241. return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType)
  1242. }
  1243. var msglen int
  1244. for shift := uint(0); ; shift += 7 {
  1245. if shift >= 64 {
  1246. return ErrIntOverflowRaft
  1247. }
  1248. if iNdEx >= l {
  1249. return io.ErrUnexpectedEOF
  1250. }
  1251. b := dAtA[iNdEx]
  1252. iNdEx++
  1253. msglen |= (int(b) & 0x7F) << shift
  1254. if b < 0x80 {
  1255. break
  1256. }
  1257. }
  1258. if msglen < 0 {
  1259. return ErrInvalidLengthRaft
  1260. }
  1261. postIndex := iNdEx + msglen
  1262. if postIndex > l {
  1263. return io.ErrUnexpectedEOF
  1264. }
  1265. if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1266. return err
  1267. }
  1268. iNdEx = postIndex
  1269. case 10:
  1270. if wireType != 0 {
  1271. return fmt.Errorf("proto: wrong wireType = %d for field Reject", wireType)
  1272. }
  1273. var v int
  1274. for shift := uint(0); ; shift += 7 {
  1275. if shift >= 64 {
  1276. return ErrIntOverflowRaft
  1277. }
  1278. if iNdEx >= l {
  1279. return io.ErrUnexpectedEOF
  1280. }
  1281. b := dAtA[iNdEx]
  1282. iNdEx++
  1283. v |= (int(b) & 0x7F) << shift
  1284. if b < 0x80 {
  1285. break
  1286. }
  1287. }
  1288. m.Reject = bool(v != 0)
  1289. case 11:
  1290. if wireType != 0 {
  1291. return fmt.Errorf("proto: wrong wireType = %d for field RejectHint", wireType)
  1292. }
  1293. m.RejectHint = 0
  1294. for shift := uint(0); ; shift += 7 {
  1295. if shift >= 64 {
  1296. return ErrIntOverflowRaft
  1297. }
  1298. if iNdEx >= l {
  1299. return io.ErrUnexpectedEOF
  1300. }
  1301. b := dAtA[iNdEx]
  1302. iNdEx++
  1303. m.RejectHint |= (uint64(b) & 0x7F) << shift
  1304. if b < 0x80 {
  1305. break
  1306. }
  1307. }
  1308. case 12:
  1309. if wireType != 2 {
  1310. return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
  1311. }
  1312. var byteLen int
  1313. for shift := uint(0); ; shift += 7 {
  1314. if shift >= 64 {
  1315. return ErrIntOverflowRaft
  1316. }
  1317. if iNdEx >= l {
  1318. return io.ErrUnexpectedEOF
  1319. }
  1320. b := dAtA[iNdEx]
  1321. iNdEx++
  1322. byteLen |= (int(b) & 0x7F) << shift
  1323. if b < 0x80 {
  1324. break
  1325. }
  1326. }
  1327. if byteLen < 0 {
  1328. return ErrInvalidLengthRaft
  1329. }
  1330. postIndex := iNdEx + byteLen
  1331. if postIndex > l {
  1332. return io.ErrUnexpectedEOF
  1333. }
  1334. m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...)
  1335. if m.Context == nil {
  1336. m.Context = []byte{}
  1337. }
  1338. iNdEx = postIndex
  1339. default:
  1340. iNdEx = preIndex
  1341. skippy, err := skipRaft(dAtA[iNdEx:])
  1342. if err != nil {
  1343. return err
  1344. }
  1345. if skippy < 0 {
  1346. return ErrInvalidLengthRaft
  1347. }
  1348. if (iNdEx + skippy) > l {
  1349. return io.ErrUnexpectedEOF
  1350. }
  1351. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1352. iNdEx += skippy
  1353. }
  1354. }
  1355. if iNdEx > l {
  1356. return io.ErrUnexpectedEOF
  1357. }
  1358. return nil
  1359. }
  1360. func (m *HardState) Unmarshal(dAtA []byte) error {
  1361. l := len(dAtA)
  1362. iNdEx := 0
  1363. for iNdEx < l {
  1364. preIndex := iNdEx
  1365. var wire uint64
  1366. for shift := uint(0); ; shift += 7 {
  1367. if shift >= 64 {
  1368. return ErrIntOverflowRaft
  1369. }
  1370. if iNdEx >= l {
  1371. return io.ErrUnexpectedEOF
  1372. }
  1373. b := dAtA[iNdEx]
  1374. iNdEx++
  1375. wire |= (uint64(b) & 0x7F) << shift
  1376. if b < 0x80 {
  1377. break
  1378. }
  1379. }
  1380. fieldNum := int32(wire >> 3)
  1381. wireType := int(wire & 0x7)
  1382. if wireType == 4 {
  1383. return fmt.Errorf("proto: HardState: wiretype end group for non-group")
  1384. }
  1385. if fieldNum <= 0 {
  1386. return fmt.Errorf("proto: HardState: illegal tag %d (wire type %d)", fieldNum, wire)
  1387. }
  1388. switch fieldNum {
  1389. case 1:
  1390. if wireType != 0 {
  1391. return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  1392. }
  1393. m.Term = 0
  1394. for shift := uint(0); ; shift += 7 {
  1395. if shift >= 64 {
  1396. return ErrIntOverflowRaft
  1397. }
  1398. if iNdEx >= l {
  1399. return io.ErrUnexpectedEOF
  1400. }
  1401. b := dAtA[iNdEx]
  1402. iNdEx++
  1403. m.Term |= (uint64(b) & 0x7F) << shift
  1404. if b < 0x80 {
  1405. break
  1406. }
  1407. }
  1408. case 2:
  1409. if wireType != 0 {
  1410. return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType)
  1411. }
  1412. m.Vote = 0
  1413. for shift := uint(0); ; shift += 7 {
  1414. if shift >= 64 {
  1415. return ErrIntOverflowRaft
  1416. }
  1417. if iNdEx >= l {
  1418. return io.ErrUnexpectedEOF
  1419. }
  1420. b := dAtA[iNdEx]
  1421. iNdEx++
  1422. m.Vote |= (uint64(b) & 0x7F) << shift
  1423. if b < 0x80 {
  1424. break
  1425. }
  1426. }
  1427. case 3:
  1428. if wireType != 0 {
  1429. return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType)
  1430. }
  1431. m.Commit = 0
  1432. for shift := uint(0); ; shift += 7 {
  1433. if shift >= 64 {
  1434. return ErrIntOverflowRaft
  1435. }
  1436. if iNdEx >= l {
  1437. return io.ErrUnexpectedEOF
  1438. }
  1439. b := dAtA[iNdEx]
  1440. iNdEx++
  1441. m.Commit |= (uint64(b) & 0x7F) << shift
  1442. if b < 0x80 {
  1443. break
  1444. }
  1445. }
  1446. default:
  1447. iNdEx = preIndex
  1448. skippy, err := skipRaft(dAtA[iNdEx:])
  1449. if err != nil {
  1450. return err
  1451. }
  1452. if skippy < 0 {
  1453. return ErrInvalidLengthRaft
  1454. }
  1455. if (iNdEx + skippy) > l {
  1456. return io.ErrUnexpectedEOF
  1457. }
  1458. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1459. iNdEx += skippy
  1460. }
  1461. }
  1462. if iNdEx > l {
  1463. return io.ErrUnexpectedEOF
  1464. }
  1465. return nil
  1466. }
  1467. func (m *ConfState) Unmarshal(dAtA []byte) error {
  1468. l := len(dAtA)
  1469. iNdEx := 0
  1470. for iNdEx < l {
  1471. preIndex := iNdEx
  1472. var wire uint64
  1473. for shift := uint(0); ; shift += 7 {
  1474. if shift >= 64 {
  1475. return ErrIntOverflowRaft
  1476. }
  1477. if iNdEx >= l {
  1478. return io.ErrUnexpectedEOF
  1479. }
  1480. b := dAtA[iNdEx]
  1481. iNdEx++
  1482. wire |= (uint64(b) & 0x7F) << shift
  1483. if b < 0x80 {
  1484. break
  1485. }
  1486. }
  1487. fieldNum := int32(wire >> 3)
  1488. wireType := int(wire & 0x7)
  1489. if wireType == 4 {
  1490. return fmt.Errorf("proto: ConfState: wiretype end group for non-group")
  1491. }
  1492. if fieldNum <= 0 {
  1493. return fmt.Errorf("proto: ConfState: illegal tag %d (wire type %d)", fieldNum, wire)
  1494. }
  1495. switch fieldNum {
  1496. case 1:
  1497. if wireType == 0 {
  1498. var v uint64
  1499. for shift := uint(0); ; shift += 7 {
  1500. if shift >= 64 {
  1501. return ErrIntOverflowRaft
  1502. }
  1503. if iNdEx >= l {
  1504. return io.ErrUnexpectedEOF
  1505. }
  1506. b := dAtA[iNdEx]
  1507. iNdEx++
  1508. v |= (uint64(b) & 0x7F) << shift
  1509. if b < 0x80 {
  1510. break
  1511. }
  1512. }
  1513. m.Nodes = append(m.Nodes, v)
  1514. } else if wireType == 2 {
  1515. var packedLen int
  1516. for shift := uint(0); ; shift += 7 {
  1517. if shift >= 64 {
  1518. return ErrIntOverflowRaft
  1519. }
  1520. if iNdEx >= l {
  1521. return io.ErrUnexpectedEOF
  1522. }
  1523. b := dAtA[iNdEx]
  1524. iNdEx++
  1525. packedLen |= (int(b) & 0x7F) << shift
  1526. if b < 0x80 {
  1527. break
  1528. }
  1529. }
  1530. if packedLen < 0 {
  1531. return ErrInvalidLengthRaft
  1532. }
  1533. postIndex := iNdEx + packedLen
  1534. if postIndex > l {
  1535. return io.ErrUnexpectedEOF
  1536. }
  1537. for iNdEx < postIndex {
  1538. var v uint64
  1539. for shift := uint(0); ; shift += 7 {
  1540. if shift >= 64 {
  1541. return ErrIntOverflowRaft
  1542. }
  1543. if iNdEx >= l {
  1544. return io.ErrUnexpectedEOF
  1545. }
  1546. b := dAtA[iNdEx]
  1547. iNdEx++
  1548. v |= (uint64(b) & 0x7F) << shift
  1549. if b < 0x80 {
  1550. break
  1551. }
  1552. }
  1553. m.Nodes = append(m.Nodes, v)
  1554. }
  1555. } else {
  1556. return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType)
  1557. }
  1558. case 2:
  1559. if wireType == 0 {
  1560. var v uint64
  1561. for shift := uint(0); ; shift += 7 {
  1562. if shift >= 64 {
  1563. return ErrIntOverflowRaft
  1564. }
  1565. if iNdEx >= l {
  1566. return io.ErrUnexpectedEOF
  1567. }
  1568. b := dAtA[iNdEx]
  1569. iNdEx++
  1570. v |= (uint64(b) & 0x7F) << shift
  1571. if b < 0x80 {
  1572. break
  1573. }
  1574. }
  1575. m.Learners = append(m.Learners, v)
  1576. } else if wireType == 2 {
  1577. var packedLen int
  1578. for shift := uint(0); ; shift += 7 {
  1579. if shift >= 64 {
  1580. return ErrIntOverflowRaft
  1581. }
  1582. if iNdEx >= l {
  1583. return io.ErrUnexpectedEOF
  1584. }
  1585. b := dAtA[iNdEx]
  1586. iNdEx++
  1587. packedLen |= (int(b) & 0x7F) << shift
  1588. if b < 0x80 {
  1589. break
  1590. }
  1591. }
  1592. if packedLen < 0 {
  1593. return ErrInvalidLengthRaft
  1594. }
  1595. postIndex := iNdEx + packedLen
  1596. if postIndex > l {
  1597. return io.ErrUnexpectedEOF
  1598. }
  1599. for iNdEx < postIndex {
  1600. var v uint64
  1601. for shift := uint(0); ; shift += 7 {
  1602. if shift >= 64 {
  1603. return ErrIntOverflowRaft
  1604. }
  1605. if iNdEx >= l {
  1606. return io.ErrUnexpectedEOF
  1607. }
  1608. b := dAtA[iNdEx]
  1609. iNdEx++
  1610. v |= (uint64(b) & 0x7F) << shift
  1611. if b < 0x80 {
  1612. break
  1613. }
  1614. }
  1615. m.Learners = append(m.Learners, v)
  1616. }
  1617. } else {
  1618. return fmt.Errorf("proto: wrong wireType = %d for field Learners", wireType)
  1619. }
  1620. default:
  1621. iNdEx = preIndex
  1622. skippy, err := skipRaft(dAtA[iNdEx:])
  1623. if err != nil {
  1624. return err
  1625. }
  1626. if skippy < 0 {
  1627. return ErrInvalidLengthRaft
  1628. }
  1629. if (iNdEx + skippy) > l {
  1630. return io.ErrUnexpectedEOF
  1631. }
  1632. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1633. iNdEx += skippy
  1634. }
  1635. }
  1636. if iNdEx > l {
  1637. return io.ErrUnexpectedEOF
  1638. }
  1639. return nil
  1640. }
  1641. func (m *ConfChange) Unmarshal(dAtA []byte) error {
  1642. l := len(dAtA)
  1643. iNdEx := 0
  1644. for iNdEx < l {
  1645. preIndex := iNdEx
  1646. var wire uint64
  1647. for shift := uint(0); ; shift += 7 {
  1648. if shift >= 64 {
  1649. return ErrIntOverflowRaft
  1650. }
  1651. if iNdEx >= l {
  1652. return io.ErrUnexpectedEOF
  1653. }
  1654. b := dAtA[iNdEx]
  1655. iNdEx++
  1656. wire |= (uint64(b) & 0x7F) << shift
  1657. if b < 0x80 {
  1658. break
  1659. }
  1660. }
  1661. fieldNum := int32(wire >> 3)
  1662. wireType := int(wire & 0x7)
  1663. if wireType == 4 {
  1664. return fmt.Errorf("proto: ConfChange: wiretype end group for non-group")
  1665. }
  1666. if fieldNum <= 0 {
  1667. return fmt.Errorf("proto: ConfChange: illegal tag %d (wire type %d)", fieldNum, wire)
  1668. }
  1669. switch fieldNum {
  1670. case 1:
  1671. if wireType != 0 {
  1672. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  1673. }
  1674. m.ID = 0
  1675. for shift := uint(0); ; shift += 7 {
  1676. if shift >= 64 {
  1677. return ErrIntOverflowRaft
  1678. }
  1679. if iNdEx >= l {
  1680. return io.ErrUnexpectedEOF
  1681. }
  1682. b := dAtA[iNdEx]
  1683. iNdEx++
  1684. m.ID |= (uint64(b) & 0x7F) << shift
  1685. if b < 0x80 {
  1686. break
  1687. }
  1688. }
  1689. case 2:
  1690. if wireType != 0 {
  1691. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1692. }
  1693. m.Type = 0
  1694. for shift := uint(0); ; shift += 7 {
  1695. if shift >= 64 {
  1696. return ErrIntOverflowRaft
  1697. }
  1698. if iNdEx >= l {
  1699. return io.ErrUnexpectedEOF
  1700. }
  1701. b := dAtA[iNdEx]
  1702. iNdEx++
  1703. m.Type |= (ConfChangeType(b) & 0x7F) << shift
  1704. if b < 0x80 {
  1705. break
  1706. }
  1707. }
  1708. case 3:
  1709. if wireType != 0 {
  1710. return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  1711. }
  1712. m.NodeID = 0
  1713. for shift := uint(0); ; shift += 7 {
  1714. if shift >= 64 {
  1715. return ErrIntOverflowRaft
  1716. }
  1717. if iNdEx >= l {
  1718. return io.ErrUnexpectedEOF
  1719. }
  1720. b := dAtA[iNdEx]
  1721. iNdEx++
  1722. m.NodeID |= (uint64(b) & 0x7F) << shift
  1723. if b < 0x80 {
  1724. break
  1725. }
  1726. }
  1727. case 4:
  1728. if wireType != 2 {
  1729. return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
  1730. }
  1731. var byteLen int
  1732. for shift := uint(0); ; shift += 7 {
  1733. if shift >= 64 {
  1734. return ErrIntOverflowRaft
  1735. }
  1736. if iNdEx >= l {
  1737. return io.ErrUnexpectedEOF
  1738. }
  1739. b := dAtA[iNdEx]
  1740. iNdEx++
  1741. byteLen |= (int(b) & 0x7F) << shift
  1742. if b < 0x80 {
  1743. break
  1744. }
  1745. }
  1746. if byteLen < 0 {
  1747. return ErrInvalidLengthRaft
  1748. }
  1749. postIndex := iNdEx + byteLen
  1750. if postIndex > l {
  1751. return io.ErrUnexpectedEOF
  1752. }
  1753. m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...)
  1754. if m.Context == nil {
  1755. m.Context = []byte{}
  1756. }
  1757. iNdEx = postIndex
  1758. default:
  1759. iNdEx = preIndex
  1760. skippy, err := skipRaft(dAtA[iNdEx:])
  1761. if err != nil {
  1762. return err
  1763. }
  1764. if skippy < 0 {
  1765. return ErrInvalidLengthRaft
  1766. }
  1767. if (iNdEx + skippy) > l {
  1768. return io.ErrUnexpectedEOF
  1769. }
  1770. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1771. iNdEx += skippy
  1772. }
  1773. }
  1774. if iNdEx > l {
  1775. return io.ErrUnexpectedEOF
  1776. }
  1777. return nil
  1778. }
  1779. func skipRaft(dAtA []byte) (n int, err error) {
  1780. l := len(dAtA)
  1781. iNdEx := 0
  1782. for iNdEx < l {
  1783. var wire uint64
  1784. for shift := uint(0); ; shift += 7 {
  1785. if shift >= 64 {
  1786. return 0, ErrIntOverflowRaft
  1787. }
  1788. if iNdEx >= l {
  1789. return 0, io.ErrUnexpectedEOF
  1790. }
  1791. b := dAtA[iNdEx]
  1792. iNdEx++
  1793. wire |= (uint64(b) & 0x7F) << shift
  1794. if b < 0x80 {
  1795. break
  1796. }
  1797. }
  1798. wireType := int(wire & 0x7)
  1799. switch wireType {
  1800. case 0:
  1801. for shift := uint(0); ; shift += 7 {
  1802. if shift >= 64 {
  1803. return 0, ErrIntOverflowRaft
  1804. }
  1805. if iNdEx >= l {
  1806. return 0, io.ErrUnexpectedEOF
  1807. }
  1808. iNdEx++
  1809. if dAtA[iNdEx-1] < 0x80 {
  1810. break
  1811. }
  1812. }
  1813. return iNdEx, nil
  1814. case 1:
  1815. iNdEx += 8
  1816. return iNdEx, nil
  1817. case 2:
  1818. var length int
  1819. for shift := uint(0); ; shift += 7 {
  1820. if shift >= 64 {
  1821. return 0, ErrIntOverflowRaft
  1822. }
  1823. if iNdEx >= l {
  1824. return 0, io.ErrUnexpectedEOF
  1825. }
  1826. b := dAtA[iNdEx]
  1827. iNdEx++
  1828. length |= (int(b) & 0x7F) << shift
  1829. if b < 0x80 {
  1830. break
  1831. }
  1832. }
  1833. iNdEx += length
  1834. if length < 0 {
  1835. return 0, ErrInvalidLengthRaft
  1836. }
  1837. return iNdEx, nil
  1838. case 3:
  1839. for {
  1840. var innerWire uint64
  1841. var start int = iNdEx
  1842. for shift := uint(0); ; shift += 7 {
  1843. if shift >= 64 {
  1844. return 0, ErrIntOverflowRaft
  1845. }
  1846. if iNdEx >= l {
  1847. return 0, io.ErrUnexpectedEOF
  1848. }
  1849. b := dAtA[iNdEx]
  1850. iNdEx++
  1851. innerWire |= (uint64(b) & 0x7F) << shift
  1852. if b < 0x80 {
  1853. break
  1854. }
  1855. }
  1856. innerWireType := int(innerWire & 0x7)
  1857. if innerWireType == 4 {
  1858. break
  1859. }
  1860. next, err := skipRaft(dAtA[start:])
  1861. if err != nil {
  1862. return 0, err
  1863. }
  1864. iNdEx = start + next
  1865. }
  1866. return iNdEx, nil
  1867. case 4:
  1868. return iNdEx, nil
  1869. case 5:
  1870. iNdEx += 4
  1871. return iNdEx, nil
  1872. default:
  1873. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1874. }
  1875. }
  1876. panic("unreachable")
  1877. }
  1878. var (
  1879. ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling")
  1880. ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow")
  1881. )
  1882. func init() { proto.RegisterFile("raft.proto", fileDescriptorRaft) }
  1883. var fileDescriptorRaft = []byte{
  1884. // 815 bytes of a gzipped FileDescriptorProto
  1885. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x54, 0xcd, 0x6e, 0x23, 0x45,
  1886. 0x10, 0xf6, 0x8c, 0xc7, 0x7f, 0x35, 0x8e, 0xd3, 0xa9, 0x35, 0xa8, 0x15, 0x45, 0xc6, 0xb2, 0x38,
  1887. 0x58, 0x41, 0x1b, 0x20, 0x07, 0x0e, 0x48, 0x1c, 0x36, 0x09, 0x52, 0x22, 0xad, 0xa3, 0xc5, 0x9b,
  1888. 0xe5, 0x80, 0x84, 0x50, 0xc7, 0x53, 0x9e, 0x18, 0x32, 0xd3, 0xa3, 0x9e, 0xf6, 0xb2, 0xb9, 0x20,
  1889. 0x1e, 0x80, 0x07, 0xe0, 0xc2, 0xfb, 0xe4, 0xb8, 0x12, 0x77, 0xc4, 0x86, 0x17, 0x41, 0xdd, 0xd3,
  1890. 0x63, 0xcf, 0x24, 0xb7, 0xae, 0xef, 0xab, 0xae, 0xfa, 0xea, 0xeb, 0x9a, 0x01, 0x50, 0x62, 0xa9,
  1891. 0x8f, 0x32, 0x25, 0xb5, 0xc4, 0xb6, 0x39, 0x67, 0xd7, 0xfb, 0xc3, 0x58, 0xc6, 0xd2, 0x42, 0x9f,
  1892. 0x9b, 0x53, 0xc1, 0x4e, 0x7e, 0x83, 0xd6, 0xb7, 0xa9, 0x56, 0x77, 0xf8, 0x19, 0x04, 0x57, 0x77,
  1893. 0x19, 0x71, 0x6f, 0xec, 0x4d, 0x07, 0xc7, 0x7b, 0x47, 0xc5, 0xad, 0x23, 0x4b, 0x1a, 0xe2, 0x24,
  1894. 0xb8, 0xff, 0xe7, 0x93, 0xc6, 0xdc, 0x26, 0x21, 0x87, 0xe0, 0x8a, 0x54, 0xc2, 0xfd, 0xb1, 0x37,
  1895. 0x0d, 0x36, 0x0c, 0xa9, 0x04, 0xf7, 0xa1, 0x75, 0x91, 0x46, 0xf4, 0x8e, 0x37, 0x2b, 0x54, 0x01,
  1896. 0x21, 0x42, 0x70, 0x26, 0xb4, 0xe0, 0xc1, 0xd8, 0x9b, 0xf6, 0xe7, 0xf6, 0x3c, 0xf9, 0xdd, 0x03,
  1897. 0xf6, 0x3a, 0x15, 0x59, 0x7e, 0x23, 0xf5, 0x8c, 0xb4, 0x88, 0x84, 0x16, 0xf8, 0x15, 0xc0, 0x42,
  1898. 0xa6, 0xcb, 0x9f, 0x72, 0x2d, 0x74, 0xa1, 0x28, 0xdc, 0x2a, 0x3a, 0x95, 0xe9, 0xf2, 0xb5, 0x21,
  1899. 0x5c, 0xf1, 0xde, 0xa2, 0x04, 0x4c, 0xf3, 0x95, 0x6d, 0x5e, 0xd5, 0x55, 0x40, 0x46, 0xb2, 0x36,
  1900. 0x92, 0xab, 0xba, 0x2c, 0x32, 0xf9, 0x01, 0xba, 0xa5, 0x02, 0x23, 0xd1, 0x28, 0xb0, 0x3d, 0xfb,
  1901. 0x73, 0x7b, 0xc6, 0xaf, 0xa1, 0x9b, 0x38, 0x65, 0xb6, 0x70, 0x78, 0xcc, 0x4b, 0x2d, 0x8f, 0x95,
  1902. 0xbb, 0xba, 0x9b, 0xfc, 0xc9, 0x5f, 0x4d, 0xe8, 0xcc, 0x28, 0xcf, 0x45, 0x4c, 0xf8, 0x1c, 0x02,
  1903. 0xbd, 0x75, 0xf8, 0x59, 0x59, 0xc3, 0xd1, 0x55, 0x8f, 0x4d, 0x1a, 0x0e, 0xc1, 0xd7, 0xb2, 0x36,
  1904. 0x89, 0xaf, 0xa5, 0x19, 0x63, 0xa9, 0xe4, 0xa3, 0x31, 0x0c, 0xb2, 0x19, 0x30, 0x78, 0x3c, 0x20,
  1905. 0x8e, 0xa0, 0x73, 0x2b, 0x63, 0xfb, 0x60, 0xad, 0x0a, 0x59, 0x82, 0x5b, 0xdb, 0xda, 0x4f, 0x6d,
  1906. 0x7b, 0x0e, 0x1d, 0x4a, 0xb5, 0x5a, 0x51, 0xce, 0x3b, 0xe3, 0xe6, 0x34, 0x3c, 0xde, 0xa9, 0x6d,
  1907. 0x46, 0x59, 0xca, 0xe5, 0xe0, 0x01, 0xb4, 0x17, 0x32, 0x49, 0x56, 0x9a, 0x77, 0x2b, 0xb5, 0x1c,
  1908. 0x86, 0xc7, 0xd0, 0xcd, 0x9d, 0x63, 0xbc, 0x67, 0x9d, 0x64, 0x8f, 0x9d, 0x2c, 0x1d, 0x2c, 0xf3,
  1909. 0x4c, 0x45, 0x45, 0x3f, 0xd3, 0x42, 0x73, 0x18, 0x7b, 0xd3, 0x6e, 0x59, 0xb1, 0xc0, 0xf0, 0x53,
  1910. 0x80, 0xe2, 0x74, 0xbe, 0x4a, 0x35, 0x0f, 0x2b, 0x3d, 0x2b, 0x38, 0x72, 0xe8, 0x2c, 0x64, 0xaa,
  1911. 0xe9, 0x9d, 0xe6, 0x7d, 0xfb, 0xb0, 0x65, 0x38, 0xf9, 0x11, 0x7a, 0xe7, 0x42, 0x45, 0xc5, 0xfa,
  1912. 0x94, 0x0e, 0x7a, 0x4f, 0x1c, 0xe4, 0x10, 0xbc, 0x95, 0x9a, 0xea, 0xfb, 0x6e, 0x90, 0xca, 0xc0,
  1913. 0xcd, 0xa7, 0x03, 0x4f, 0xbe, 0x81, 0xde, 0x66, 0x5d, 0x71, 0x08, 0xad, 0x54, 0x46, 0x94, 0x73,
  1914. 0x6f, 0xdc, 0x9c, 0x06, 0xf3, 0x22, 0xc0, 0x7d, 0xe8, 0xde, 0x92, 0x50, 0x29, 0xa9, 0x9c, 0xfb,
  1915. 0x96, 0xd8, 0xc4, 0x93, 0x3f, 0x3c, 0x00, 0x73, 0xff, 0xf4, 0x46, 0xa4, 0xb1, 0xdd, 0x88, 0x8b,
  1916. 0xb3, 0x9a, 0x3a, 0xff, 0xe2, 0x0c, 0xbf, 0x70, 0x1f, 0xae, 0x6f, 0xd7, 0xea, 0xe3, 0xea, 0x67,
  1917. 0x52, 0xdc, 0x7b, 0xf2, 0xf5, 0x1e, 0x40, 0xfb, 0x52, 0x46, 0x74, 0x71, 0x56, 0xd7, 0x5c, 0x60,
  1918. 0xc6, 0xac, 0x53, 0x67, 0x56, 0xf1, 0xa1, 0x96, 0xe1, 0xe1, 0x97, 0xd0, 0xdb, 0xfc, 0x0e, 0x70,
  1919. 0x17, 0x42, 0x1b, 0x5c, 0x4a, 0x95, 0x88, 0x5b, 0xd6, 0xc0, 0x67, 0xb0, 0x6b, 0x81, 0x6d, 0x63,
  1920. 0xe6, 0x1d, 0xfe, 0xed, 0x43, 0x58, 0x59, 0x70, 0x04, 0x68, 0xcf, 0xf2, 0xf8, 0x7c, 0x9d, 0xb1,
  1921. 0x06, 0x86, 0xd0, 0x99, 0xe5, 0xf1, 0x09, 0x09, 0xcd, 0x3c, 0x17, 0xbc, 0x52, 0x32, 0x63, 0xbe,
  1922. 0xcb, 0x7a, 0x91, 0x65, 0xac, 0x89, 0x03, 0x80, 0xe2, 0x3c, 0xa7, 0x3c, 0x63, 0x81, 0x4b, 0xfc,
  1923. 0x5e, 0x6a, 0x62, 0x2d, 0x23, 0xc2, 0x05, 0x96, 0x6d, 0x3b, 0xd6, 0x2c, 0x13, 0xeb, 0x20, 0x83,
  1924. 0xbe, 0x69, 0x46, 0x42, 0xe9, 0x6b, 0xd3, 0xa5, 0x8b, 0x43, 0x60, 0x55, 0xc4, 0x5e, 0xea, 0x21,
  1925. 0xc2, 0x60, 0x96, 0xc7, 0x6f, 0x52, 0x45, 0x62, 0x71, 0x23, 0xae, 0x6f, 0x89, 0x01, 0xee, 0xc1,
  1926. 0x8e, 0x2b, 0x64, 0x1e, 0x6f, 0x9d, 0xb3, 0xd0, 0xa5, 0x9d, 0xde, 0xd0, 0xe2, 0x97, 0xef, 0xd6,
  1927. 0x52, 0xad, 0x13, 0xd6, 0xc7, 0x8f, 0x60, 0x6f, 0x96, 0xc7, 0x57, 0x4a, 0xa4, 0xf9, 0x92, 0xd4,
  1928. 0x4b, 0x12, 0x11, 0x29, 0xb6, 0xe3, 0x6e, 0x5f, 0xad, 0x12, 0x92, 0x6b, 0x7d, 0x29, 0x7f, 0x65,
  1929. 0x03, 0x27, 0x66, 0x4e, 0x22, 0xb2, 0x3f, 0x43, 0xb6, 0xeb, 0xc4, 0x6c, 0x10, 0x2b, 0x86, 0xb9,
  1930. 0x79, 0x5f, 0x29, 0xb2, 0x23, 0xee, 0xb9, 0xae, 0x2e, 0xb6, 0x39, 0x78, 0x78, 0x07, 0x83, 0xfa,
  1931. 0xf3, 0x1a, 0x1d, 0x5b, 0xe4, 0x45, 0x14, 0x99, 0xb7, 0x64, 0x0d, 0xe4, 0x30, 0xdc, 0xc2, 0x73,
  1932. 0x4a, 0xe4, 0x5b, 0xb2, 0x8c, 0x57, 0x67, 0xde, 0x64, 0x91, 0xd0, 0x05, 0xe3, 0xe3, 0x01, 0xf0,
  1933. 0x5a, 0xa9, 0x97, 0xc5, 0x36, 0x5a, 0xb6, 0x79, 0xc2, 0xef, 0x3f, 0x8c, 0x1a, 0xef, 0x3f, 0x8c,
  1934. 0x1a, 0xf7, 0x0f, 0x23, 0xef, 0xfd, 0xc3, 0xc8, 0xfb, 0xf7, 0x61, 0xe4, 0xfd, 0xf9, 0xdf, 0xa8,
  1935. 0xf1, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x86, 0x52, 0x5b, 0xe0, 0x74, 0x06, 0x00, 0x00,
  1936. }