v3election.pb.go 51 KB

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