v3election.pb.go 50 KB

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