v3election.pb.go 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: v3election.proto
  3. /*
  4. Package v3electionpb is a generated protocol buffer package.
  5. It is generated from these files:
  6. v3election.proto
  7. It has these top-level messages:
  8. CampaignRequest
  9. CampaignResponse
  10. LeaderKey
  11. LeaderRequest
  12. LeaderResponse
  13. ResignRequest
  14. ResignResponse
  15. ProclaimRequest
  16. ProclaimResponse
  17. */
  18. package v3electionpb
  19. import (
  20. "fmt"
  21. proto "github.com/golang/protobuf/proto"
  22. math "math"
  23. _ "github.com/gogo/protobuf/gogoproto"
  24. etcdserverpb "go.etcd.io/etcd/etcdserver/etcdserverpb"
  25. mvccpb "go.etcd.io/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 encodeVarintV3Election(dAtA []byte, offset int, v uint64) int {
  744. for v >= 1<<7 {
  745. dAtA[offset] = uint8(v&0x7f | 0x80)
  746. v >>= 7
  747. offset++
  748. }
  749. dAtA[offset] = uint8(v)
  750. return offset + 1
  751. }
  752. func (m *CampaignRequest) Size() (n int) {
  753. var l int
  754. _ = l
  755. l = len(m.Name)
  756. if l > 0 {
  757. n += 1 + l + sovV3Election(uint64(l))
  758. }
  759. if m.Lease != 0 {
  760. n += 1 + sovV3Election(uint64(m.Lease))
  761. }
  762. l = len(m.Value)
  763. if l > 0 {
  764. n += 1 + l + sovV3Election(uint64(l))
  765. }
  766. return n
  767. }
  768. func (m *CampaignResponse) Size() (n int) {
  769. var l int
  770. _ = l
  771. if m.Header != nil {
  772. l = m.Header.Size()
  773. n += 1 + l + sovV3Election(uint64(l))
  774. }
  775. if m.Leader != nil {
  776. l = m.Leader.Size()
  777. n += 1 + l + sovV3Election(uint64(l))
  778. }
  779. return n
  780. }
  781. func (m *LeaderKey) Size() (n int) {
  782. var l int
  783. _ = l
  784. l = len(m.Name)
  785. if l > 0 {
  786. n += 1 + l + sovV3Election(uint64(l))
  787. }
  788. l = len(m.Key)
  789. if l > 0 {
  790. n += 1 + l + sovV3Election(uint64(l))
  791. }
  792. if m.Rev != 0 {
  793. n += 1 + sovV3Election(uint64(m.Rev))
  794. }
  795. if m.Lease != 0 {
  796. n += 1 + sovV3Election(uint64(m.Lease))
  797. }
  798. return n
  799. }
  800. func (m *LeaderRequest) Size() (n int) {
  801. var l int
  802. _ = l
  803. l = len(m.Name)
  804. if l > 0 {
  805. n += 1 + l + sovV3Election(uint64(l))
  806. }
  807. return n
  808. }
  809. func (m *LeaderResponse) Size() (n int) {
  810. var l int
  811. _ = l
  812. if m.Header != nil {
  813. l = m.Header.Size()
  814. n += 1 + l + sovV3Election(uint64(l))
  815. }
  816. if m.Kv != nil {
  817. l = m.Kv.Size()
  818. n += 1 + l + sovV3Election(uint64(l))
  819. }
  820. return n
  821. }
  822. func (m *ResignRequest) Size() (n int) {
  823. var l int
  824. _ = l
  825. if m.Leader != nil {
  826. l = m.Leader.Size()
  827. n += 1 + l + sovV3Election(uint64(l))
  828. }
  829. return n
  830. }
  831. func (m *ResignResponse) Size() (n int) {
  832. var l int
  833. _ = l
  834. if m.Header != nil {
  835. l = m.Header.Size()
  836. n += 1 + l + sovV3Election(uint64(l))
  837. }
  838. return n
  839. }
  840. func (m *ProclaimRequest) 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. l = len(m.Value)
  848. if l > 0 {
  849. n += 1 + l + sovV3Election(uint64(l))
  850. }
  851. return n
  852. }
  853. func (m *ProclaimResponse) Size() (n int) {
  854. var l int
  855. _ = l
  856. if m.Header != nil {
  857. l = m.Header.Size()
  858. n += 1 + l + sovV3Election(uint64(l))
  859. }
  860. return n
  861. }
  862. func sovV3Election(x uint64) (n int) {
  863. for {
  864. n++
  865. x >>= 7
  866. if x == 0 {
  867. break
  868. }
  869. }
  870. return n
  871. }
  872. func sozV3Election(x uint64) (n int) {
  873. return sovV3Election(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  874. }
  875. func (m *CampaignRequest) Unmarshal(dAtA []byte) error {
  876. l := len(dAtA)
  877. iNdEx := 0
  878. for iNdEx < l {
  879. preIndex := iNdEx
  880. var wire uint64
  881. for shift := uint(0); ; shift += 7 {
  882. if shift >= 64 {
  883. return ErrIntOverflowV3Election
  884. }
  885. if iNdEx >= l {
  886. return io.ErrUnexpectedEOF
  887. }
  888. b := dAtA[iNdEx]
  889. iNdEx++
  890. wire |= (uint64(b) & 0x7F) << shift
  891. if b < 0x80 {
  892. break
  893. }
  894. }
  895. fieldNum := int32(wire >> 3)
  896. wireType := int(wire & 0x7)
  897. if wireType == 4 {
  898. return fmt.Errorf("proto: CampaignRequest: wiretype end group for non-group")
  899. }
  900. if fieldNum <= 0 {
  901. return fmt.Errorf("proto: CampaignRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  902. }
  903. switch fieldNum {
  904. case 1:
  905. if wireType != 2 {
  906. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  907. }
  908. var byteLen int
  909. for shift := uint(0); ; shift += 7 {
  910. if shift >= 64 {
  911. return ErrIntOverflowV3Election
  912. }
  913. if iNdEx >= l {
  914. return io.ErrUnexpectedEOF
  915. }
  916. b := dAtA[iNdEx]
  917. iNdEx++
  918. byteLen |= (int(b) & 0x7F) << shift
  919. if b < 0x80 {
  920. break
  921. }
  922. }
  923. if byteLen < 0 {
  924. return ErrInvalidLengthV3Election
  925. }
  926. postIndex := iNdEx + byteLen
  927. if postIndex > l {
  928. return io.ErrUnexpectedEOF
  929. }
  930. m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
  931. if m.Name == nil {
  932. m.Name = []byte{}
  933. }
  934. iNdEx = postIndex
  935. case 2:
  936. if wireType != 0 {
  937. return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
  938. }
  939. m.Lease = 0
  940. for shift := uint(0); ; shift += 7 {
  941. if shift >= 64 {
  942. return ErrIntOverflowV3Election
  943. }
  944. if iNdEx >= l {
  945. return io.ErrUnexpectedEOF
  946. }
  947. b := dAtA[iNdEx]
  948. iNdEx++
  949. m.Lease |= (int64(b) & 0x7F) << shift
  950. if b < 0x80 {
  951. break
  952. }
  953. }
  954. case 3:
  955. if wireType != 2 {
  956. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  957. }
  958. var byteLen int
  959. for shift := uint(0); ; shift += 7 {
  960. if shift >= 64 {
  961. return ErrIntOverflowV3Election
  962. }
  963. if iNdEx >= l {
  964. return io.ErrUnexpectedEOF
  965. }
  966. b := dAtA[iNdEx]
  967. iNdEx++
  968. byteLen |= (int(b) & 0x7F) << shift
  969. if b < 0x80 {
  970. break
  971. }
  972. }
  973. if byteLen < 0 {
  974. return ErrInvalidLengthV3Election
  975. }
  976. postIndex := iNdEx + byteLen
  977. if postIndex > l {
  978. return io.ErrUnexpectedEOF
  979. }
  980. m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
  981. if m.Value == nil {
  982. m.Value = []byte{}
  983. }
  984. iNdEx = postIndex
  985. default:
  986. iNdEx = preIndex
  987. skippy, err := skipV3Election(dAtA[iNdEx:])
  988. if err != nil {
  989. return err
  990. }
  991. if skippy < 0 {
  992. return ErrInvalidLengthV3Election
  993. }
  994. if (iNdEx + skippy) > l {
  995. return io.ErrUnexpectedEOF
  996. }
  997. iNdEx += skippy
  998. }
  999. }
  1000. if iNdEx > l {
  1001. return io.ErrUnexpectedEOF
  1002. }
  1003. return nil
  1004. }
  1005. func (m *CampaignResponse) Unmarshal(dAtA []byte) error {
  1006. l := len(dAtA)
  1007. iNdEx := 0
  1008. for iNdEx < l {
  1009. preIndex := iNdEx
  1010. var wire uint64
  1011. for shift := uint(0); ; shift += 7 {
  1012. if shift >= 64 {
  1013. return ErrIntOverflowV3Election
  1014. }
  1015. if iNdEx >= l {
  1016. return io.ErrUnexpectedEOF
  1017. }
  1018. b := dAtA[iNdEx]
  1019. iNdEx++
  1020. wire |= (uint64(b) & 0x7F) << shift
  1021. if b < 0x80 {
  1022. break
  1023. }
  1024. }
  1025. fieldNum := int32(wire >> 3)
  1026. wireType := int(wire & 0x7)
  1027. if wireType == 4 {
  1028. return fmt.Errorf("proto: CampaignResponse: wiretype end group for non-group")
  1029. }
  1030. if fieldNum <= 0 {
  1031. return fmt.Errorf("proto: CampaignResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1032. }
  1033. switch fieldNum {
  1034. case 1:
  1035. if wireType != 2 {
  1036. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  1037. }
  1038. var msglen int
  1039. for shift := uint(0); ; shift += 7 {
  1040. if shift >= 64 {
  1041. return ErrIntOverflowV3Election
  1042. }
  1043. if iNdEx >= l {
  1044. return io.ErrUnexpectedEOF
  1045. }
  1046. b := dAtA[iNdEx]
  1047. iNdEx++
  1048. msglen |= (int(b) & 0x7F) << shift
  1049. if b < 0x80 {
  1050. break
  1051. }
  1052. }
  1053. if msglen < 0 {
  1054. return ErrInvalidLengthV3Election
  1055. }
  1056. postIndex := iNdEx + msglen
  1057. if postIndex > l {
  1058. return io.ErrUnexpectedEOF
  1059. }
  1060. if m.Header == nil {
  1061. m.Header = &etcdserverpb.ResponseHeader{}
  1062. }
  1063. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1064. return err
  1065. }
  1066. iNdEx = postIndex
  1067. case 2:
  1068. if wireType != 2 {
  1069. return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType)
  1070. }
  1071. var msglen int
  1072. for shift := uint(0); ; shift += 7 {
  1073. if shift >= 64 {
  1074. return ErrIntOverflowV3Election
  1075. }
  1076. if iNdEx >= l {
  1077. return io.ErrUnexpectedEOF
  1078. }
  1079. b := dAtA[iNdEx]
  1080. iNdEx++
  1081. msglen |= (int(b) & 0x7F) << shift
  1082. if b < 0x80 {
  1083. break
  1084. }
  1085. }
  1086. if msglen < 0 {
  1087. return ErrInvalidLengthV3Election
  1088. }
  1089. postIndex := iNdEx + msglen
  1090. if postIndex > l {
  1091. return io.ErrUnexpectedEOF
  1092. }
  1093. if m.Leader == nil {
  1094. m.Leader = &LeaderKey{}
  1095. }
  1096. if err := m.Leader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1097. return err
  1098. }
  1099. iNdEx = postIndex
  1100. default:
  1101. iNdEx = preIndex
  1102. skippy, err := skipV3Election(dAtA[iNdEx:])
  1103. if err != nil {
  1104. return err
  1105. }
  1106. if skippy < 0 {
  1107. return ErrInvalidLengthV3Election
  1108. }
  1109. if (iNdEx + skippy) > l {
  1110. return io.ErrUnexpectedEOF
  1111. }
  1112. iNdEx += skippy
  1113. }
  1114. }
  1115. if iNdEx > l {
  1116. return io.ErrUnexpectedEOF
  1117. }
  1118. return nil
  1119. }
  1120. func (m *LeaderKey) Unmarshal(dAtA []byte) error {
  1121. l := len(dAtA)
  1122. iNdEx := 0
  1123. for iNdEx < l {
  1124. preIndex := iNdEx
  1125. var wire uint64
  1126. for shift := uint(0); ; shift += 7 {
  1127. if shift >= 64 {
  1128. return ErrIntOverflowV3Election
  1129. }
  1130. if iNdEx >= l {
  1131. return io.ErrUnexpectedEOF
  1132. }
  1133. b := dAtA[iNdEx]
  1134. iNdEx++
  1135. wire |= (uint64(b) & 0x7F) << shift
  1136. if b < 0x80 {
  1137. break
  1138. }
  1139. }
  1140. fieldNum := int32(wire >> 3)
  1141. wireType := int(wire & 0x7)
  1142. if wireType == 4 {
  1143. return fmt.Errorf("proto: LeaderKey: wiretype end group for non-group")
  1144. }
  1145. if fieldNum <= 0 {
  1146. return fmt.Errorf("proto: LeaderKey: illegal tag %d (wire type %d)", fieldNum, wire)
  1147. }
  1148. switch fieldNum {
  1149. case 1:
  1150. if wireType != 2 {
  1151. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  1152. }
  1153. var byteLen int
  1154. for shift := uint(0); ; shift += 7 {
  1155. if shift >= 64 {
  1156. return ErrIntOverflowV3Election
  1157. }
  1158. if iNdEx >= l {
  1159. return io.ErrUnexpectedEOF
  1160. }
  1161. b := dAtA[iNdEx]
  1162. iNdEx++
  1163. byteLen |= (int(b) & 0x7F) << shift
  1164. if b < 0x80 {
  1165. break
  1166. }
  1167. }
  1168. if byteLen < 0 {
  1169. return ErrInvalidLengthV3Election
  1170. }
  1171. postIndex := iNdEx + byteLen
  1172. if postIndex > l {
  1173. return io.ErrUnexpectedEOF
  1174. }
  1175. m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
  1176. if m.Name == nil {
  1177. m.Name = []byte{}
  1178. }
  1179. iNdEx = postIndex
  1180. case 2:
  1181. if wireType != 2 {
  1182. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  1183. }
  1184. var byteLen int
  1185. for shift := uint(0); ; shift += 7 {
  1186. if shift >= 64 {
  1187. return ErrIntOverflowV3Election
  1188. }
  1189. if iNdEx >= l {
  1190. return io.ErrUnexpectedEOF
  1191. }
  1192. b := dAtA[iNdEx]
  1193. iNdEx++
  1194. byteLen |= (int(b) & 0x7F) << shift
  1195. if b < 0x80 {
  1196. break
  1197. }
  1198. }
  1199. if byteLen < 0 {
  1200. return ErrInvalidLengthV3Election
  1201. }
  1202. postIndex := iNdEx + byteLen
  1203. if postIndex > l {
  1204. return io.ErrUnexpectedEOF
  1205. }
  1206. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  1207. if m.Key == nil {
  1208. m.Key = []byte{}
  1209. }
  1210. iNdEx = postIndex
  1211. case 3:
  1212. if wireType != 0 {
  1213. return fmt.Errorf("proto: wrong wireType = %d for field Rev", wireType)
  1214. }
  1215. m.Rev = 0
  1216. for shift := uint(0); ; shift += 7 {
  1217. if shift >= 64 {
  1218. return ErrIntOverflowV3Election
  1219. }
  1220. if iNdEx >= l {
  1221. return io.ErrUnexpectedEOF
  1222. }
  1223. b := dAtA[iNdEx]
  1224. iNdEx++
  1225. m.Rev |= (int64(b) & 0x7F) << shift
  1226. if b < 0x80 {
  1227. break
  1228. }
  1229. }
  1230. case 4:
  1231. if wireType != 0 {
  1232. return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
  1233. }
  1234. m.Lease = 0
  1235. for shift := uint(0); ; shift += 7 {
  1236. if shift >= 64 {
  1237. return ErrIntOverflowV3Election
  1238. }
  1239. if iNdEx >= l {
  1240. return io.ErrUnexpectedEOF
  1241. }
  1242. b := dAtA[iNdEx]
  1243. iNdEx++
  1244. m.Lease |= (int64(b) & 0x7F) << shift
  1245. if b < 0x80 {
  1246. break
  1247. }
  1248. }
  1249. default:
  1250. iNdEx = preIndex
  1251. skippy, err := skipV3Election(dAtA[iNdEx:])
  1252. if err != nil {
  1253. return err
  1254. }
  1255. if skippy < 0 {
  1256. return ErrInvalidLengthV3Election
  1257. }
  1258. if (iNdEx + skippy) > l {
  1259. return io.ErrUnexpectedEOF
  1260. }
  1261. iNdEx += skippy
  1262. }
  1263. }
  1264. if iNdEx > l {
  1265. return io.ErrUnexpectedEOF
  1266. }
  1267. return nil
  1268. }
  1269. func (m *LeaderRequest) Unmarshal(dAtA []byte) error {
  1270. l := len(dAtA)
  1271. iNdEx := 0
  1272. for iNdEx < l {
  1273. preIndex := iNdEx
  1274. var wire uint64
  1275. for shift := uint(0); ; shift += 7 {
  1276. if shift >= 64 {
  1277. return ErrIntOverflowV3Election
  1278. }
  1279. if iNdEx >= l {
  1280. return io.ErrUnexpectedEOF
  1281. }
  1282. b := dAtA[iNdEx]
  1283. iNdEx++
  1284. wire |= (uint64(b) & 0x7F) << shift
  1285. if b < 0x80 {
  1286. break
  1287. }
  1288. }
  1289. fieldNum := int32(wire >> 3)
  1290. wireType := int(wire & 0x7)
  1291. if wireType == 4 {
  1292. return fmt.Errorf("proto: LeaderRequest: wiretype end group for non-group")
  1293. }
  1294. if fieldNum <= 0 {
  1295. return fmt.Errorf("proto: LeaderRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1296. }
  1297. switch fieldNum {
  1298. case 1:
  1299. if wireType != 2 {
  1300. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  1301. }
  1302. var byteLen int
  1303. for shift := uint(0); ; shift += 7 {
  1304. if shift >= 64 {
  1305. return ErrIntOverflowV3Election
  1306. }
  1307. if iNdEx >= l {
  1308. return io.ErrUnexpectedEOF
  1309. }
  1310. b := dAtA[iNdEx]
  1311. iNdEx++
  1312. byteLen |= (int(b) & 0x7F) << shift
  1313. if b < 0x80 {
  1314. break
  1315. }
  1316. }
  1317. if byteLen < 0 {
  1318. return ErrInvalidLengthV3Election
  1319. }
  1320. postIndex := iNdEx + byteLen
  1321. if postIndex > l {
  1322. return io.ErrUnexpectedEOF
  1323. }
  1324. m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
  1325. if m.Name == nil {
  1326. m.Name = []byte{}
  1327. }
  1328. iNdEx = postIndex
  1329. default:
  1330. iNdEx = preIndex
  1331. skippy, err := skipV3Election(dAtA[iNdEx:])
  1332. if err != nil {
  1333. return err
  1334. }
  1335. if skippy < 0 {
  1336. return ErrInvalidLengthV3Election
  1337. }
  1338. if (iNdEx + skippy) > l {
  1339. return io.ErrUnexpectedEOF
  1340. }
  1341. iNdEx += skippy
  1342. }
  1343. }
  1344. if iNdEx > l {
  1345. return io.ErrUnexpectedEOF
  1346. }
  1347. return nil
  1348. }
  1349. func (m *LeaderResponse) Unmarshal(dAtA []byte) error {
  1350. l := len(dAtA)
  1351. iNdEx := 0
  1352. for iNdEx < l {
  1353. preIndex := iNdEx
  1354. var wire uint64
  1355. for shift := uint(0); ; shift += 7 {
  1356. if shift >= 64 {
  1357. return ErrIntOverflowV3Election
  1358. }
  1359. if iNdEx >= l {
  1360. return io.ErrUnexpectedEOF
  1361. }
  1362. b := dAtA[iNdEx]
  1363. iNdEx++
  1364. wire |= (uint64(b) & 0x7F) << shift
  1365. if b < 0x80 {
  1366. break
  1367. }
  1368. }
  1369. fieldNum := int32(wire >> 3)
  1370. wireType := int(wire & 0x7)
  1371. if wireType == 4 {
  1372. return fmt.Errorf("proto: LeaderResponse: wiretype end group for non-group")
  1373. }
  1374. if fieldNum <= 0 {
  1375. return fmt.Errorf("proto: LeaderResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1376. }
  1377. switch fieldNum {
  1378. case 1:
  1379. if wireType != 2 {
  1380. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  1381. }
  1382. var msglen int
  1383. for shift := uint(0); ; shift += 7 {
  1384. if shift >= 64 {
  1385. return ErrIntOverflowV3Election
  1386. }
  1387. if iNdEx >= l {
  1388. return io.ErrUnexpectedEOF
  1389. }
  1390. b := dAtA[iNdEx]
  1391. iNdEx++
  1392. msglen |= (int(b) & 0x7F) << shift
  1393. if b < 0x80 {
  1394. break
  1395. }
  1396. }
  1397. if msglen < 0 {
  1398. return ErrInvalidLengthV3Election
  1399. }
  1400. postIndex := iNdEx + msglen
  1401. if postIndex > l {
  1402. return io.ErrUnexpectedEOF
  1403. }
  1404. if m.Header == nil {
  1405. m.Header = &etcdserverpb.ResponseHeader{}
  1406. }
  1407. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1408. return err
  1409. }
  1410. iNdEx = postIndex
  1411. case 2:
  1412. if wireType != 2 {
  1413. return fmt.Errorf("proto: wrong wireType = %d for field Kv", wireType)
  1414. }
  1415. var msglen int
  1416. for shift := uint(0); ; shift += 7 {
  1417. if shift >= 64 {
  1418. return ErrIntOverflowV3Election
  1419. }
  1420. if iNdEx >= l {
  1421. return io.ErrUnexpectedEOF
  1422. }
  1423. b := dAtA[iNdEx]
  1424. iNdEx++
  1425. msglen |= (int(b) & 0x7F) << shift
  1426. if b < 0x80 {
  1427. break
  1428. }
  1429. }
  1430. if msglen < 0 {
  1431. return ErrInvalidLengthV3Election
  1432. }
  1433. postIndex := iNdEx + msglen
  1434. if postIndex > l {
  1435. return io.ErrUnexpectedEOF
  1436. }
  1437. if m.Kv == nil {
  1438. m.Kv = &mvccpb.KeyValue{}
  1439. }
  1440. if err := m.Kv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1441. return err
  1442. }
  1443. iNdEx = postIndex
  1444. default:
  1445. iNdEx = preIndex
  1446. skippy, err := skipV3Election(dAtA[iNdEx:])
  1447. if err != nil {
  1448. return err
  1449. }
  1450. if skippy < 0 {
  1451. return ErrInvalidLengthV3Election
  1452. }
  1453. if (iNdEx + skippy) > l {
  1454. return io.ErrUnexpectedEOF
  1455. }
  1456. iNdEx += skippy
  1457. }
  1458. }
  1459. if iNdEx > l {
  1460. return io.ErrUnexpectedEOF
  1461. }
  1462. return nil
  1463. }
  1464. func (m *ResignRequest) Unmarshal(dAtA []byte) error {
  1465. l := len(dAtA)
  1466. iNdEx := 0
  1467. for iNdEx < l {
  1468. preIndex := iNdEx
  1469. var wire uint64
  1470. for shift := uint(0); ; shift += 7 {
  1471. if shift >= 64 {
  1472. return ErrIntOverflowV3Election
  1473. }
  1474. if iNdEx >= l {
  1475. return io.ErrUnexpectedEOF
  1476. }
  1477. b := dAtA[iNdEx]
  1478. iNdEx++
  1479. wire |= (uint64(b) & 0x7F) << shift
  1480. if b < 0x80 {
  1481. break
  1482. }
  1483. }
  1484. fieldNum := int32(wire >> 3)
  1485. wireType := int(wire & 0x7)
  1486. if wireType == 4 {
  1487. return fmt.Errorf("proto: ResignRequest: wiretype end group for non-group")
  1488. }
  1489. if fieldNum <= 0 {
  1490. return fmt.Errorf("proto: ResignRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1491. }
  1492. switch fieldNum {
  1493. case 1:
  1494. if wireType != 2 {
  1495. return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType)
  1496. }
  1497. var msglen int
  1498. for shift := uint(0); ; shift += 7 {
  1499. if shift >= 64 {
  1500. return ErrIntOverflowV3Election
  1501. }
  1502. if iNdEx >= l {
  1503. return io.ErrUnexpectedEOF
  1504. }
  1505. b := dAtA[iNdEx]
  1506. iNdEx++
  1507. msglen |= (int(b) & 0x7F) << shift
  1508. if b < 0x80 {
  1509. break
  1510. }
  1511. }
  1512. if msglen < 0 {
  1513. return ErrInvalidLengthV3Election
  1514. }
  1515. postIndex := iNdEx + msglen
  1516. if postIndex > l {
  1517. return io.ErrUnexpectedEOF
  1518. }
  1519. if m.Leader == nil {
  1520. m.Leader = &LeaderKey{}
  1521. }
  1522. if err := m.Leader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1523. return err
  1524. }
  1525. iNdEx = postIndex
  1526. default:
  1527. iNdEx = preIndex
  1528. skippy, err := skipV3Election(dAtA[iNdEx:])
  1529. if err != nil {
  1530. return err
  1531. }
  1532. if skippy < 0 {
  1533. return ErrInvalidLengthV3Election
  1534. }
  1535. if (iNdEx + skippy) > l {
  1536. return io.ErrUnexpectedEOF
  1537. }
  1538. iNdEx += skippy
  1539. }
  1540. }
  1541. if iNdEx > l {
  1542. return io.ErrUnexpectedEOF
  1543. }
  1544. return nil
  1545. }
  1546. func (m *ResignResponse) Unmarshal(dAtA []byte) error {
  1547. l := len(dAtA)
  1548. iNdEx := 0
  1549. for iNdEx < l {
  1550. preIndex := iNdEx
  1551. var wire uint64
  1552. for shift := uint(0); ; shift += 7 {
  1553. if shift >= 64 {
  1554. return ErrIntOverflowV3Election
  1555. }
  1556. if iNdEx >= l {
  1557. return io.ErrUnexpectedEOF
  1558. }
  1559. b := dAtA[iNdEx]
  1560. iNdEx++
  1561. wire |= (uint64(b) & 0x7F) << shift
  1562. if b < 0x80 {
  1563. break
  1564. }
  1565. }
  1566. fieldNum := int32(wire >> 3)
  1567. wireType := int(wire & 0x7)
  1568. if wireType == 4 {
  1569. return fmt.Errorf("proto: ResignResponse: wiretype end group for non-group")
  1570. }
  1571. if fieldNum <= 0 {
  1572. return fmt.Errorf("proto: ResignResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1573. }
  1574. switch fieldNum {
  1575. case 1:
  1576. if wireType != 2 {
  1577. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  1578. }
  1579. var msglen int
  1580. for shift := uint(0); ; shift += 7 {
  1581. if shift >= 64 {
  1582. return ErrIntOverflowV3Election
  1583. }
  1584. if iNdEx >= l {
  1585. return io.ErrUnexpectedEOF
  1586. }
  1587. b := dAtA[iNdEx]
  1588. iNdEx++
  1589. msglen |= (int(b) & 0x7F) << shift
  1590. if b < 0x80 {
  1591. break
  1592. }
  1593. }
  1594. if msglen < 0 {
  1595. return ErrInvalidLengthV3Election
  1596. }
  1597. postIndex := iNdEx + msglen
  1598. if postIndex > l {
  1599. return io.ErrUnexpectedEOF
  1600. }
  1601. if m.Header == nil {
  1602. m.Header = &etcdserverpb.ResponseHeader{}
  1603. }
  1604. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1605. return err
  1606. }
  1607. iNdEx = postIndex
  1608. default:
  1609. iNdEx = preIndex
  1610. skippy, err := skipV3Election(dAtA[iNdEx:])
  1611. if err != nil {
  1612. return err
  1613. }
  1614. if skippy < 0 {
  1615. return ErrInvalidLengthV3Election
  1616. }
  1617. if (iNdEx + skippy) > l {
  1618. return io.ErrUnexpectedEOF
  1619. }
  1620. iNdEx += skippy
  1621. }
  1622. }
  1623. if iNdEx > l {
  1624. return io.ErrUnexpectedEOF
  1625. }
  1626. return nil
  1627. }
  1628. func (m *ProclaimRequest) Unmarshal(dAtA []byte) error {
  1629. l := len(dAtA)
  1630. iNdEx := 0
  1631. for iNdEx < l {
  1632. preIndex := iNdEx
  1633. var wire uint64
  1634. for shift := uint(0); ; shift += 7 {
  1635. if shift >= 64 {
  1636. return ErrIntOverflowV3Election
  1637. }
  1638. if iNdEx >= l {
  1639. return io.ErrUnexpectedEOF
  1640. }
  1641. b := dAtA[iNdEx]
  1642. iNdEx++
  1643. wire |= (uint64(b) & 0x7F) << shift
  1644. if b < 0x80 {
  1645. break
  1646. }
  1647. }
  1648. fieldNum := int32(wire >> 3)
  1649. wireType := int(wire & 0x7)
  1650. if wireType == 4 {
  1651. return fmt.Errorf("proto: ProclaimRequest: wiretype end group for non-group")
  1652. }
  1653. if fieldNum <= 0 {
  1654. return fmt.Errorf("proto: ProclaimRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1655. }
  1656. switch fieldNum {
  1657. case 1:
  1658. if wireType != 2 {
  1659. return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType)
  1660. }
  1661. var msglen int
  1662. for shift := uint(0); ; shift += 7 {
  1663. if shift >= 64 {
  1664. return ErrIntOverflowV3Election
  1665. }
  1666. if iNdEx >= l {
  1667. return io.ErrUnexpectedEOF
  1668. }
  1669. b := dAtA[iNdEx]
  1670. iNdEx++
  1671. msglen |= (int(b) & 0x7F) << shift
  1672. if b < 0x80 {
  1673. break
  1674. }
  1675. }
  1676. if msglen < 0 {
  1677. return ErrInvalidLengthV3Election
  1678. }
  1679. postIndex := iNdEx + msglen
  1680. if postIndex > l {
  1681. return io.ErrUnexpectedEOF
  1682. }
  1683. if m.Leader == nil {
  1684. m.Leader = &LeaderKey{}
  1685. }
  1686. if err := m.Leader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1687. return err
  1688. }
  1689. iNdEx = postIndex
  1690. case 2:
  1691. if wireType != 2 {
  1692. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  1693. }
  1694. var byteLen int
  1695. for shift := uint(0); ; shift += 7 {
  1696. if shift >= 64 {
  1697. return ErrIntOverflowV3Election
  1698. }
  1699. if iNdEx >= l {
  1700. return io.ErrUnexpectedEOF
  1701. }
  1702. b := dAtA[iNdEx]
  1703. iNdEx++
  1704. byteLen |= (int(b) & 0x7F) << shift
  1705. if b < 0x80 {
  1706. break
  1707. }
  1708. }
  1709. if byteLen < 0 {
  1710. return ErrInvalidLengthV3Election
  1711. }
  1712. postIndex := iNdEx + byteLen
  1713. if postIndex > l {
  1714. return io.ErrUnexpectedEOF
  1715. }
  1716. m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
  1717. if m.Value == nil {
  1718. m.Value = []byte{}
  1719. }
  1720. iNdEx = postIndex
  1721. default:
  1722. iNdEx = preIndex
  1723. skippy, err := skipV3Election(dAtA[iNdEx:])
  1724. if err != nil {
  1725. return err
  1726. }
  1727. if skippy < 0 {
  1728. return ErrInvalidLengthV3Election
  1729. }
  1730. if (iNdEx + skippy) > l {
  1731. return io.ErrUnexpectedEOF
  1732. }
  1733. iNdEx += skippy
  1734. }
  1735. }
  1736. if iNdEx > l {
  1737. return io.ErrUnexpectedEOF
  1738. }
  1739. return nil
  1740. }
  1741. func (m *ProclaimResponse) Unmarshal(dAtA []byte) error {
  1742. l := len(dAtA)
  1743. iNdEx := 0
  1744. for iNdEx < l {
  1745. preIndex := iNdEx
  1746. var wire uint64
  1747. for shift := uint(0); ; shift += 7 {
  1748. if shift >= 64 {
  1749. return ErrIntOverflowV3Election
  1750. }
  1751. if iNdEx >= l {
  1752. return io.ErrUnexpectedEOF
  1753. }
  1754. b := dAtA[iNdEx]
  1755. iNdEx++
  1756. wire |= (uint64(b) & 0x7F) << shift
  1757. if b < 0x80 {
  1758. break
  1759. }
  1760. }
  1761. fieldNum := int32(wire >> 3)
  1762. wireType := int(wire & 0x7)
  1763. if wireType == 4 {
  1764. return fmt.Errorf("proto: ProclaimResponse: wiretype end group for non-group")
  1765. }
  1766. if fieldNum <= 0 {
  1767. return fmt.Errorf("proto: ProclaimResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1768. }
  1769. switch fieldNum {
  1770. case 1:
  1771. if wireType != 2 {
  1772. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  1773. }
  1774. var msglen int
  1775. for shift := uint(0); ; shift += 7 {
  1776. if shift >= 64 {
  1777. return ErrIntOverflowV3Election
  1778. }
  1779. if iNdEx >= l {
  1780. return io.ErrUnexpectedEOF
  1781. }
  1782. b := dAtA[iNdEx]
  1783. iNdEx++
  1784. msglen |= (int(b) & 0x7F) << shift
  1785. if b < 0x80 {
  1786. break
  1787. }
  1788. }
  1789. if msglen < 0 {
  1790. return ErrInvalidLengthV3Election
  1791. }
  1792. postIndex := iNdEx + msglen
  1793. if postIndex > l {
  1794. return io.ErrUnexpectedEOF
  1795. }
  1796. if m.Header == nil {
  1797. m.Header = &etcdserverpb.ResponseHeader{}
  1798. }
  1799. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1800. return err
  1801. }
  1802. iNdEx = postIndex
  1803. default:
  1804. iNdEx = preIndex
  1805. skippy, err := skipV3Election(dAtA[iNdEx:])
  1806. if err != nil {
  1807. return err
  1808. }
  1809. if skippy < 0 {
  1810. return ErrInvalidLengthV3Election
  1811. }
  1812. if (iNdEx + skippy) > l {
  1813. return io.ErrUnexpectedEOF
  1814. }
  1815. iNdEx += skippy
  1816. }
  1817. }
  1818. if iNdEx > l {
  1819. return io.ErrUnexpectedEOF
  1820. }
  1821. return nil
  1822. }
  1823. func skipV3Election(dAtA []byte) (n int, err error) {
  1824. l := len(dAtA)
  1825. iNdEx := 0
  1826. for iNdEx < l {
  1827. var wire uint64
  1828. for shift := uint(0); ; shift += 7 {
  1829. if shift >= 64 {
  1830. return 0, ErrIntOverflowV3Election
  1831. }
  1832. if iNdEx >= l {
  1833. return 0, io.ErrUnexpectedEOF
  1834. }
  1835. b := dAtA[iNdEx]
  1836. iNdEx++
  1837. wire |= (uint64(b) & 0x7F) << shift
  1838. if b < 0x80 {
  1839. break
  1840. }
  1841. }
  1842. wireType := int(wire & 0x7)
  1843. switch wireType {
  1844. case 0:
  1845. for shift := uint(0); ; shift += 7 {
  1846. if shift >= 64 {
  1847. return 0, ErrIntOverflowV3Election
  1848. }
  1849. if iNdEx >= l {
  1850. return 0, io.ErrUnexpectedEOF
  1851. }
  1852. iNdEx++
  1853. if dAtA[iNdEx-1] < 0x80 {
  1854. break
  1855. }
  1856. }
  1857. return iNdEx, nil
  1858. case 1:
  1859. iNdEx += 8
  1860. return iNdEx, nil
  1861. case 2:
  1862. var length int
  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. b := dAtA[iNdEx]
  1871. iNdEx++
  1872. length |= (int(b) & 0x7F) << shift
  1873. if b < 0x80 {
  1874. break
  1875. }
  1876. }
  1877. iNdEx += length
  1878. if length < 0 {
  1879. return 0, ErrInvalidLengthV3Election
  1880. }
  1881. return iNdEx, nil
  1882. case 3:
  1883. for {
  1884. var innerWire uint64
  1885. var start int = iNdEx
  1886. for shift := uint(0); ; shift += 7 {
  1887. if shift >= 64 {
  1888. return 0, ErrIntOverflowV3Election
  1889. }
  1890. if iNdEx >= l {
  1891. return 0, io.ErrUnexpectedEOF
  1892. }
  1893. b := dAtA[iNdEx]
  1894. iNdEx++
  1895. innerWire |= (uint64(b) & 0x7F) << shift
  1896. if b < 0x80 {
  1897. break
  1898. }
  1899. }
  1900. innerWireType := int(innerWire & 0x7)
  1901. if innerWireType == 4 {
  1902. break
  1903. }
  1904. next, err := skipV3Election(dAtA[start:])
  1905. if err != nil {
  1906. return 0, err
  1907. }
  1908. iNdEx = start + next
  1909. }
  1910. return iNdEx, nil
  1911. case 4:
  1912. return iNdEx, nil
  1913. case 5:
  1914. iNdEx += 4
  1915. return iNdEx, nil
  1916. default:
  1917. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1918. }
  1919. }
  1920. panic("unreachable")
  1921. }
  1922. var (
  1923. ErrInvalidLengthV3Election = fmt.Errorf("proto: negative length found during unmarshaling")
  1924. ErrIntOverflowV3Election = fmt.Errorf("proto: integer overflow")
  1925. )
  1926. func init() { proto.RegisterFile("v3election.proto", fileDescriptorV3Election) }
  1927. var fileDescriptorV3Election = []byte{
  1928. // 535 bytes of a gzipped FileDescriptorProto
  1929. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xcf, 0x6e, 0xd3, 0x40,
  1930. 0x10, 0xc6, 0x59, 0x27, 0x84, 0x32, 0xa4, 0xad, 0x65, 0x82, 0x48, 0x43, 0x30, 0xd1, 0x22, 0xa1,
  1931. 0x2a, 0x07, 0x2f, 0x6a, 0x38, 0xe5, 0x84, 0x40, 0xa0, 0x4a, 0x45, 0x02, 0x7c, 0x40, 0x70, 0xdc,
  1932. 0xb8, 0x23, 0x37, 0x8a, 0xe3, 0x35, 0xb6, 0x6b, 0x29, 0x57, 0x5e, 0x81, 0x03, 0x3c, 0x12, 0x47,
  1933. 0x24, 0x5e, 0x00, 0x05, 0x1e, 0x04, 0xed, 0xae, 0x8d, 0xff, 0x28, 0x41, 0xa8, 0xb9, 0x58, 0xe3,
  1934. 0x9d, 0xcf, 0xf3, 0x9b, 0x6f, 0x76, 0x12, 0x30, 0xb3, 0x09, 0x06, 0xe8, 0xa5, 0x73, 0x11, 0x3a,
  1935. 0x51, 0x2c, 0x52, 0x61, 0x75, 0xcb, 0x93, 0x68, 0x36, 0xe8, 0xf9, 0xc2, 0x17, 0x2a, 0xc1, 0x64,
  1936. 0xa4, 0x35, 0x83, 0x47, 0x98, 0x7a, 0xe7, 0x4c, 0x3e, 0x12, 0x8c, 0x33, 0x8c, 0x2b, 0x61, 0x34,
  1937. 0x63, 0x71, 0xe4, 0xe5, 0xba, 0x23, 0xa5, 0x5b, 0x66, 0x9e, 0xa7, 0x1e, 0xd1, 0x8c, 0x2d, 0xb2,
  1938. 0x3c, 0x35, 0xf4, 0x85, 0xf0, 0x03, 0x64, 0x3c, 0x9a, 0x33, 0x1e, 0x86, 0x22, 0xe5, 0x92, 0x98,
  1939. 0xe8, 0x2c, 0x7d, 0x0b, 0x87, 0xcf, 0xf9, 0x32, 0xe2, 0x73, 0x3f, 0x74, 0xf1, 0xe3, 0x25, 0x26,
  1940. 0xa9, 0x65, 0x41, 0x3b, 0xe4, 0x4b, 0xec, 0x93, 0x11, 0x39, 0xee, 0xba, 0x2a, 0xb6, 0x7a, 0x70,
  1941. 0x3d, 0x40, 0x9e, 0x60, 0xdf, 0x18, 0x91, 0xe3, 0x96, 0xab, 0x5f, 0xe4, 0x69, 0xc6, 0x83, 0x4b,
  1942. 0xec, 0xb7, 0x94, 0x54, 0xbf, 0xd0, 0x15, 0x98, 0x65, 0xc9, 0x24, 0x12, 0x61, 0x82, 0xd6, 0x13,
  1943. 0xe8, 0x5c, 0x20, 0x3f, 0xc7, 0x58, 0x55, 0xbd, 0x75, 0x32, 0x74, 0xaa, 0x46, 0x9c, 0x42, 0x77,
  1944. 0xaa, 0x34, 0x6e, 0xae, 0xb5, 0x18, 0x74, 0x02, 0xfd, 0x95, 0xa1, 0xbe, 0xba, 0xeb, 0x54, 0x47,
  1945. 0xe6, 0xbc, 0x52, 0xb9, 0x33, 0x5c, 0xb9, 0xb9, 0x8c, 0x7e, 0x80, 0x9b, 0x7f, 0x0f, 0x37, 0xfa,
  1946. 0x30, 0xa1, 0xb5, 0xc0, 0x95, 0x2a, 0xd7, 0x75, 0x65, 0x28, 0x4f, 0x62, 0xcc, 0x94, 0x83, 0x96,
  1947. 0x2b, 0xc3, 0xd2, 0x6b, 0xbb, 0xe2, 0x95, 0x3e, 0x84, 0x7d, 0x5d, 0xfa, 0x1f, 0x63, 0xa2, 0x17,
  1948. 0x70, 0x50, 0x88, 0x76, 0x32, 0x3e, 0x02, 0x63, 0x91, 0xe5, 0xa6, 0x4d, 0x47, 0xdf, 0xa8, 0x73,
  1949. 0x86, 0xab, 0x77, 0x72, 0xc0, 0xae, 0xb1, 0xc8, 0xe8, 0x53, 0xd8, 0x77, 0x31, 0xa9, 0xdc, 0x5a,
  1950. 0x39, 0x2b, 0xf2, 0x7f, 0xb3, 0x7a, 0x09, 0x07, 0x45, 0x85, 0x5d, 0x7a, 0xa5, 0xef, 0xe1, 0xf0,
  1951. 0x4d, 0x2c, 0xbc, 0x80, 0xcf, 0x97, 0x57, 0xed, 0xa5, 0x5c, 0x24, 0xa3, 0xba, 0x48, 0xa7, 0x60,
  1952. 0x96, 0x95, 0x77, 0xe9, 0xf1, 0xe4, 0x4b, 0x1b, 0xf6, 0x5e, 0xe4, 0x0d, 0x58, 0x0b, 0xd8, 0x2b,
  1953. 0xf6, 0xd3, 0xba, 0x5f, 0xef, 0xac, 0xf1, 0x53, 0x18, 0xd8, 0xdb, 0xd2, 0x9a, 0x42, 0x47, 0x9f,
  1954. 0x7e, 0xfc, 0xfe, 0x6c, 0x0c, 0xe8, 0x1d, 0x96, 0x4d, 0x58, 0x21, 0x64, 0x5e, 0x2e, 0x9b, 0x92,
  1955. 0xb1, 0x84, 0x15, 0x1e, 0x9a, 0xb0, 0xc6, 0xd4, 0x9a, 0xb0, 0xa6, 0xf5, 0x2d, 0xb0, 0x28, 0x97,
  1956. 0x49, 0x98, 0x07, 0x1d, 0x3d, 0x5b, 0xeb, 0xde, 0xa6, 0x89, 0x17, 0xa0, 0xe1, 0xe6, 0x64, 0x8e,
  1957. 0xb1, 0x15, 0xa6, 0x4f, 0x6f, 0xd7, 0x30, 0xfa, 0xa2, 0x24, 0xc4, 0x87, 0x1b, 0xaf, 0x67, 0x6a,
  1958. 0xe0, 0xbb, 0x50, 0x1e, 0x28, 0xca, 0x11, 0xed, 0xd5, 0x28, 0x42, 0x17, 0x9e, 0x92, 0xf1, 0x63,
  1959. 0x22, 0xdd, 0xe8, 0x05, 0x6d, 0x72, 0x6a, 0x8b, 0xdf, 0xe4, 0xd4, 0x77, 0x7a, 0x8b, 0x9b, 0x58,
  1960. 0x89, 0xa6, 0x64, 0xfc, 0xcc, 0xfc, 0xb6, 0xb6, 0xc9, 0xf7, 0xb5, 0x4d, 0x7e, 0xae, 0x6d, 0xf2,
  1961. 0xf5, 0x97, 0x7d, 0x6d, 0xd6, 0x51, 0x7f, 0x8c, 0x93, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2f,
  1962. 0x1d, 0xfa, 0x11, 0xb1, 0x05, 0x00, 0x00,
  1963. }