v3election.pb.go 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: v3election.proto
  3. package v3electionpb
  4. import (
  5. context "context"
  6. fmt "fmt"
  7. io "io"
  8. math "math"
  9. math_bits "math/bits"
  10. etcdserverpb "github.com/coreos/etcd/etcdserver/etcdserverpb"
  11. mvccpb "github.com/coreos/etcd/mvcc/mvccpb"
  12. _ "github.com/gogo/protobuf/gogoproto"
  13. proto "github.com/golang/protobuf/proto"
  14. _ "google.golang.org/genproto/googleapis/api/annotations"
  15. grpc "google.golang.org/grpc"
  16. codes "google.golang.org/grpc/codes"
  17. status "google.golang.org/grpc/status"
  18. )
  19. // Reference imports to suppress errors if they are not otherwise used.
  20. var _ = proto.Marshal
  21. var _ = fmt.Errorf
  22. var _ = math.Inf
  23. // This is a compile-time assertion to ensure that this generated file
  24. // is compatible with the proto package it is being compiled against.
  25. // A compilation error at this line likely means your copy of the
  26. // proto package needs to be updated.
  27. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  28. type CampaignRequest struct {
  29. // name is the election's identifier for the campaign.
  30. Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  31. // lease is the ID of the lease attached to leadership of the election. If the
  32. // lease expires or is revoked before resigning leadership, then the
  33. // leadership is transferred to the next campaigner, if any.
  34. Lease int64 `protobuf:"varint,2,opt,name=lease,proto3" json:"lease,omitempty"`
  35. // value is the initial proclaimed value set when the campaigner wins the
  36. // election.
  37. Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
  38. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  39. XXX_unrecognized []byte `json:"-"`
  40. XXX_sizecache int32 `json:"-"`
  41. }
  42. func (m *CampaignRequest) Reset() { *m = CampaignRequest{} }
  43. func (m *CampaignRequest) String() string { return proto.CompactTextString(m) }
  44. func (*CampaignRequest) ProtoMessage() {}
  45. func (*CampaignRequest) Descriptor() ([]byte, []int) {
  46. return fileDescriptor_c9b1f26cc432a035, []int{0}
  47. }
  48. func (m *CampaignRequest) XXX_Unmarshal(b []byte) error {
  49. return m.Unmarshal(b)
  50. }
  51. func (m *CampaignRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  52. if deterministic {
  53. return xxx_messageInfo_CampaignRequest.Marshal(b, m, deterministic)
  54. } else {
  55. b = b[:cap(b)]
  56. n, err := m.MarshalToSizedBuffer(b)
  57. if err != nil {
  58. return nil, err
  59. }
  60. return b[:n], nil
  61. }
  62. }
  63. func (m *CampaignRequest) XXX_Merge(src proto.Message) {
  64. xxx_messageInfo_CampaignRequest.Merge(m, src)
  65. }
  66. func (m *CampaignRequest) XXX_Size() int {
  67. return m.Size()
  68. }
  69. func (m *CampaignRequest) XXX_DiscardUnknown() {
  70. xxx_messageInfo_CampaignRequest.DiscardUnknown(m)
  71. }
  72. var xxx_messageInfo_CampaignRequest proto.InternalMessageInfo
  73. func (m *CampaignRequest) GetName() []byte {
  74. if m != nil {
  75. return m.Name
  76. }
  77. return nil
  78. }
  79. func (m *CampaignRequest) GetLease() int64 {
  80. if m != nil {
  81. return m.Lease
  82. }
  83. return 0
  84. }
  85. func (m *CampaignRequest) GetValue() []byte {
  86. if m != nil {
  87. return m.Value
  88. }
  89. return nil
  90. }
  91. type CampaignResponse struct {
  92. Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
  93. // leader describes the resources used for holding leadereship of the election.
  94. Leader *LeaderKey `protobuf:"bytes,2,opt,name=leader,proto3" json:"leader,omitempty"`
  95. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  96. XXX_unrecognized []byte `json:"-"`
  97. XXX_sizecache int32 `json:"-"`
  98. }
  99. func (m *CampaignResponse) Reset() { *m = CampaignResponse{} }
  100. func (m *CampaignResponse) String() string { return proto.CompactTextString(m) }
  101. func (*CampaignResponse) ProtoMessage() {}
  102. func (*CampaignResponse) Descriptor() ([]byte, []int) {
  103. return fileDescriptor_c9b1f26cc432a035, []int{1}
  104. }
  105. func (m *CampaignResponse) XXX_Unmarshal(b []byte) error {
  106. return m.Unmarshal(b)
  107. }
  108. func (m *CampaignResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  109. if deterministic {
  110. return xxx_messageInfo_CampaignResponse.Marshal(b, m, deterministic)
  111. } else {
  112. b = b[:cap(b)]
  113. n, err := m.MarshalToSizedBuffer(b)
  114. if err != nil {
  115. return nil, err
  116. }
  117. return b[:n], nil
  118. }
  119. }
  120. func (m *CampaignResponse) XXX_Merge(src proto.Message) {
  121. xxx_messageInfo_CampaignResponse.Merge(m, src)
  122. }
  123. func (m *CampaignResponse) XXX_Size() int {
  124. return m.Size()
  125. }
  126. func (m *CampaignResponse) XXX_DiscardUnknown() {
  127. xxx_messageInfo_CampaignResponse.DiscardUnknown(m)
  128. }
  129. var xxx_messageInfo_CampaignResponse proto.InternalMessageInfo
  130. func (m *CampaignResponse) GetHeader() *etcdserverpb.ResponseHeader {
  131. if m != nil {
  132. return m.Header
  133. }
  134. return nil
  135. }
  136. func (m *CampaignResponse) GetLeader() *LeaderKey {
  137. if m != nil {
  138. return m.Leader
  139. }
  140. return nil
  141. }
  142. type LeaderKey struct {
  143. // name is the election identifier that correponds to the leadership key.
  144. Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  145. // key is an opaque key representing the ownership of the election. If the key
  146. // is deleted, then leadership is lost.
  147. Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
  148. // rev is the creation revision of the key. It can be used to test for ownership
  149. // of an election during transactions by testing the key's creation revision
  150. // matches rev.
  151. Rev int64 `protobuf:"varint,3,opt,name=rev,proto3" json:"rev,omitempty"`
  152. // lease is the lease ID of the election leader.
  153. Lease int64 `protobuf:"varint,4,opt,name=lease,proto3" json:"lease,omitempty"`
  154. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  155. XXX_unrecognized []byte `json:"-"`
  156. XXX_sizecache int32 `json:"-"`
  157. }
  158. func (m *LeaderKey) Reset() { *m = LeaderKey{} }
  159. func (m *LeaderKey) String() string { return proto.CompactTextString(m) }
  160. func (*LeaderKey) ProtoMessage() {}
  161. func (*LeaderKey) Descriptor() ([]byte, []int) {
  162. return fileDescriptor_c9b1f26cc432a035, []int{2}
  163. }
  164. func (m *LeaderKey) XXX_Unmarshal(b []byte) error {
  165. return m.Unmarshal(b)
  166. }
  167. func (m *LeaderKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  168. if deterministic {
  169. return xxx_messageInfo_LeaderKey.Marshal(b, m, deterministic)
  170. } else {
  171. b = b[:cap(b)]
  172. n, err := m.MarshalToSizedBuffer(b)
  173. if err != nil {
  174. return nil, err
  175. }
  176. return b[:n], nil
  177. }
  178. }
  179. func (m *LeaderKey) XXX_Merge(src proto.Message) {
  180. xxx_messageInfo_LeaderKey.Merge(m, src)
  181. }
  182. func (m *LeaderKey) XXX_Size() int {
  183. return m.Size()
  184. }
  185. func (m *LeaderKey) XXX_DiscardUnknown() {
  186. xxx_messageInfo_LeaderKey.DiscardUnknown(m)
  187. }
  188. var xxx_messageInfo_LeaderKey proto.InternalMessageInfo
  189. func (m *LeaderKey) GetName() []byte {
  190. if m != nil {
  191. return m.Name
  192. }
  193. return nil
  194. }
  195. func (m *LeaderKey) GetKey() []byte {
  196. if m != nil {
  197. return m.Key
  198. }
  199. return nil
  200. }
  201. func (m *LeaderKey) GetRev() int64 {
  202. if m != nil {
  203. return m.Rev
  204. }
  205. return 0
  206. }
  207. func (m *LeaderKey) GetLease() int64 {
  208. if m != nil {
  209. return m.Lease
  210. }
  211. return 0
  212. }
  213. type LeaderRequest struct {
  214. // name is the election identifier for the leadership information.
  215. Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  216. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  217. XXX_unrecognized []byte `json:"-"`
  218. XXX_sizecache int32 `json:"-"`
  219. }
  220. func (m *LeaderRequest) Reset() { *m = LeaderRequest{} }
  221. func (m *LeaderRequest) String() string { return proto.CompactTextString(m) }
  222. func (*LeaderRequest) ProtoMessage() {}
  223. func (*LeaderRequest) Descriptor() ([]byte, []int) {
  224. return fileDescriptor_c9b1f26cc432a035, []int{3}
  225. }
  226. func (m *LeaderRequest) XXX_Unmarshal(b []byte) error {
  227. return m.Unmarshal(b)
  228. }
  229. func (m *LeaderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  230. if deterministic {
  231. return xxx_messageInfo_LeaderRequest.Marshal(b, m, deterministic)
  232. } else {
  233. b = b[:cap(b)]
  234. n, err := m.MarshalToSizedBuffer(b)
  235. if err != nil {
  236. return nil, err
  237. }
  238. return b[:n], nil
  239. }
  240. }
  241. func (m *LeaderRequest) XXX_Merge(src proto.Message) {
  242. xxx_messageInfo_LeaderRequest.Merge(m, src)
  243. }
  244. func (m *LeaderRequest) XXX_Size() int {
  245. return m.Size()
  246. }
  247. func (m *LeaderRequest) XXX_DiscardUnknown() {
  248. xxx_messageInfo_LeaderRequest.DiscardUnknown(m)
  249. }
  250. var xxx_messageInfo_LeaderRequest proto.InternalMessageInfo
  251. func (m *LeaderRequest) GetName() []byte {
  252. if m != nil {
  253. return m.Name
  254. }
  255. return nil
  256. }
  257. type LeaderResponse struct {
  258. Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
  259. // kv is the key-value pair representing the latest leader update.
  260. Kv *mvccpb.KeyValue `protobuf:"bytes,2,opt,name=kv,proto3" json:"kv,omitempty"`
  261. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  262. XXX_unrecognized []byte `json:"-"`
  263. XXX_sizecache int32 `json:"-"`
  264. }
  265. func (m *LeaderResponse) Reset() { *m = LeaderResponse{} }
  266. func (m *LeaderResponse) String() string { return proto.CompactTextString(m) }
  267. func (*LeaderResponse) ProtoMessage() {}
  268. func (*LeaderResponse) Descriptor() ([]byte, []int) {
  269. return fileDescriptor_c9b1f26cc432a035, []int{4}
  270. }
  271. func (m *LeaderResponse) XXX_Unmarshal(b []byte) error {
  272. return m.Unmarshal(b)
  273. }
  274. func (m *LeaderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  275. if deterministic {
  276. return xxx_messageInfo_LeaderResponse.Marshal(b, m, deterministic)
  277. } else {
  278. b = b[:cap(b)]
  279. n, err := m.MarshalToSizedBuffer(b)
  280. if err != nil {
  281. return nil, err
  282. }
  283. return b[:n], nil
  284. }
  285. }
  286. func (m *LeaderResponse) XXX_Merge(src proto.Message) {
  287. xxx_messageInfo_LeaderResponse.Merge(m, src)
  288. }
  289. func (m *LeaderResponse) XXX_Size() int {
  290. return m.Size()
  291. }
  292. func (m *LeaderResponse) XXX_DiscardUnknown() {
  293. xxx_messageInfo_LeaderResponse.DiscardUnknown(m)
  294. }
  295. var xxx_messageInfo_LeaderResponse proto.InternalMessageInfo
  296. func (m *LeaderResponse) GetHeader() *etcdserverpb.ResponseHeader {
  297. if m != nil {
  298. return m.Header
  299. }
  300. return nil
  301. }
  302. func (m *LeaderResponse) GetKv() *mvccpb.KeyValue {
  303. if m != nil {
  304. return m.Kv
  305. }
  306. return nil
  307. }
  308. type ResignRequest struct {
  309. // leader is the leadership to relinquish by resignation.
  310. Leader *LeaderKey `protobuf:"bytes,1,opt,name=leader,proto3" json:"leader,omitempty"`
  311. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  312. XXX_unrecognized []byte `json:"-"`
  313. XXX_sizecache int32 `json:"-"`
  314. }
  315. func (m *ResignRequest) Reset() { *m = ResignRequest{} }
  316. func (m *ResignRequest) String() string { return proto.CompactTextString(m) }
  317. func (*ResignRequest) ProtoMessage() {}
  318. func (*ResignRequest) Descriptor() ([]byte, []int) {
  319. return fileDescriptor_c9b1f26cc432a035, []int{5}
  320. }
  321. func (m *ResignRequest) XXX_Unmarshal(b []byte) error {
  322. return m.Unmarshal(b)
  323. }
  324. func (m *ResignRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  325. if deterministic {
  326. return xxx_messageInfo_ResignRequest.Marshal(b, m, deterministic)
  327. } else {
  328. b = b[:cap(b)]
  329. n, err := m.MarshalToSizedBuffer(b)
  330. if err != nil {
  331. return nil, err
  332. }
  333. return b[:n], nil
  334. }
  335. }
  336. func (m *ResignRequest) XXX_Merge(src proto.Message) {
  337. xxx_messageInfo_ResignRequest.Merge(m, src)
  338. }
  339. func (m *ResignRequest) XXX_Size() int {
  340. return m.Size()
  341. }
  342. func (m *ResignRequest) XXX_DiscardUnknown() {
  343. xxx_messageInfo_ResignRequest.DiscardUnknown(m)
  344. }
  345. var xxx_messageInfo_ResignRequest proto.InternalMessageInfo
  346. func (m *ResignRequest) GetLeader() *LeaderKey {
  347. if m != nil {
  348. return m.Leader
  349. }
  350. return nil
  351. }
  352. type ResignResponse struct {
  353. Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
  354. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  355. XXX_unrecognized []byte `json:"-"`
  356. XXX_sizecache int32 `json:"-"`
  357. }
  358. func (m *ResignResponse) Reset() { *m = ResignResponse{} }
  359. func (m *ResignResponse) String() string { return proto.CompactTextString(m) }
  360. func (*ResignResponse) ProtoMessage() {}
  361. func (*ResignResponse) Descriptor() ([]byte, []int) {
  362. return fileDescriptor_c9b1f26cc432a035, []int{6}
  363. }
  364. func (m *ResignResponse) XXX_Unmarshal(b []byte) error {
  365. return m.Unmarshal(b)
  366. }
  367. func (m *ResignResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  368. if deterministic {
  369. return xxx_messageInfo_ResignResponse.Marshal(b, m, deterministic)
  370. } else {
  371. b = b[:cap(b)]
  372. n, err := m.MarshalToSizedBuffer(b)
  373. if err != nil {
  374. return nil, err
  375. }
  376. return b[:n], nil
  377. }
  378. }
  379. func (m *ResignResponse) XXX_Merge(src proto.Message) {
  380. xxx_messageInfo_ResignResponse.Merge(m, src)
  381. }
  382. func (m *ResignResponse) XXX_Size() int {
  383. return m.Size()
  384. }
  385. func (m *ResignResponse) XXX_DiscardUnknown() {
  386. xxx_messageInfo_ResignResponse.DiscardUnknown(m)
  387. }
  388. var xxx_messageInfo_ResignResponse proto.InternalMessageInfo
  389. func (m *ResignResponse) GetHeader() *etcdserverpb.ResponseHeader {
  390. if m != nil {
  391. return m.Header
  392. }
  393. return nil
  394. }
  395. type ProclaimRequest struct {
  396. // leader is the leadership hold on the election.
  397. Leader *LeaderKey `protobuf:"bytes,1,opt,name=leader,proto3" json:"leader,omitempty"`
  398. // value is an update meant to overwrite the leader's current value.
  399. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
  400. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  401. XXX_unrecognized []byte `json:"-"`
  402. XXX_sizecache int32 `json:"-"`
  403. }
  404. func (m *ProclaimRequest) Reset() { *m = ProclaimRequest{} }
  405. func (m *ProclaimRequest) String() string { return proto.CompactTextString(m) }
  406. func (*ProclaimRequest) ProtoMessage() {}
  407. func (*ProclaimRequest) Descriptor() ([]byte, []int) {
  408. return fileDescriptor_c9b1f26cc432a035, []int{7}
  409. }
  410. func (m *ProclaimRequest) XXX_Unmarshal(b []byte) error {
  411. return m.Unmarshal(b)
  412. }
  413. func (m *ProclaimRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  414. if deterministic {
  415. return xxx_messageInfo_ProclaimRequest.Marshal(b, m, deterministic)
  416. } else {
  417. b = b[:cap(b)]
  418. n, err := m.MarshalToSizedBuffer(b)
  419. if err != nil {
  420. return nil, err
  421. }
  422. return b[:n], nil
  423. }
  424. }
  425. func (m *ProclaimRequest) XXX_Merge(src proto.Message) {
  426. xxx_messageInfo_ProclaimRequest.Merge(m, src)
  427. }
  428. func (m *ProclaimRequest) XXX_Size() int {
  429. return m.Size()
  430. }
  431. func (m *ProclaimRequest) XXX_DiscardUnknown() {
  432. xxx_messageInfo_ProclaimRequest.DiscardUnknown(m)
  433. }
  434. var xxx_messageInfo_ProclaimRequest proto.InternalMessageInfo
  435. func (m *ProclaimRequest) GetLeader() *LeaderKey {
  436. if m != nil {
  437. return m.Leader
  438. }
  439. return nil
  440. }
  441. func (m *ProclaimRequest) GetValue() []byte {
  442. if m != nil {
  443. return m.Value
  444. }
  445. return nil
  446. }
  447. type ProclaimResponse struct {
  448. Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
  449. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  450. XXX_unrecognized []byte `json:"-"`
  451. XXX_sizecache int32 `json:"-"`
  452. }
  453. func (m *ProclaimResponse) Reset() { *m = ProclaimResponse{} }
  454. func (m *ProclaimResponse) String() string { return proto.CompactTextString(m) }
  455. func (*ProclaimResponse) ProtoMessage() {}
  456. func (*ProclaimResponse) Descriptor() ([]byte, []int) {
  457. return fileDescriptor_c9b1f26cc432a035, []int{8}
  458. }
  459. func (m *ProclaimResponse) XXX_Unmarshal(b []byte) error {
  460. return m.Unmarshal(b)
  461. }
  462. func (m *ProclaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  463. if deterministic {
  464. return xxx_messageInfo_ProclaimResponse.Marshal(b, m, deterministic)
  465. } else {
  466. b = b[:cap(b)]
  467. n, err := m.MarshalToSizedBuffer(b)
  468. if err != nil {
  469. return nil, err
  470. }
  471. return b[:n], nil
  472. }
  473. }
  474. func (m *ProclaimResponse) XXX_Merge(src proto.Message) {
  475. xxx_messageInfo_ProclaimResponse.Merge(m, src)
  476. }
  477. func (m *ProclaimResponse) XXX_Size() int {
  478. return m.Size()
  479. }
  480. func (m *ProclaimResponse) XXX_DiscardUnknown() {
  481. xxx_messageInfo_ProclaimResponse.DiscardUnknown(m)
  482. }
  483. var xxx_messageInfo_ProclaimResponse proto.InternalMessageInfo
  484. func (m *ProclaimResponse) GetHeader() *etcdserverpb.ResponseHeader {
  485. if m != nil {
  486. return m.Header
  487. }
  488. return nil
  489. }
  490. func init() {
  491. proto.RegisterType((*CampaignRequest)(nil), "v3electionpb.CampaignRequest")
  492. proto.RegisterType((*CampaignResponse)(nil), "v3electionpb.CampaignResponse")
  493. proto.RegisterType((*LeaderKey)(nil), "v3electionpb.LeaderKey")
  494. proto.RegisterType((*LeaderRequest)(nil), "v3electionpb.LeaderRequest")
  495. proto.RegisterType((*LeaderResponse)(nil), "v3electionpb.LeaderResponse")
  496. proto.RegisterType((*ResignRequest)(nil), "v3electionpb.ResignRequest")
  497. proto.RegisterType((*ResignResponse)(nil), "v3electionpb.ResignResponse")
  498. proto.RegisterType((*ProclaimRequest)(nil), "v3electionpb.ProclaimRequest")
  499. proto.RegisterType((*ProclaimResponse)(nil), "v3electionpb.ProclaimResponse")
  500. }
  501. func init() { proto.RegisterFile("v3election.proto", fileDescriptor_c9b1f26cc432a035) }
  502. var fileDescriptor_c9b1f26cc432a035 = []byte{
  503. // 538 bytes of a gzipped FileDescriptorProto
  504. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xc1, 0x6e, 0xd3, 0x40,
  505. 0x10, 0x65, 0x9d, 0x10, 0xca, 0x90, 0xb6, 0x96, 0x55, 0xa9, 0x69, 0x48, 0xad, 0x68, 0x8b, 0x50,
  506. 0x95, 0x83, 0x17, 0x35, 0x9c, 0x72, 0x42, 0x20, 0x50, 0xa5, 0x22, 0x01, 0x3e, 0x20, 0x38, 0xae,
  507. 0xdd, 0x91, 0x1b, 0xc5, 0xf1, 0x1a, 0xdb, 0xb5, 0x94, 0x2b, 0xbf, 0xc0, 0x85, 0x7f, 0xe0, 0x47,
  508. 0x38, 0x22, 0xf1, 0x03, 0x28, 0xf0, 0x21, 0x68, 0x77, 0x6d, 0xec, 0xb8, 0x21, 0x42, 0xe4, 0x62,
  509. 0x8d, 0x67, 0x9e, 0xe7, 0xcd, 0x7b, 0x3b, 0x6b, 0x30, 0xf3, 0x31, 0x86, 0xe8, 0x67, 0x53, 0x11,
  510. 0x39, 0x71, 0x22, 0x32, 0x61, 0x75, 0xab, 0x4c, 0xec, 0xf5, 0x0f, 0x02, 0x11, 0x08, 0x55, 0x60,
  511. 0x32, 0xd2, 0x98, 0xfe, 0x43, 0xcc, 0xfc, 0x4b, 0x26, 0x1f, 0x29, 0x26, 0x39, 0x26, 0xb5, 0x30,
  512. 0xf6, 0x58, 0x12, 0xfb, 0x05, 0xee, 0x48, 0xe1, 0xe6, 0xb9, 0xef, 0xab, 0x47, 0xec, 0xb1, 0x59,
  513. 0x5e, 0x94, 0x06, 0x81, 0x10, 0x41, 0x88, 0x8c, 0xc7, 0x53, 0xc6, 0xa3, 0x48, 0x64, 0x5c, 0x32,
  514. 0xa6, 0xba, 0x4a, 0xdf, 0xc0, 0xfe, 0x33, 0x3e, 0x8f, 0xf9, 0x34, 0x88, 0x5c, 0xfc, 0x70, 0x8d,
  515. 0x69, 0x66, 0x59, 0xd0, 0x8e, 0xf8, 0x1c, 0x7b, 0x64, 0x48, 0x4e, 0xbb, 0xae, 0x8a, 0xad, 0x03,
  516. 0xb8, 0x1d, 0x22, 0x4f, 0xb1, 0x67, 0x0c, 0xc9, 0x69, 0xcb, 0xd5, 0x2f, 0x32, 0x9b, 0xf3, 0xf0,
  517. 0x1a, 0x7b, 0x2d, 0x05, 0xd5, 0x2f, 0x74, 0x01, 0x66, 0xd5, 0x32, 0x8d, 0x45, 0x94, 0xa2, 0xf5,
  518. 0x18, 0x3a, 0x57, 0xc8, 0x2f, 0x31, 0x51, 0x5d, 0xef, 0x9d, 0x0d, 0x9c, 0xba, 0x10, 0xa7, 0xc4,
  519. 0x9d, 0x2b, 0x8c, 0x5b, 0x60, 0x2d, 0x06, 0x9d, 0x50, 0x7f, 0x65, 0xa8, 0xaf, 0x0e, 0x9d, 0xba,
  520. 0x65, 0xce, 0x4b, 0x55, 0xbb, 0xc0, 0x85, 0x5b, 0xc0, 0xe8, 0x7b, 0xb8, 0xfb, 0x27, 0xb9, 0x56,
  521. 0x87, 0x09, 0xad, 0x19, 0x2e, 0x54, 0xbb, 0xae, 0x2b, 0x43, 0x99, 0x49, 0x30, 0x57, 0x0a, 0x5a,
  522. 0xae, 0x0c, 0x2b, 0xad, 0xed, 0x9a, 0x56, 0x7a, 0x02, 0xbb, 0xba, 0xf5, 0x06, 0x9b, 0xe8, 0x15,
  523. 0xec, 0x95, 0xa0, 0xad, 0x84, 0x0f, 0xc1, 0x98, 0xe5, 0x85, 0x68, 0xd3, 0xd1, 0x27, 0xea, 0x5c,
  524. 0xe0, 0xe2, 0xad, 0x34, 0xd8, 0x35, 0x66, 0x39, 0x7d, 0x02, 0xbb, 0x2e, 0xa6, 0xb5, 0x53, 0xab,
  525. 0xbc, 0x22, 0xff, 0xe6, 0xd5, 0x0b, 0xd8, 0x2b, 0x3b, 0x6c, 0x33, 0x2b, 0x7d, 0x07, 0xfb, 0xaf,
  526. 0x13, 0xe1, 0x87, 0x7c, 0x3a, 0xff, 0xdf, 0x59, 0xaa, 0x45, 0x32, 0xea, 0x8b, 0x74, 0x0e, 0x66,
  527. 0xd5, 0x79, 0x9b, 0x19, 0xcf, 0xbe, 0xb4, 0x61, 0xe7, 0x79, 0x31, 0x80, 0x25, 0x60, 0xa7, 0xdc,
  528. 0x4f, 0xeb, 0x78, 0x75, 0xb2, 0xc6, 0x55, 0xe8, 0xdb, 0x7f, 0x2b, 0x6b, 0x16, 0xfa, 0xe0, 0xe3,
  529. 0xf7, 0x5f, 0x9f, 0x0c, 0x9b, 0x1e, 0xb1, 0x7c, 0xec, 0x61, 0xc6, 0x59, 0x09, 0x66, 0x7e, 0x01,
  530. 0x9d, 0x90, 0x91, 0x24, 0x2c, 0x75, 0x34, 0x09, 0x1b, 0xce, 0x35, 0x09, 0x9b, 0xf2, 0x37, 0x10,
  531. 0xc6, 0x05, 0x54, 0x12, 0x06, 0xd0, 0xd1, 0x1e, 0x5b, 0xf7, 0xd7, 0x39, 0x5f, 0x92, 0x0d, 0xd6,
  532. 0x17, 0x0b, 0x2a, 0xaa, 0xa8, 0x06, 0xf4, 0xf0, 0x06, 0x95, 0x3e, 0x34, 0x49, 0x34, 0x83, 0x3b,
  533. 0xaf, 0x3c, 0x65, 0xfe, 0x36, 0x4c, 0x27, 0x8a, 0xe9, 0x98, 0xf6, 0x6e, 0x30, 0x09, 0xdd, 0x7c,
  534. 0x42, 0x46, 0x8f, 0x88, 0x54, 0xa5, 0x17, 0xb6, 0xc9, 0xb5, 0x72, 0x11, 0x9a, 0x5c, 0xab, 0x3b,
  535. 0xbe, 0x41, 0x55, 0xa2, 0x80, 0x13, 0x32, 0x7a, 0x6a, 0x7e, 0x5d, 0xda, 0xe4, 0xdb, 0xd2, 0x26,
  536. 0x3f, 0x96, 0x36, 0xf9, 0xfc, 0xd3, 0xbe, 0xe5, 0x75, 0xd4, 0xcf, 0x72, 0xfc, 0x3b, 0x00, 0x00,
  537. 0xff, 0xff, 0xdc, 0xa9, 0x0e, 0xdf, 0xc5, 0x05, 0x00, 0x00,
  538. }
  539. // Reference imports to suppress errors if they are not otherwise used.
  540. var _ context.Context
  541. var _ grpc.ClientConn
  542. // This is a compile-time assertion to ensure that this generated file
  543. // is compatible with the grpc package it is being compiled against.
  544. const _ = grpc.SupportPackageIsVersion4
  545. // ElectionClient is the client API for Election service.
  546. //
  547. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  548. type ElectionClient interface {
  549. // Campaign waits to acquire leadership in an election, returning a LeaderKey
  550. // representing the leadership if successful. The LeaderKey can then be used
  551. // to issue new values on the election, transactionally guard API requests on
  552. // leadership still being held, and resign from the election.
  553. Campaign(ctx context.Context, in *CampaignRequest, opts ...grpc.CallOption) (*CampaignResponse, error)
  554. // Proclaim updates the leader's posted value with a new value.
  555. Proclaim(ctx context.Context, in *ProclaimRequest, opts ...grpc.CallOption) (*ProclaimResponse, error)
  556. // Leader returns the current election proclamation, if any.
  557. Leader(ctx context.Context, in *LeaderRequest, opts ...grpc.CallOption) (*LeaderResponse, error)
  558. // Observe streams election proclamations in-order as made by the election's
  559. // elected leaders.
  560. Observe(ctx context.Context, in *LeaderRequest, opts ...grpc.CallOption) (Election_ObserveClient, error)
  561. // Resign releases election leadership so other campaigners may acquire
  562. // leadership on the election.
  563. Resign(ctx context.Context, in *ResignRequest, opts ...grpc.CallOption) (*ResignResponse, error)
  564. }
  565. type electionClient struct {
  566. cc *grpc.ClientConn
  567. }
  568. func NewElectionClient(cc *grpc.ClientConn) ElectionClient {
  569. return &electionClient{cc}
  570. }
  571. func (c *electionClient) Campaign(ctx context.Context, in *CampaignRequest, opts ...grpc.CallOption) (*CampaignResponse, error) {
  572. out := new(CampaignResponse)
  573. err := c.cc.Invoke(ctx, "/v3electionpb.Election/Campaign", in, out, opts...)
  574. if err != nil {
  575. return nil, err
  576. }
  577. return out, nil
  578. }
  579. func (c *electionClient) Proclaim(ctx context.Context, in *ProclaimRequest, opts ...grpc.CallOption) (*ProclaimResponse, error) {
  580. out := new(ProclaimResponse)
  581. err := c.cc.Invoke(ctx, "/v3electionpb.Election/Proclaim", in, out, opts...)
  582. if err != nil {
  583. return nil, err
  584. }
  585. return out, nil
  586. }
  587. func (c *electionClient) Leader(ctx context.Context, in *LeaderRequest, opts ...grpc.CallOption) (*LeaderResponse, error) {
  588. out := new(LeaderResponse)
  589. err := c.cc.Invoke(ctx, "/v3electionpb.Election/Leader", in, out, opts...)
  590. if err != nil {
  591. return nil, err
  592. }
  593. return out, nil
  594. }
  595. func (c *electionClient) Observe(ctx context.Context, in *LeaderRequest, opts ...grpc.CallOption) (Election_ObserveClient, error) {
  596. stream, err := c.cc.NewStream(ctx, &_Election_serviceDesc.Streams[0], "/v3electionpb.Election/Observe", opts...)
  597. if err != nil {
  598. return nil, err
  599. }
  600. x := &electionObserveClient{stream}
  601. if err := x.ClientStream.SendMsg(in); err != nil {
  602. return nil, err
  603. }
  604. if err := x.ClientStream.CloseSend(); err != nil {
  605. return nil, err
  606. }
  607. return x, nil
  608. }
  609. type Election_ObserveClient interface {
  610. Recv() (*LeaderResponse, error)
  611. grpc.ClientStream
  612. }
  613. type electionObserveClient struct {
  614. grpc.ClientStream
  615. }
  616. func (x *electionObserveClient) Recv() (*LeaderResponse, error) {
  617. m := new(LeaderResponse)
  618. if err := x.ClientStream.RecvMsg(m); err != nil {
  619. return nil, err
  620. }
  621. return m, nil
  622. }
  623. func (c *electionClient) Resign(ctx context.Context, in *ResignRequest, opts ...grpc.CallOption) (*ResignResponse, error) {
  624. out := new(ResignResponse)
  625. err := c.cc.Invoke(ctx, "/v3electionpb.Election/Resign", in, out, opts...)
  626. if err != nil {
  627. return nil, err
  628. }
  629. return out, nil
  630. }
  631. // ElectionServer is the server API for Election service.
  632. type ElectionServer interface {
  633. // Campaign waits to acquire leadership in an election, returning a LeaderKey
  634. // representing the leadership if successful. The LeaderKey can then be used
  635. // to issue new values on the election, transactionally guard API requests on
  636. // leadership still being held, and resign from the election.
  637. Campaign(context.Context, *CampaignRequest) (*CampaignResponse, error)
  638. // Proclaim updates the leader's posted value with a new value.
  639. Proclaim(context.Context, *ProclaimRequest) (*ProclaimResponse, error)
  640. // Leader returns the current election proclamation, if any.
  641. Leader(context.Context, *LeaderRequest) (*LeaderResponse, error)
  642. // Observe streams election proclamations in-order as made by the election's
  643. // elected leaders.
  644. Observe(*LeaderRequest, Election_ObserveServer) error
  645. // Resign releases election leadership so other campaigners may acquire
  646. // leadership on the election.
  647. Resign(context.Context, *ResignRequest) (*ResignResponse, error)
  648. }
  649. // UnimplementedElectionServer can be embedded to have forward compatible implementations.
  650. type UnimplementedElectionServer struct {
  651. }
  652. func (*UnimplementedElectionServer) Campaign(ctx context.Context, req *CampaignRequest) (*CampaignResponse, error) {
  653. return nil, status.Errorf(codes.Unimplemented, "method Campaign not implemented")
  654. }
  655. func (*UnimplementedElectionServer) Proclaim(ctx context.Context, req *ProclaimRequest) (*ProclaimResponse, error) {
  656. return nil, status.Errorf(codes.Unimplemented, "method Proclaim not implemented")
  657. }
  658. func (*UnimplementedElectionServer) Leader(ctx context.Context, req *LeaderRequest) (*LeaderResponse, error) {
  659. return nil, status.Errorf(codes.Unimplemented, "method Leader not implemented")
  660. }
  661. func (*UnimplementedElectionServer) Observe(req *LeaderRequest, srv Election_ObserveServer) error {
  662. return status.Errorf(codes.Unimplemented, "method Observe not implemented")
  663. }
  664. func (*UnimplementedElectionServer) Resign(ctx context.Context, req *ResignRequest) (*ResignResponse, error) {
  665. return nil, status.Errorf(codes.Unimplemented, "method Resign not implemented")
  666. }
  667. func RegisterElectionServer(s *grpc.Server, srv ElectionServer) {
  668. s.RegisterService(&_Election_serviceDesc, srv)
  669. }
  670. func _Election_Campaign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  671. in := new(CampaignRequest)
  672. if err := dec(in); err != nil {
  673. return nil, err
  674. }
  675. if interceptor == nil {
  676. return srv.(ElectionServer).Campaign(ctx, in)
  677. }
  678. info := &grpc.UnaryServerInfo{
  679. Server: srv,
  680. FullMethod: "/v3electionpb.Election/Campaign",
  681. }
  682. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  683. return srv.(ElectionServer).Campaign(ctx, req.(*CampaignRequest))
  684. }
  685. return interceptor(ctx, in, info, handler)
  686. }
  687. func _Election_Proclaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  688. in := new(ProclaimRequest)
  689. if err := dec(in); err != nil {
  690. return nil, err
  691. }
  692. if interceptor == nil {
  693. return srv.(ElectionServer).Proclaim(ctx, in)
  694. }
  695. info := &grpc.UnaryServerInfo{
  696. Server: srv,
  697. FullMethod: "/v3electionpb.Election/Proclaim",
  698. }
  699. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  700. return srv.(ElectionServer).Proclaim(ctx, req.(*ProclaimRequest))
  701. }
  702. return interceptor(ctx, in, info, handler)
  703. }
  704. func _Election_Leader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  705. in := new(LeaderRequest)
  706. if err := dec(in); err != nil {
  707. return nil, err
  708. }
  709. if interceptor == nil {
  710. return srv.(ElectionServer).Leader(ctx, in)
  711. }
  712. info := &grpc.UnaryServerInfo{
  713. Server: srv,
  714. FullMethod: "/v3electionpb.Election/Leader",
  715. }
  716. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  717. return srv.(ElectionServer).Leader(ctx, req.(*LeaderRequest))
  718. }
  719. return interceptor(ctx, in, info, handler)
  720. }
  721. func _Election_Observe_Handler(srv interface{}, stream grpc.ServerStream) error {
  722. m := new(LeaderRequest)
  723. if err := stream.RecvMsg(m); err != nil {
  724. return err
  725. }
  726. return srv.(ElectionServer).Observe(m, &electionObserveServer{stream})
  727. }
  728. type Election_ObserveServer interface {
  729. Send(*LeaderResponse) error
  730. grpc.ServerStream
  731. }
  732. type electionObserveServer struct {
  733. grpc.ServerStream
  734. }
  735. func (x *electionObserveServer) Send(m *LeaderResponse) error {
  736. return x.ServerStream.SendMsg(m)
  737. }
  738. func _Election_Resign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  739. in := new(ResignRequest)
  740. if err := dec(in); err != nil {
  741. return nil, err
  742. }
  743. if interceptor == nil {
  744. return srv.(ElectionServer).Resign(ctx, in)
  745. }
  746. info := &grpc.UnaryServerInfo{
  747. Server: srv,
  748. FullMethod: "/v3electionpb.Election/Resign",
  749. }
  750. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  751. return srv.(ElectionServer).Resign(ctx, req.(*ResignRequest))
  752. }
  753. return interceptor(ctx, in, info, handler)
  754. }
  755. var _Election_serviceDesc = grpc.ServiceDesc{
  756. ServiceName: "v3electionpb.Election",
  757. HandlerType: (*ElectionServer)(nil),
  758. Methods: []grpc.MethodDesc{
  759. {
  760. MethodName: "Campaign",
  761. Handler: _Election_Campaign_Handler,
  762. },
  763. {
  764. MethodName: "Proclaim",
  765. Handler: _Election_Proclaim_Handler,
  766. },
  767. {
  768. MethodName: "Leader",
  769. Handler: _Election_Leader_Handler,
  770. },
  771. {
  772. MethodName: "Resign",
  773. Handler: _Election_Resign_Handler,
  774. },
  775. },
  776. Streams: []grpc.StreamDesc{
  777. {
  778. StreamName: "Observe",
  779. Handler: _Election_Observe_Handler,
  780. ServerStreams: true,
  781. },
  782. },
  783. Metadata: "v3election.proto",
  784. }
  785. func (m *CampaignRequest) Marshal() (dAtA []byte, err error) {
  786. size := m.Size()
  787. dAtA = make([]byte, size)
  788. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  789. if err != nil {
  790. return nil, err
  791. }
  792. return dAtA[:n], nil
  793. }
  794. func (m *CampaignRequest) MarshalTo(dAtA []byte) (int, error) {
  795. size := m.Size()
  796. return m.MarshalToSizedBuffer(dAtA[:size])
  797. }
  798. func (m *CampaignRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  799. i := len(dAtA)
  800. _ = i
  801. var l int
  802. _ = l
  803. if m.XXX_unrecognized != nil {
  804. i -= len(m.XXX_unrecognized)
  805. copy(dAtA[i:], m.XXX_unrecognized)
  806. }
  807. if len(m.Value) > 0 {
  808. i -= len(m.Value)
  809. copy(dAtA[i:], m.Value)
  810. i = encodeVarintV3Election(dAtA, i, uint64(len(m.Value)))
  811. i--
  812. dAtA[i] = 0x1a
  813. }
  814. if m.Lease != 0 {
  815. i = encodeVarintV3Election(dAtA, i, uint64(m.Lease))
  816. i--
  817. dAtA[i] = 0x10
  818. }
  819. if len(m.Name) > 0 {
  820. i -= len(m.Name)
  821. copy(dAtA[i:], m.Name)
  822. i = encodeVarintV3Election(dAtA, i, uint64(len(m.Name)))
  823. i--
  824. dAtA[i] = 0xa
  825. }
  826. return len(dAtA) - i, nil
  827. }
  828. func (m *CampaignResponse) Marshal() (dAtA []byte, err error) {
  829. size := m.Size()
  830. dAtA = make([]byte, size)
  831. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  832. if err != nil {
  833. return nil, err
  834. }
  835. return dAtA[:n], nil
  836. }
  837. func (m *CampaignResponse) MarshalTo(dAtA []byte) (int, error) {
  838. size := m.Size()
  839. return m.MarshalToSizedBuffer(dAtA[:size])
  840. }
  841. func (m *CampaignResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  842. i := len(dAtA)
  843. _ = i
  844. var l int
  845. _ = l
  846. if m.XXX_unrecognized != nil {
  847. i -= len(m.XXX_unrecognized)
  848. copy(dAtA[i:], m.XXX_unrecognized)
  849. }
  850. if m.Leader != nil {
  851. {
  852. size, err := m.Leader.MarshalToSizedBuffer(dAtA[:i])
  853. if err != nil {
  854. return 0, err
  855. }
  856. i -= size
  857. i = encodeVarintV3Election(dAtA, i, uint64(size))
  858. }
  859. i--
  860. dAtA[i] = 0x12
  861. }
  862. if m.Header != nil {
  863. {
  864. size, err := m.Header.MarshalToSizedBuffer(dAtA[:i])
  865. if err != nil {
  866. return 0, err
  867. }
  868. i -= size
  869. i = encodeVarintV3Election(dAtA, i, uint64(size))
  870. }
  871. i--
  872. dAtA[i] = 0xa
  873. }
  874. return len(dAtA) - i, nil
  875. }
  876. func (m *LeaderKey) Marshal() (dAtA []byte, err error) {
  877. size := m.Size()
  878. dAtA = make([]byte, size)
  879. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  880. if err != nil {
  881. return nil, err
  882. }
  883. return dAtA[:n], nil
  884. }
  885. func (m *LeaderKey) MarshalTo(dAtA []byte) (int, error) {
  886. size := m.Size()
  887. return m.MarshalToSizedBuffer(dAtA[:size])
  888. }
  889. func (m *LeaderKey) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  890. i := len(dAtA)
  891. _ = i
  892. var l int
  893. _ = l
  894. if m.XXX_unrecognized != nil {
  895. i -= len(m.XXX_unrecognized)
  896. copy(dAtA[i:], m.XXX_unrecognized)
  897. }
  898. if m.Lease != 0 {
  899. i = encodeVarintV3Election(dAtA, i, uint64(m.Lease))
  900. i--
  901. dAtA[i] = 0x20
  902. }
  903. if m.Rev != 0 {
  904. i = encodeVarintV3Election(dAtA, i, uint64(m.Rev))
  905. i--
  906. dAtA[i] = 0x18
  907. }
  908. if len(m.Key) > 0 {
  909. i -= len(m.Key)
  910. copy(dAtA[i:], m.Key)
  911. i = encodeVarintV3Election(dAtA, i, uint64(len(m.Key)))
  912. i--
  913. dAtA[i] = 0x12
  914. }
  915. if len(m.Name) > 0 {
  916. i -= len(m.Name)
  917. copy(dAtA[i:], m.Name)
  918. i = encodeVarintV3Election(dAtA, i, uint64(len(m.Name)))
  919. i--
  920. dAtA[i] = 0xa
  921. }
  922. return len(dAtA) - i, nil
  923. }
  924. func (m *LeaderRequest) Marshal() (dAtA []byte, err error) {
  925. size := m.Size()
  926. dAtA = make([]byte, size)
  927. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  928. if err != nil {
  929. return nil, err
  930. }
  931. return dAtA[:n], nil
  932. }
  933. func (m *LeaderRequest) MarshalTo(dAtA []byte) (int, error) {
  934. size := m.Size()
  935. return m.MarshalToSizedBuffer(dAtA[:size])
  936. }
  937. func (m *LeaderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  938. i := len(dAtA)
  939. _ = i
  940. var l int
  941. _ = l
  942. if m.XXX_unrecognized != nil {
  943. i -= len(m.XXX_unrecognized)
  944. copy(dAtA[i:], m.XXX_unrecognized)
  945. }
  946. if len(m.Name) > 0 {
  947. i -= len(m.Name)
  948. copy(dAtA[i:], m.Name)
  949. i = encodeVarintV3Election(dAtA, i, uint64(len(m.Name)))
  950. i--
  951. dAtA[i] = 0xa
  952. }
  953. return len(dAtA) - i, nil
  954. }
  955. func (m *LeaderResponse) Marshal() (dAtA []byte, err error) {
  956. size := m.Size()
  957. dAtA = make([]byte, size)
  958. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  959. if err != nil {
  960. return nil, err
  961. }
  962. return dAtA[:n], nil
  963. }
  964. func (m *LeaderResponse) MarshalTo(dAtA []byte) (int, error) {
  965. size := m.Size()
  966. return m.MarshalToSizedBuffer(dAtA[:size])
  967. }
  968. func (m *LeaderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  969. i := len(dAtA)
  970. _ = i
  971. var l int
  972. _ = l
  973. if m.XXX_unrecognized != nil {
  974. i -= len(m.XXX_unrecognized)
  975. copy(dAtA[i:], m.XXX_unrecognized)
  976. }
  977. if m.Kv != nil {
  978. {
  979. size, err := m.Kv.MarshalToSizedBuffer(dAtA[:i])
  980. if err != nil {
  981. return 0, err
  982. }
  983. i -= size
  984. i = encodeVarintV3Election(dAtA, i, uint64(size))
  985. }
  986. i--
  987. dAtA[i] = 0x12
  988. }
  989. if m.Header != nil {
  990. {
  991. size, err := m.Header.MarshalToSizedBuffer(dAtA[:i])
  992. if err != nil {
  993. return 0, err
  994. }
  995. i -= size
  996. i = encodeVarintV3Election(dAtA, i, uint64(size))
  997. }
  998. i--
  999. dAtA[i] = 0xa
  1000. }
  1001. return len(dAtA) - i, nil
  1002. }
  1003. func (m *ResignRequest) Marshal() (dAtA []byte, err error) {
  1004. size := m.Size()
  1005. dAtA = make([]byte, size)
  1006. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1007. if err != nil {
  1008. return nil, err
  1009. }
  1010. return dAtA[:n], nil
  1011. }
  1012. func (m *ResignRequest) MarshalTo(dAtA []byte) (int, error) {
  1013. size := m.Size()
  1014. return m.MarshalToSizedBuffer(dAtA[:size])
  1015. }
  1016. func (m *ResignRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1017. i := len(dAtA)
  1018. _ = i
  1019. var l int
  1020. _ = l
  1021. if m.XXX_unrecognized != nil {
  1022. i -= len(m.XXX_unrecognized)
  1023. copy(dAtA[i:], m.XXX_unrecognized)
  1024. }
  1025. if m.Leader != nil {
  1026. {
  1027. size, err := m.Leader.MarshalToSizedBuffer(dAtA[:i])
  1028. if err != nil {
  1029. return 0, err
  1030. }
  1031. i -= size
  1032. i = encodeVarintV3Election(dAtA, i, uint64(size))
  1033. }
  1034. i--
  1035. dAtA[i] = 0xa
  1036. }
  1037. return len(dAtA) - i, nil
  1038. }
  1039. func (m *ResignResponse) Marshal() (dAtA []byte, err error) {
  1040. size := m.Size()
  1041. dAtA = make([]byte, size)
  1042. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1043. if err != nil {
  1044. return nil, err
  1045. }
  1046. return dAtA[:n], nil
  1047. }
  1048. func (m *ResignResponse) MarshalTo(dAtA []byte) (int, error) {
  1049. size := m.Size()
  1050. return m.MarshalToSizedBuffer(dAtA[:size])
  1051. }
  1052. func (m *ResignResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1053. i := len(dAtA)
  1054. _ = i
  1055. var l int
  1056. _ = l
  1057. if m.XXX_unrecognized != nil {
  1058. i -= len(m.XXX_unrecognized)
  1059. copy(dAtA[i:], m.XXX_unrecognized)
  1060. }
  1061. if m.Header != nil {
  1062. {
  1063. size, err := m.Header.MarshalToSizedBuffer(dAtA[:i])
  1064. if err != nil {
  1065. return 0, err
  1066. }
  1067. i -= size
  1068. i = encodeVarintV3Election(dAtA, i, uint64(size))
  1069. }
  1070. i--
  1071. dAtA[i] = 0xa
  1072. }
  1073. return len(dAtA) - i, nil
  1074. }
  1075. func (m *ProclaimRequest) Marshal() (dAtA []byte, err error) {
  1076. size := m.Size()
  1077. dAtA = make([]byte, size)
  1078. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1079. if err != nil {
  1080. return nil, err
  1081. }
  1082. return dAtA[:n], nil
  1083. }
  1084. func (m *ProclaimRequest) MarshalTo(dAtA []byte) (int, error) {
  1085. size := m.Size()
  1086. return m.MarshalToSizedBuffer(dAtA[:size])
  1087. }
  1088. func (m *ProclaimRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1089. i := len(dAtA)
  1090. _ = i
  1091. var l int
  1092. _ = l
  1093. if m.XXX_unrecognized != nil {
  1094. i -= len(m.XXX_unrecognized)
  1095. copy(dAtA[i:], m.XXX_unrecognized)
  1096. }
  1097. if len(m.Value) > 0 {
  1098. i -= len(m.Value)
  1099. copy(dAtA[i:], m.Value)
  1100. i = encodeVarintV3Election(dAtA, i, uint64(len(m.Value)))
  1101. i--
  1102. dAtA[i] = 0x12
  1103. }
  1104. if m.Leader != nil {
  1105. {
  1106. size, err := m.Leader.MarshalToSizedBuffer(dAtA[:i])
  1107. if err != nil {
  1108. return 0, err
  1109. }
  1110. i -= size
  1111. i = encodeVarintV3Election(dAtA, i, uint64(size))
  1112. }
  1113. i--
  1114. dAtA[i] = 0xa
  1115. }
  1116. return len(dAtA) - i, nil
  1117. }
  1118. func (m *ProclaimResponse) Marshal() (dAtA []byte, err error) {
  1119. size := m.Size()
  1120. dAtA = make([]byte, size)
  1121. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1122. if err != nil {
  1123. return nil, err
  1124. }
  1125. return dAtA[:n], nil
  1126. }
  1127. func (m *ProclaimResponse) MarshalTo(dAtA []byte) (int, error) {
  1128. size := m.Size()
  1129. return m.MarshalToSizedBuffer(dAtA[:size])
  1130. }
  1131. func (m *ProclaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1132. i := len(dAtA)
  1133. _ = i
  1134. var l int
  1135. _ = l
  1136. if m.XXX_unrecognized != nil {
  1137. i -= len(m.XXX_unrecognized)
  1138. copy(dAtA[i:], m.XXX_unrecognized)
  1139. }
  1140. if m.Header != nil {
  1141. {
  1142. size, err := m.Header.MarshalToSizedBuffer(dAtA[:i])
  1143. if err != nil {
  1144. return 0, err
  1145. }
  1146. i -= size
  1147. i = encodeVarintV3Election(dAtA, i, uint64(size))
  1148. }
  1149. i--
  1150. dAtA[i] = 0xa
  1151. }
  1152. return len(dAtA) - i, nil
  1153. }
  1154. func encodeVarintV3Election(dAtA []byte, offset int, v uint64) int {
  1155. offset -= sovV3Election(v)
  1156. base := offset
  1157. for v >= 1<<7 {
  1158. dAtA[offset] = uint8(v&0x7f | 0x80)
  1159. v >>= 7
  1160. offset++
  1161. }
  1162. dAtA[offset] = uint8(v)
  1163. return base
  1164. }
  1165. func (m *CampaignRequest) Size() (n int) {
  1166. if m == nil {
  1167. return 0
  1168. }
  1169. var l int
  1170. _ = l
  1171. l = len(m.Name)
  1172. if l > 0 {
  1173. n += 1 + l + sovV3Election(uint64(l))
  1174. }
  1175. if m.Lease != 0 {
  1176. n += 1 + sovV3Election(uint64(m.Lease))
  1177. }
  1178. l = len(m.Value)
  1179. if l > 0 {
  1180. n += 1 + l + sovV3Election(uint64(l))
  1181. }
  1182. if m.XXX_unrecognized != nil {
  1183. n += len(m.XXX_unrecognized)
  1184. }
  1185. return n
  1186. }
  1187. func (m *CampaignResponse) Size() (n int) {
  1188. if m == nil {
  1189. return 0
  1190. }
  1191. var l int
  1192. _ = l
  1193. if m.Header != nil {
  1194. l = m.Header.Size()
  1195. n += 1 + l + sovV3Election(uint64(l))
  1196. }
  1197. if m.Leader != nil {
  1198. l = m.Leader.Size()
  1199. n += 1 + l + sovV3Election(uint64(l))
  1200. }
  1201. if m.XXX_unrecognized != nil {
  1202. n += len(m.XXX_unrecognized)
  1203. }
  1204. return n
  1205. }
  1206. func (m *LeaderKey) Size() (n int) {
  1207. if m == nil {
  1208. return 0
  1209. }
  1210. var l int
  1211. _ = l
  1212. l = len(m.Name)
  1213. if l > 0 {
  1214. n += 1 + l + sovV3Election(uint64(l))
  1215. }
  1216. l = len(m.Key)
  1217. if l > 0 {
  1218. n += 1 + l + sovV3Election(uint64(l))
  1219. }
  1220. if m.Rev != 0 {
  1221. n += 1 + sovV3Election(uint64(m.Rev))
  1222. }
  1223. if m.Lease != 0 {
  1224. n += 1 + sovV3Election(uint64(m.Lease))
  1225. }
  1226. if m.XXX_unrecognized != nil {
  1227. n += len(m.XXX_unrecognized)
  1228. }
  1229. return n
  1230. }
  1231. func (m *LeaderRequest) Size() (n int) {
  1232. if m == nil {
  1233. return 0
  1234. }
  1235. var l int
  1236. _ = l
  1237. l = len(m.Name)
  1238. if l > 0 {
  1239. n += 1 + l + sovV3Election(uint64(l))
  1240. }
  1241. if m.XXX_unrecognized != nil {
  1242. n += len(m.XXX_unrecognized)
  1243. }
  1244. return n
  1245. }
  1246. func (m *LeaderResponse) Size() (n int) {
  1247. if m == nil {
  1248. return 0
  1249. }
  1250. var l int
  1251. _ = l
  1252. if m.Header != nil {
  1253. l = m.Header.Size()
  1254. n += 1 + l + sovV3Election(uint64(l))
  1255. }
  1256. if m.Kv != nil {
  1257. l = m.Kv.Size()
  1258. n += 1 + l + sovV3Election(uint64(l))
  1259. }
  1260. if m.XXX_unrecognized != nil {
  1261. n += len(m.XXX_unrecognized)
  1262. }
  1263. return n
  1264. }
  1265. func (m *ResignRequest) Size() (n int) {
  1266. if m == nil {
  1267. return 0
  1268. }
  1269. var l int
  1270. _ = l
  1271. if m.Leader != nil {
  1272. l = m.Leader.Size()
  1273. n += 1 + l + sovV3Election(uint64(l))
  1274. }
  1275. if m.XXX_unrecognized != nil {
  1276. n += len(m.XXX_unrecognized)
  1277. }
  1278. return n
  1279. }
  1280. func (m *ResignResponse) Size() (n int) {
  1281. if m == nil {
  1282. return 0
  1283. }
  1284. var l int
  1285. _ = l
  1286. if m.Header != nil {
  1287. l = m.Header.Size()
  1288. n += 1 + l + sovV3Election(uint64(l))
  1289. }
  1290. if m.XXX_unrecognized != nil {
  1291. n += len(m.XXX_unrecognized)
  1292. }
  1293. return n
  1294. }
  1295. func (m *ProclaimRequest) Size() (n int) {
  1296. if m == nil {
  1297. return 0
  1298. }
  1299. var l int
  1300. _ = l
  1301. if m.Leader != nil {
  1302. l = m.Leader.Size()
  1303. n += 1 + l + sovV3Election(uint64(l))
  1304. }
  1305. l = len(m.Value)
  1306. if l > 0 {
  1307. n += 1 + l + sovV3Election(uint64(l))
  1308. }
  1309. if m.XXX_unrecognized != nil {
  1310. n += len(m.XXX_unrecognized)
  1311. }
  1312. return n
  1313. }
  1314. func (m *ProclaimResponse) Size() (n int) {
  1315. if m == nil {
  1316. return 0
  1317. }
  1318. var l int
  1319. _ = l
  1320. if m.Header != nil {
  1321. l = m.Header.Size()
  1322. n += 1 + l + sovV3Election(uint64(l))
  1323. }
  1324. if m.XXX_unrecognized != nil {
  1325. n += len(m.XXX_unrecognized)
  1326. }
  1327. return n
  1328. }
  1329. func sovV3Election(x uint64) (n int) {
  1330. return (math_bits.Len64(x|1) + 6) / 7
  1331. }
  1332. func sozV3Election(x uint64) (n int) {
  1333. return sovV3Election(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1334. }
  1335. func (m *CampaignRequest) Unmarshal(dAtA []byte) error {
  1336. l := len(dAtA)
  1337. iNdEx := 0
  1338. for iNdEx < l {
  1339. preIndex := iNdEx
  1340. var wire uint64
  1341. for shift := uint(0); ; shift += 7 {
  1342. if shift >= 64 {
  1343. return ErrIntOverflowV3Election
  1344. }
  1345. if iNdEx >= l {
  1346. return io.ErrUnexpectedEOF
  1347. }
  1348. b := dAtA[iNdEx]
  1349. iNdEx++
  1350. wire |= uint64(b&0x7F) << shift
  1351. if b < 0x80 {
  1352. break
  1353. }
  1354. }
  1355. fieldNum := int32(wire >> 3)
  1356. wireType := int(wire & 0x7)
  1357. if wireType == 4 {
  1358. return fmt.Errorf("proto: CampaignRequest: wiretype end group for non-group")
  1359. }
  1360. if fieldNum <= 0 {
  1361. return fmt.Errorf("proto: CampaignRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1362. }
  1363. switch fieldNum {
  1364. case 1:
  1365. if wireType != 2 {
  1366. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  1367. }
  1368. var byteLen int
  1369. for shift := uint(0); ; shift += 7 {
  1370. if shift >= 64 {
  1371. return ErrIntOverflowV3Election
  1372. }
  1373. if iNdEx >= l {
  1374. return io.ErrUnexpectedEOF
  1375. }
  1376. b := dAtA[iNdEx]
  1377. iNdEx++
  1378. byteLen |= int(b&0x7F) << shift
  1379. if b < 0x80 {
  1380. break
  1381. }
  1382. }
  1383. if byteLen < 0 {
  1384. return ErrInvalidLengthV3Election
  1385. }
  1386. postIndex := iNdEx + byteLen
  1387. if postIndex < 0 {
  1388. return ErrInvalidLengthV3Election
  1389. }
  1390. if postIndex > l {
  1391. return io.ErrUnexpectedEOF
  1392. }
  1393. m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
  1394. if m.Name == nil {
  1395. m.Name = []byte{}
  1396. }
  1397. iNdEx = postIndex
  1398. case 2:
  1399. if wireType != 0 {
  1400. return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
  1401. }
  1402. m.Lease = 0
  1403. for shift := uint(0); ; shift += 7 {
  1404. if shift >= 64 {
  1405. return ErrIntOverflowV3Election
  1406. }
  1407. if iNdEx >= l {
  1408. return io.ErrUnexpectedEOF
  1409. }
  1410. b := dAtA[iNdEx]
  1411. iNdEx++
  1412. m.Lease |= int64(b&0x7F) << shift
  1413. if b < 0x80 {
  1414. break
  1415. }
  1416. }
  1417. case 3:
  1418. if wireType != 2 {
  1419. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  1420. }
  1421. var byteLen int
  1422. for shift := uint(0); ; shift += 7 {
  1423. if shift >= 64 {
  1424. return ErrIntOverflowV3Election
  1425. }
  1426. if iNdEx >= l {
  1427. return io.ErrUnexpectedEOF
  1428. }
  1429. b := dAtA[iNdEx]
  1430. iNdEx++
  1431. byteLen |= int(b&0x7F) << shift
  1432. if b < 0x80 {
  1433. break
  1434. }
  1435. }
  1436. if byteLen < 0 {
  1437. return ErrInvalidLengthV3Election
  1438. }
  1439. postIndex := iNdEx + byteLen
  1440. if postIndex < 0 {
  1441. return ErrInvalidLengthV3Election
  1442. }
  1443. if postIndex > l {
  1444. return io.ErrUnexpectedEOF
  1445. }
  1446. m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
  1447. if m.Value == nil {
  1448. m.Value = []byte{}
  1449. }
  1450. iNdEx = postIndex
  1451. default:
  1452. iNdEx = preIndex
  1453. skippy, err := skipV3Election(dAtA[iNdEx:])
  1454. if err != nil {
  1455. return err
  1456. }
  1457. if skippy < 0 {
  1458. return ErrInvalidLengthV3Election
  1459. }
  1460. if (iNdEx + skippy) < 0 {
  1461. return ErrInvalidLengthV3Election
  1462. }
  1463. if (iNdEx + skippy) > l {
  1464. return io.ErrUnexpectedEOF
  1465. }
  1466. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1467. iNdEx += skippy
  1468. }
  1469. }
  1470. if iNdEx > l {
  1471. return io.ErrUnexpectedEOF
  1472. }
  1473. return nil
  1474. }
  1475. func (m *CampaignResponse) Unmarshal(dAtA []byte) error {
  1476. l := len(dAtA)
  1477. iNdEx := 0
  1478. for iNdEx < l {
  1479. preIndex := iNdEx
  1480. var wire uint64
  1481. for shift := uint(0); ; shift += 7 {
  1482. if shift >= 64 {
  1483. return ErrIntOverflowV3Election
  1484. }
  1485. if iNdEx >= l {
  1486. return io.ErrUnexpectedEOF
  1487. }
  1488. b := dAtA[iNdEx]
  1489. iNdEx++
  1490. wire |= uint64(b&0x7F) << shift
  1491. if b < 0x80 {
  1492. break
  1493. }
  1494. }
  1495. fieldNum := int32(wire >> 3)
  1496. wireType := int(wire & 0x7)
  1497. if wireType == 4 {
  1498. return fmt.Errorf("proto: CampaignResponse: wiretype end group for non-group")
  1499. }
  1500. if fieldNum <= 0 {
  1501. return fmt.Errorf("proto: CampaignResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1502. }
  1503. switch fieldNum {
  1504. case 1:
  1505. if wireType != 2 {
  1506. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  1507. }
  1508. var msglen int
  1509. for shift := uint(0); ; shift += 7 {
  1510. if shift >= 64 {
  1511. return ErrIntOverflowV3Election
  1512. }
  1513. if iNdEx >= l {
  1514. return io.ErrUnexpectedEOF
  1515. }
  1516. b := dAtA[iNdEx]
  1517. iNdEx++
  1518. msglen |= int(b&0x7F) << shift
  1519. if b < 0x80 {
  1520. break
  1521. }
  1522. }
  1523. if msglen < 0 {
  1524. return ErrInvalidLengthV3Election
  1525. }
  1526. postIndex := iNdEx + msglen
  1527. if postIndex < 0 {
  1528. return ErrInvalidLengthV3Election
  1529. }
  1530. if postIndex > l {
  1531. return io.ErrUnexpectedEOF
  1532. }
  1533. if m.Header == nil {
  1534. m.Header = &etcdserverpb.ResponseHeader{}
  1535. }
  1536. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1537. return err
  1538. }
  1539. iNdEx = postIndex
  1540. case 2:
  1541. if wireType != 2 {
  1542. return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType)
  1543. }
  1544. var msglen int
  1545. for shift := uint(0); ; shift += 7 {
  1546. if shift >= 64 {
  1547. return ErrIntOverflowV3Election
  1548. }
  1549. if iNdEx >= l {
  1550. return io.ErrUnexpectedEOF
  1551. }
  1552. b := dAtA[iNdEx]
  1553. iNdEx++
  1554. msglen |= int(b&0x7F) << shift
  1555. if b < 0x80 {
  1556. break
  1557. }
  1558. }
  1559. if msglen < 0 {
  1560. return ErrInvalidLengthV3Election
  1561. }
  1562. postIndex := iNdEx + msglen
  1563. if postIndex < 0 {
  1564. return ErrInvalidLengthV3Election
  1565. }
  1566. if postIndex > l {
  1567. return io.ErrUnexpectedEOF
  1568. }
  1569. if m.Leader == nil {
  1570. m.Leader = &LeaderKey{}
  1571. }
  1572. if err := m.Leader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1573. return err
  1574. }
  1575. iNdEx = postIndex
  1576. default:
  1577. iNdEx = preIndex
  1578. skippy, err := skipV3Election(dAtA[iNdEx:])
  1579. if err != nil {
  1580. return err
  1581. }
  1582. if skippy < 0 {
  1583. return ErrInvalidLengthV3Election
  1584. }
  1585. if (iNdEx + skippy) < 0 {
  1586. return ErrInvalidLengthV3Election
  1587. }
  1588. if (iNdEx + skippy) > l {
  1589. return io.ErrUnexpectedEOF
  1590. }
  1591. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1592. iNdEx += skippy
  1593. }
  1594. }
  1595. if iNdEx > l {
  1596. return io.ErrUnexpectedEOF
  1597. }
  1598. return nil
  1599. }
  1600. func (m *LeaderKey) Unmarshal(dAtA []byte) error {
  1601. l := len(dAtA)
  1602. iNdEx := 0
  1603. for iNdEx < l {
  1604. preIndex := iNdEx
  1605. var wire uint64
  1606. for shift := uint(0); ; shift += 7 {
  1607. if shift >= 64 {
  1608. return ErrIntOverflowV3Election
  1609. }
  1610. if iNdEx >= l {
  1611. return io.ErrUnexpectedEOF
  1612. }
  1613. b := dAtA[iNdEx]
  1614. iNdEx++
  1615. wire |= uint64(b&0x7F) << shift
  1616. if b < 0x80 {
  1617. break
  1618. }
  1619. }
  1620. fieldNum := int32(wire >> 3)
  1621. wireType := int(wire & 0x7)
  1622. if wireType == 4 {
  1623. return fmt.Errorf("proto: LeaderKey: wiretype end group for non-group")
  1624. }
  1625. if fieldNum <= 0 {
  1626. return fmt.Errorf("proto: LeaderKey: illegal tag %d (wire type %d)", fieldNum, wire)
  1627. }
  1628. switch fieldNum {
  1629. case 1:
  1630. if wireType != 2 {
  1631. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  1632. }
  1633. var byteLen int
  1634. for shift := uint(0); ; shift += 7 {
  1635. if shift >= 64 {
  1636. return ErrIntOverflowV3Election
  1637. }
  1638. if iNdEx >= l {
  1639. return io.ErrUnexpectedEOF
  1640. }
  1641. b := dAtA[iNdEx]
  1642. iNdEx++
  1643. byteLen |= int(b&0x7F) << shift
  1644. if b < 0x80 {
  1645. break
  1646. }
  1647. }
  1648. if byteLen < 0 {
  1649. return ErrInvalidLengthV3Election
  1650. }
  1651. postIndex := iNdEx + byteLen
  1652. if postIndex < 0 {
  1653. return ErrInvalidLengthV3Election
  1654. }
  1655. if postIndex > l {
  1656. return io.ErrUnexpectedEOF
  1657. }
  1658. m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
  1659. if m.Name == nil {
  1660. m.Name = []byte{}
  1661. }
  1662. iNdEx = postIndex
  1663. case 2:
  1664. if wireType != 2 {
  1665. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  1666. }
  1667. var byteLen int
  1668. for shift := uint(0); ; shift += 7 {
  1669. if shift >= 64 {
  1670. return ErrIntOverflowV3Election
  1671. }
  1672. if iNdEx >= l {
  1673. return io.ErrUnexpectedEOF
  1674. }
  1675. b := dAtA[iNdEx]
  1676. iNdEx++
  1677. byteLen |= int(b&0x7F) << shift
  1678. if b < 0x80 {
  1679. break
  1680. }
  1681. }
  1682. if byteLen < 0 {
  1683. return ErrInvalidLengthV3Election
  1684. }
  1685. postIndex := iNdEx + byteLen
  1686. if postIndex < 0 {
  1687. return ErrInvalidLengthV3Election
  1688. }
  1689. if postIndex > l {
  1690. return io.ErrUnexpectedEOF
  1691. }
  1692. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  1693. if m.Key == nil {
  1694. m.Key = []byte{}
  1695. }
  1696. iNdEx = postIndex
  1697. case 3:
  1698. if wireType != 0 {
  1699. return fmt.Errorf("proto: wrong wireType = %d for field Rev", wireType)
  1700. }
  1701. m.Rev = 0
  1702. for shift := uint(0); ; shift += 7 {
  1703. if shift >= 64 {
  1704. return ErrIntOverflowV3Election
  1705. }
  1706. if iNdEx >= l {
  1707. return io.ErrUnexpectedEOF
  1708. }
  1709. b := dAtA[iNdEx]
  1710. iNdEx++
  1711. m.Rev |= int64(b&0x7F) << shift
  1712. if b < 0x80 {
  1713. break
  1714. }
  1715. }
  1716. case 4:
  1717. if wireType != 0 {
  1718. return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
  1719. }
  1720. m.Lease = 0
  1721. for shift := uint(0); ; shift += 7 {
  1722. if shift >= 64 {
  1723. return ErrIntOverflowV3Election
  1724. }
  1725. if iNdEx >= l {
  1726. return io.ErrUnexpectedEOF
  1727. }
  1728. b := dAtA[iNdEx]
  1729. iNdEx++
  1730. m.Lease |= int64(b&0x7F) << shift
  1731. if b < 0x80 {
  1732. break
  1733. }
  1734. }
  1735. default:
  1736. iNdEx = preIndex
  1737. skippy, err := skipV3Election(dAtA[iNdEx:])
  1738. if err != nil {
  1739. return err
  1740. }
  1741. if skippy < 0 {
  1742. return ErrInvalidLengthV3Election
  1743. }
  1744. if (iNdEx + skippy) < 0 {
  1745. return ErrInvalidLengthV3Election
  1746. }
  1747. if (iNdEx + skippy) > l {
  1748. return io.ErrUnexpectedEOF
  1749. }
  1750. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1751. iNdEx += skippy
  1752. }
  1753. }
  1754. if iNdEx > l {
  1755. return io.ErrUnexpectedEOF
  1756. }
  1757. return nil
  1758. }
  1759. func (m *LeaderRequest) Unmarshal(dAtA []byte) error {
  1760. l := len(dAtA)
  1761. iNdEx := 0
  1762. for iNdEx < l {
  1763. preIndex := iNdEx
  1764. var wire uint64
  1765. for shift := uint(0); ; shift += 7 {
  1766. if shift >= 64 {
  1767. return ErrIntOverflowV3Election
  1768. }
  1769. if iNdEx >= l {
  1770. return io.ErrUnexpectedEOF
  1771. }
  1772. b := dAtA[iNdEx]
  1773. iNdEx++
  1774. wire |= uint64(b&0x7F) << shift
  1775. if b < 0x80 {
  1776. break
  1777. }
  1778. }
  1779. fieldNum := int32(wire >> 3)
  1780. wireType := int(wire & 0x7)
  1781. if wireType == 4 {
  1782. return fmt.Errorf("proto: LeaderRequest: wiretype end group for non-group")
  1783. }
  1784. if fieldNum <= 0 {
  1785. return fmt.Errorf("proto: LeaderRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1786. }
  1787. switch fieldNum {
  1788. case 1:
  1789. if wireType != 2 {
  1790. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  1791. }
  1792. var byteLen int
  1793. for shift := uint(0); ; shift += 7 {
  1794. if shift >= 64 {
  1795. return ErrIntOverflowV3Election
  1796. }
  1797. if iNdEx >= l {
  1798. return io.ErrUnexpectedEOF
  1799. }
  1800. b := dAtA[iNdEx]
  1801. iNdEx++
  1802. byteLen |= int(b&0x7F) << shift
  1803. if b < 0x80 {
  1804. break
  1805. }
  1806. }
  1807. if byteLen < 0 {
  1808. return ErrInvalidLengthV3Election
  1809. }
  1810. postIndex := iNdEx + byteLen
  1811. if postIndex < 0 {
  1812. return ErrInvalidLengthV3Election
  1813. }
  1814. if postIndex > l {
  1815. return io.ErrUnexpectedEOF
  1816. }
  1817. m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
  1818. if m.Name == nil {
  1819. m.Name = []byte{}
  1820. }
  1821. iNdEx = postIndex
  1822. default:
  1823. iNdEx = preIndex
  1824. skippy, err := skipV3Election(dAtA[iNdEx:])
  1825. if err != nil {
  1826. return err
  1827. }
  1828. if skippy < 0 {
  1829. return ErrInvalidLengthV3Election
  1830. }
  1831. if (iNdEx + skippy) < 0 {
  1832. return ErrInvalidLengthV3Election
  1833. }
  1834. if (iNdEx + skippy) > l {
  1835. return io.ErrUnexpectedEOF
  1836. }
  1837. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1838. iNdEx += skippy
  1839. }
  1840. }
  1841. if iNdEx > l {
  1842. return io.ErrUnexpectedEOF
  1843. }
  1844. return nil
  1845. }
  1846. func (m *LeaderResponse) Unmarshal(dAtA []byte) error {
  1847. l := len(dAtA)
  1848. iNdEx := 0
  1849. for iNdEx < l {
  1850. preIndex := iNdEx
  1851. var wire uint64
  1852. for shift := uint(0); ; shift += 7 {
  1853. if shift >= 64 {
  1854. return ErrIntOverflowV3Election
  1855. }
  1856. if iNdEx >= l {
  1857. return io.ErrUnexpectedEOF
  1858. }
  1859. b := dAtA[iNdEx]
  1860. iNdEx++
  1861. wire |= uint64(b&0x7F) << shift
  1862. if b < 0x80 {
  1863. break
  1864. }
  1865. }
  1866. fieldNum := int32(wire >> 3)
  1867. wireType := int(wire & 0x7)
  1868. if wireType == 4 {
  1869. return fmt.Errorf("proto: LeaderResponse: wiretype end group for non-group")
  1870. }
  1871. if fieldNum <= 0 {
  1872. return fmt.Errorf("proto: LeaderResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1873. }
  1874. switch fieldNum {
  1875. case 1:
  1876. if wireType != 2 {
  1877. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  1878. }
  1879. var msglen int
  1880. for shift := uint(0); ; shift += 7 {
  1881. if shift >= 64 {
  1882. return ErrIntOverflowV3Election
  1883. }
  1884. if iNdEx >= l {
  1885. return io.ErrUnexpectedEOF
  1886. }
  1887. b := dAtA[iNdEx]
  1888. iNdEx++
  1889. msglen |= int(b&0x7F) << shift
  1890. if b < 0x80 {
  1891. break
  1892. }
  1893. }
  1894. if msglen < 0 {
  1895. return ErrInvalidLengthV3Election
  1896. }
  1897. postIndex := iNdEx + msglen
  1898. if postIndex < 0 {
  1899. return ErrInvalidLengthV3Election
  1900. }
  1901. if postIndex > l {
  1902. return io.ErrUnexpectedEOF
  1903. }
  1904. if m.Header == nil {
  1905. m.Header = &etcdserverpb.ResponseHeader{}
  1906. }
  1907. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1908. return err
  1909. }
  1910. iNdEx = postIndex
  1911. case 2:
  1912. if wireType != 2 {
  1913. return fmt.Errorf("proto: wrong wireType = %d for field Kv", wireType)
  1914. }
  1915. var msglen int
  1916. for shift := uint(0); ; shift += 7 {
  1917. if shift >= 64 {
  1918. return ErrIntOverflowV3Election
  1919. }
  1920. if iNdEx >= l {
  1921. return io.ErrUnexpectedEOF
  1922. }
  1923. b := dAtA[iNdEx]
  1924. iNdEx++
  1925. msglen |= int(b&0x7F) << shift
  1926. if b < 0x80 {
  1927. break
  1928. }
  1929. }
  1930. if msglen < 0 {
  1931. return ErrInvalidLengthV3Election
  1932. }
  1933. postIndex := iNdEx + msglen
  1934. if postIndex < 0 {
  1935. return ErrInvalidLengthV3Election
  1936. }
  1937. if postIndex > l {
  1938. return io.ErrUnexpectedEOF
  1939. }
  1940. if m.Kv == nil {
  1941. m.Kv = &mvccpb.KeyValue{}
  1942. }
  1943. if err := m.Kv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1944. return err
  1945. }
  1946. iNdEx = postIndex
  1947. default:
  1948. iNdEx = preIndex
  1949. skippy, err := skipV3Election(dAtA[iNdEx:])
  1950. if err != nil {
  1951. return err
  1952. }
  1953. if skippy < 0 {
  1954. return ErrInvalidLengthV3Election
  1955. }
  1956. if (iNdEx + skippy) < 0 {
  1957. return ErrInvalidLengthV3Election
  1958. }
  1959. if (iNdEx + skippy) > l {
  1960. return io.ErrUnexpectedEOF
  1961. }
  1962. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1963. iNdEx += skippy
  1964. }
  1965. }
  1966. if iNdEx > l {
  1967. return io.ErrUnexpectedEOF
  1968. }
  1969. return nil
  1970. }
  1971. func (m *ResignRequest) Unmarshal(dAtA []byte) error {
  1972. l := len(dAtA)
  1973. iNdEx := 0
  1974. for iNdEx < l {
  1975. preIndex := iNdEx
  1976. var wire uint64
  1977. for shift := uint(0); ; shift += 7 {
  1978. if shift >= 64 {
  1979. return ErrIntOverflowV3Election
  1980. }
  1981. if iNdEx >= l {
  1982. return io.ErrUnexpectedEOF
  1983. }
  1984. b := dAtA[iNdEx]
  1985. iNdEx++
  1986. wire |= uint64(b&0x7F) << shift
  1987. if b < 0x80 {
  1988. break
  1989. }
  1990. }
  1991. fieldNum := int32(wire >> 3)
  1992. wireType := int(wire & 0x7)
  1993. if wireType == 4 {
  1994. return fmt.Errorf("proto: ResignRequest: wiretype end group for non-group")
  1995. }
  1996. if fieldNum <= 0 {
  1997. return fmt.Errorf("proto: ResignRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1998. }
  1999. switch fieldNum {
  2000. case 1:
  2001. if wireType != 2 {
  2002. return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType)
  2003. }
  2004. var msglen int
  2005. for shift := uint(0); ; shift += 7 {
  2006. if shift >= 64 {
  2007. return ErrIntOverflowV3Election
  2008. }
  2009. if iNdEx >= l {
  2010. return io.ErrUnexpectedEOF
  2011. }
  2012. b := dAtA[iNdEx]
  2013. iNdEx++
  2014. msglen |= int(b&0x7F) << shift
  2015. if b < 0x80 {
  2016. break
  2017. }
  2018. }
  2019. if msglen < 0 {
  2020. return ErrInvalidLengthV3Election
  2021. }
  2022. postIndex := iNdEx + msglen
  2023. if postIndex < 0 {
  2024. return ErrInvalidLengthV3Election
  2025. }
  2026. if postIndex > l {
  2027. return io.ErrUnexpectedEOF
  2028. }
  2029. if m.Leader == nil {
  2030. m.Leader = &LeaderKey{}
  2031. }
  2032. if err := m.Leader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2033. return err
  2034. }
  2035. iNdEx = postIndex
  2036. default:
  2037. iNdEx = preIndex
  2038. skippy, err := skipV3Election(dAtA[iNdEx:])
  2039. if err != nil {
  2040. return err
  2041. }
  2042. if skippy < 0 {
  2043. return ErrInvalidLengthV3Election
  2044. }
  2045. if (iNdEx + skippy) < 0 {
  2046. return ErrInvalidLengthV3Election
  2047. }
  2048. if (iNdEx + skippy) > l {
  2049. return io.ErrUnexpectedEOF
  2050. }
  2051. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  2052. iNdEx += skippy
  2053. }
  2054. }
  2055. if iNdEx > l {
  2056. return io.ErrUnexpectedEOF
  2057. }
  2058. return nil
  2059. }
  2060. func (m *ResignResponse) Unmarshal(dAtA []byte) error {
  2061. l := len(dAtA)
  2062. iNdEx := 0
  2063. for iNdEx < l {
  2064. preIndex := iNdEx
  2065. var wire uint64
  2066. for shift := uint(0); ; shift += 7 {
  2067. if shift >= 64 {
  2068. return ErrIntOverflowV3Election
  2069. }
  2070. if iNdEx >= l {
  2071. return io.ErrUnexpectedEOF
  2072. }
  2073. b := dAtA[iNdEx]
  2074. iNdEx++
  2075. wire |= uint64(b&0x7F) << shift
  2076. if b < 0x80 {
  2077. break
  2078. }
  2079. }
  2080. fieldNum := int32(wire >> 3)
  2081. wireType := int(wire & 0x7)
  2082. if wireType == 4 {
  2083. return fmt.Errorf("proto: ResignResponse: wiretype end group for non-group")
  2084. }
  2085. if fieldNum <= 0 {
  2086. return fmt.Errorf("proto: ResignResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  2087. }
  2088. switch fieldNum {
  2089. case 1:
  2090. if wireType != 2 {
  2091. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  2092. }
  2093. var msglen int
  2094. for shift := uint(0); ; shift += 7 {
  2095. if shift >= 64 {
  2096. return ErrIntOverflowV3Election
  2097. }
  2098. if iNdEx >= l {
  2099. return io.ErrUnexpectedEOF
  2100. }
  2101. b := dAtA[iNdEx]
  2102. iNdEx++
  2103. msglen |= int(b&0x7F) << shift
  2104. if b < 0x80 {
  2105. break
  2106. }
  2107. }
  2108. if msglen < 0 {
  2109. return ErrInvalidLengthV3Election
  2110. }
  2111. postIndex := iNdEx + msglen
  2112. if postIndex < 0 {
  2113. return ErrInvalidLengthV3Election
  2114. }
  2115. if postIndex > l {
  2116. return io.ErrUnexpectedEOF
  2117. }
  2118. if m.Header == nil {
  2119. m.Header = &etcdserverpb.ResponseHeader{}
  2120. }
  2121. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2122. return err
  2123. }
  2124. iNdEx = postIndex
  2125. default:
  2126. iNdEx = preIndex
  2127. skippy, err := skipV3Election(dAtA[iNdEx:])
  2128. if err != nil {
  2129. return err
  2130. }
  2131. if skippy < 0 {
  2132. return ErrInvalidLengthV3Election
  2133. }
  2134. if (iNdEx + skippy) < 0 {
  2135. return ErrInvalidLengthV3Election
  2136. }
  2137. if (iNdEx + skippy) > l {
  2138. return io.ErrUnexpectedEOF
  2139. }
  2140. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  2141. iNdEx += skippy
  2142. }
  2143. }
  2144. if iNdEx > l {
  2145. return io.ErrUnexpectedEOF
  2146. }
  2147. return nil
  2148. }
  2149. func (m *ProclaimRequest) Unmarshal(dAtA []byte) error {
  2150. l := len(dAtA)
  2151. iNdEx := 0
  2152. for iNdEx < l {
  2153. preIndex := iNdEx
  2154. var wire uint64
  2155. for shift := uint(0); ; shift += 7 {
  2156. if shift >= 64 {
  2157. return ErrIntOverflowV3Election
  2158. }
  2159. if iNdEx >= l {
  2160. return io.ErrUnexpectedEOF
  2161. }
  2162. b := dAtA[iNdEx]
  2163. iNdEx++
  2164. wire |= uint64(b&0x7F) << shift
  2165. if b < 0x80 {
  2166. break
  2167. }
  2168. }
  2169. fieldNum := int32(wire >> 3)
  2170. wireType := int(wire & 0x7)
  2171. if wireType == 4 {
  2172. return fmt.Errorf("proto: ProclaimRequest: wiretype end group for non-group")
  2173. }
  2174. if fieldNum <= 0 {
  2175. return fmt.Errorf("proto: ProclaimRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  2176. }
  2177. switch fieldNum {
  2178. case 1:
  2179. if wireType != 2 {
  2180. return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType)
  2181. }
  2182. var msglen int
  2183. for shift := uint(0); ; shift += 7 {
  2184. if shift >= 64 {
  2185. return ErrIntOverflowV3Election
  2186. }
  2187. if iNdEx >= l {
  2188. return io.ErrUnexpectedEOF
  2189. }
  2190. b := dAtA[iNdEx]
  2191. iNdEx++
  2192. msglen |= int(b&0x7F) << shift
  2193. if b < 0x80 {
  2194. break
  2195. }
  2196. }
  2197. if msglen < 0 {
  2198. return ErrInvalidLengthV3Election
  2199. }
  2200. postIndex := iNdEx + msglen
  2201. if postIndex < 0 {
  2202. return ErrInvalidLengthV3Election
  2203. }
  2204. if postIndex > l {
  2205. return io.ErrUnexpectedEOF
  2206. }
  2207. if m.Leader == nil {
  2208. m.Leader = &LeaderKey{}
  2209. }
  2210. if err := m.Leader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2211. return err
  2212. }
  2213. iNdEx = postIndex
  2214. case 2:
  2215. if wireType != 2 {
  2216. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  2217. }
  2218. var byteLen int
  2219. for shift := uint(0); ; shift += 7 {
  2220. if shift >= 64 {
  2221. return ErrIntOverflowV3Election
  2222. }
  2223. if iNdEx >= l {
  2224. return io.ErrUnexpectedEOF
  2225. }
  2226. b := dAtA[iNdEx]
  2227. iNdEx++
  2228. byteLen |= int(b&0x7F) << shift
  2229. if b < 0x80 {
  2230. break
  2231. }
  2232. }
  2233. if byteLen < 0 {
  2234. return ErrInvalidLengthV3Election
  2235. }
  2236. postIndex := iNdEx + byteLen
  2237. if postIndex < 0 {
  2238. return ErrInvalidLengthV3Election
  2239. }
  2240. if postIndex > l {
  2241. return io.ErrUnexpectedEOF
  2242. }
  2243. m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
  2244. if m.Value == nil {
  2245. m.Value = []byte{}
  2246. }
  2247. iNdEx = postIndex
  2248. default:
  2249. iNdEx = preIndex
  2250. skippy, err := skipV3Election(dAtA[iNdEx:])
  2251. if err != nil {
  2252. return err
  2253. }
  2254. if skippy < 0 {
  2255. return ErrInvalidLengthV3Election
  2256. }
  2257. if (iNdEx + skippy) < 0 {
  2258. return ErrInvalidLengthV3Election
  2259. }
  2260. if (iNdEx + skippy) > l {
  2261. return io.ErrUnexpectedEOF
  2262. }
  2263. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  2264. iNdEx += skippy
  2265. }
  2266. }
  2267. if iNdEx > l {
  2268. return io.ErrUnexpectedEOF
  2269. }
  2270. return nil
  2271. }
  2272. func (m *ProclaimResponse) Unmarshal(dAtA []byte) error {
  2273. l := len(dAtA)
  2274. iNdEx := 0
  2275. for iNdEx < l {
  2276. preIndex := iNdEx
  2277. var wire uint64
  2278. for shift := uint(0); ; shift += 7 {
  2279. if shift >= 64 {
  2280. return ErrIntOverflowV3Election
  2281. }
  2282. if iNdEx >= l {
  2283. return io.ErrUnexpectedEOF
  2284. }
  2285. b := dAtA[iNdEx]
  2286. iNdEx++
  2287. wire |= uint64(b&0x7F) << shift
  2288. if b < 0x80 {
  2289. break
  2290. }
  2291. }
  2292. fieldNum := int32(wire >> 3)
  2293. wireType := int(wire & 0x7)
  2294. if wireType == 4 {
  2295. return fmt.Errorf("proto: ProclaimResponse: wiretype end group for non-group")
  2296. }
  2297. if fieldNum <= 0 {
  2298. return fmt.Errorf("proto: ProclaimResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  2299. }
  2300. switch fieldNum {
  2301. case 1:
  2302. if wireType != 2 {
  2303. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  2304. }
  2305. var msglen int
  2306. for shift := uint(0); ; shift += 7 {
  2307. if shift >= 64 {
  2308. return ErrIntOverflowV3Election
  2309. }
  2310. if iNdEx >= l {
  2311. return io.ErrUnexpectedEOF
  2312. }
  2313. b := dAtA[iNdEx]
  2314. iNdEx++
  2315. msglen |= int(b&0x7F) << shift
  2316. if b < 0x80 {
  2317. break
  2318. }
  2319. }
  2320. if msglen < 0 {
  2321. return ErrInvalidLengthV3Election
  2322. }
  2323. postIndex := iNdEx + msglen
  2324. if postIndex < 0 {
  2325. return ErrInvalidLengthV3Election
  2326. }
  2327. if postIndex > l {
  2328. return io.ErrUnexpectedEOF
  2329. }
  2330. if m.Header == nil {
  2331. m.Header = &etcdserverpb.ResponseHeader{}
  2332. }
  2333. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2334. return err
  2335. }
  2336. iNdEx = postIndex
  2337. default:
  2338. iNdEx = preIndex
  2339. skippy, err := skipV3Election(dAtA[iNdEx:])
  2340. if err != nil {
  2341. return err
  2342. }
  2343. if skippy < 0 {
  2344. return ErrInvalidLengthV3Election
  2345. }
  2346. if (iNdEx + skippy) < 0 {
  2347. return ErrInvalidLengthV3Election
  2348. }
  2349. if (iNdEx + skippy) > l {
  2350. return io.ErrUnexpectedEOF
  2351. }
  2352. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  2353. iNdEx += skippy
  2354. }
  2355. }
  2356. if iNdEx > l {
  2357. return io.ErrUnexpectedEOF
  2358. }
  2359. return nil
  2360. }
  2361. func skipV3Election(dAtA []byte) (n int, err error) {
  2362. l := len(dAtA)
  2363. iNdEx := 0
  2364. for iNdEx < l {
  2365. var wire uint64
  2366. for shift := uint(0); ; shift += 7 {
  2367. if shift >= 64 {
  2368. return 0, ErrIntOverflowV3Election
  2369. }
  2370. if iNdEx >= l {
  2371. return 0, io.ErrUnexpectedEOF
  2372. }
  2373. b := dAtA[iNdEx]
  2374. iNdEx++
  2375. wire |= (uint64(b) & 0x7F) << shift
  2376. if b < 0x80 {
  2377. break
  2378. }
  2379. }
  2380. wireType := int(wire & 0x7)
  2381. switch wireType {
  2382. case 0:
  2383. for shift := uint(0); ; shift += 7 {
  2384. if shift >= 64 {
  2385. return 0, ErrIntOverflowV3Election
  2386. }
  2387. if iNdEx >= l {
  2388. return 0, io.ErrUnexpectedEOF
  2389. }
  2390. iNdEx++
  2391. if dAtA[iNdEx-1] < 0x80 {
  2392. break
  2393. }
  2394. }
  2395. return iNdEx, nil
  2396. case 1:
  2397. iNdEx += 8
  2398. return iNdEx, nil
  2399. case 2:
  2400. var length int
  2401. for shift := uint(0); ; shift += 7 {
  2402. if shift >= 64 {
  2403. return 0, ErrIntOverflowV3Election
  2404. }
  2405. if iNdEx >= l {
  2406. return 0, io.ErrUnexpectedEOF
  2407. }
  2408. b := dAtA[iNdEx]
  2409. iNdEx++
  2410. length |= (int(b) & 0x7F) << shift
  2411. if b < 0x80 {
  2412. break
  2413. }
  2414. }
  2415. if length < 0 {
  2416. return 0, ErrInvalidLengthV3Election
  2417. }
  2418. iNdEx += length
  2419. if iNdEx < 0 {
  2420. return 0, ErrInvalidLengthV3Election
  2421. }
  2422. return iNdEx, nil
  2423. case 3:
  2424. for {
  2425. var innerWire uint64
  2426. var start int = iNdEx
  2427. for shift := uint(0); ; shift += 7 {
  2428. if shift >= 64 {
  2429. return 0, ErrIntOverflowV3Election
  2430. }
  2431. if iNdEx >= l {
  2432. return 0, io.ErrUnexpectedEOF
  2433. }
  2434. b := dAtA[iNdEx]
  2435. iNdEx++
  2436. innerWire |= (uint64(b) & 0x7F) << shift
  2437. if b < 0x80 {
  2438. break
  2439. }
  2440. }
  2441. innerWireType := int(innerWire & 0x7)
  2442. if innerWireType == 4 {
  2443. break
  2444. }
  2445. next, err := skipV3Election(dAtA[start:])
  2446. if err != nil {
  2447. return 0, err
  2448. }
  2449. iNdEx = start + next
  2450. if iNdEx < 0 {
  2451. return 0, ErrInvalidLengthV3Election
  2452. }
  2453. }
  2454. return iNdEx, nil
  2455. case 4:
  2456. return iNdEx, nil
  2457. case 5:
  2458. iNdEx += 4
  2459. return iNdEx, nil
  2460. default:
  2461. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  2462. }
  2463. }
  2464. panic("unreachable")
  2465. }
  2466. var (
  2467. ErrInvalidLengthV3Election = fmt.Errorf("proto: negative length found during unmarshaling")
  2468. ErrIntOverflowV3Election = fmt.Errorf("proto: integer overflow")
  2469. )