v3election.pb.go 51 KB

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