rpc.pb.go 107 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921
  1. // Code generated by protoc-gen-gogo.
  2. // source: rpc.proto
  3. // DO NOT EDIT!
  4. package etcdserverpb
  5. import proto "github.com/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
  6. // discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto"
  7. import storagepb "github.com/coreos/etcd/storage/storagepb"
  8. import (
  9. context "github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
  10. grpc "github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc"
  11. )
  12. import io "io"
  13. import fmt "fmt"
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var _ = proto.Marshal
  16. type Compare_CompareResult int32
  17. const (
  18. Compare_EQUAL Compare_CompareResult = 0
  19. Compare_GREATER Compare_CompareResult = 1
  20. Compare_LESS Compare_CompareResult = 2
  21. )
  22. var Compare_CompareResult_name = map[int32]string{
  23. 0: "EQUAL",
  24. 1: "GREATER",
  25. 2: "LESS",
  26. }
  27. var Compare_CompareResult_value = map[string]int32{
  28. "EQUAL": 0,
  29. "GREATER": 1,
  30. "LESS": 2,
  31. }
  32. func (x Compare_CompareResult) String() string {
  33. return proto.EnumName(Compare_CompareResult_name, int32(x))
  34. }
  35. type Compare_CompareTarget int32
  36. const (
  37. Compare_VERSION Compare_CompareTarget = 0
  38. Compare_CREATE Compare_CompareTarget = 1
  39. Compare_MOD Compare_CompareTarget = 2
  40. Compare_VALUE Compare_CompareTarget = 3
  41. )
  42. var Compare_CompareTarget_name = map[int32]string{
  43. 0: "VERSION",
  44. 1: "CREATE",
  45. 2: "MOD",
  46. 3: "VALUE",
  47. }
  48. var Compare_CompareTarget_value = map[string]int32{
  49. "VERSION": 0,
  50. "CREATE": 1,
  51. "MOD": 2,
  52. "VALUE": 3,
  53. }
  54. func (x Compare_CompareTarget) String() string {
  55. return proto.EnumName(Compare_CompareTarget_name, int32(x))
  56. }
  57. type ResponseHeader struct {
  58. ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,proto3" json:"cluster_id,omitempty"`
  59. MemberId uint64 `protobuf:"varint,2,opt,name=member_id,proto3" json:"member_id,omitempty"`
  60. // revision of the store when the request was applied.
  61. Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"`
  62. // term of raft when the request was applied.
  63. RaftTerm uint64 `protobuf:"varint,4,opt,name=raft_term,proto3" json:"raft_term,omitempty"`
  64. }
  65. func (m *ResponseHeader) Reset() { *m = ResponseHeader{} }
  66. func (m *ResponseHeader) String() string { return proto.CompactTextString(m) }
  67. func (*ResponseHeader) ProtoMessage() {}
  68. type RangeRequest struct {
  69. // if the range_end is not given, the request returns the key.
  70. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  71. // if the range_end is given, it gets the keys in range [key, range_end).
  72. RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
  73. // limit the number of keys returned.
  74. Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
  75. // range over the store at the given revision.
  76. // if revision is less or equal to zero, range over the newest store.
  77. // if the revision has been compacted, ErrCompaction will be returned in
  78. // response.
  79. Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"`
  80. }
  81. func (m *RangeRequest) Reset() { *m = RangeRequest{} }
  82. func (m *RangeRequest) String() string { return proto.CompactTextString(m) }
  83. func (*RangeRequest) ProtoMessage() {}
  84. type RangeResponse struct {
  85. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  86. Kvs []*storagepb.KeyValue `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"`
  87. // more indicates if there are more keys to return in the requested range.
  88. More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"`
  89. }
  90. func (m *RangeResponse) Reset() { *m = RangeResponse{} }
  91. func (m *RangeResponse) String() string { return proto.CompactTextString(m) }
  92. func (*RangeResponse) ProtoMessage() {}
  93. func (m *RangeResponse) GetHeader() *ResponseHeader {
  94. if m != nil {
  95. return m.Header
  96. }
  97. return nil
  98. }
  99. func (m *RangeResponse) GetKvs() []*storagepb.KeyValue {
  100. if m != nil {
  101. return m.Kvs
  102. }
  103. return nil
  104. }
  105. type PutRequest struct {
  106. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  107. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
  108. Lease int64 `protobuf:"varint,3,opt,name=lease,proto3" json:"lease,omitempty"`
  109. }
  110. func (m *PutRequest) Reset() { *m = PutRequest{} }
  111. func (m *PutRequest) String() string { return proto.CompactTextString(m) }
  112. func (*PutRequest) ProtoMessage() {}
  113. type PutResponse struct {
  114. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  115. }
  116. func (m *PutResponse) Reset() { *m = PutResponse{} }
  117. func (m *PutResponse) String() string { return proto.CompactTextString(m) }
  118. func (*PutResponse) ProtoMessage() {}
  119. func (m *PutResponse) GetHeader() *ResponseHeader {
  120. if m != nil {
  121. return m.Header
  122. }
  123. return nil
  124. }
  125. type DeleteRangeRequest struct {
  126. // if the range_end is not given, the request deletes the key.
  127. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  128. // if the range_end is given, it deletes the keys in range [key, range_end).
  129. RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
  130. }
  131. func (m *DeleteRangeRequest) Reset() { *m = DeleteRangeRequest{} }
  132. func (m *DeleteRangeRequest) String() string { return proto.CompactTextString(m) }
  133. func (*DeleteRangeRequest) ProtoMessage() {}
  134. type DeleteRangeResponse struct {
  135. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  136. }
  137. func (m *DeleteRangeResponse) Reset() { *m = DeleteRangeResponse{} }
  138. func (m *DeleteRangeResponse) String() string { return proto.CompactTextString(m) }
  139. func (*DeleteRangeResponse) ProtoMessage() {}
  140. func (m *DeleteRangeResponse) GetHeader() *ResponseHeader {
  141. if m != nil {
  142. return m.Header
  143. }
  144. return nil
  145. }
  146. type RequestUnion struct {
  147. RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range" json:"request_range,omitempty"`
  148. RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put" json:"request_put,omitempty"`
  149. RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range" json:"request_delete_range,omitempty"`
  150. }
  151. func (m *RequestUnion) Reset() { *m = RequestUnion{} }
  152. func (m *RequestUnion) String() string { return proto.CompactTextString(m) }
  153. func (*RequestUnion) ProtoMessage() {}
  154. func (m *RequestUnion) GetRequestRange() *RangeRequest {
  155. if m != nil {
  156. return m.RequestRange
  157. }
  158. return nil
  159. }
  160. func (m *RequestUnion) GetRequestPut() *PutRequest {
  161. if m != nil {
  162. return m.RequestPut
  163. }
  164. return nil
  165. }
  166. func (m *RequestUnion) GetRequestDeleteRange() *DeleteRangeRequest {
  167. if m != nil {
  168. return m.RequestDeleteRange
  169. }
  170. return nil
  171. }
  172. type ResponseUnion struct {
  173. ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range" json:"response_range,omitempty"`
  174. ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put" json:"response_put,omitempty"`
  175. ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range" json:"response_delete_range,omitempty"`
  176. }
  177. func (m *ResponseUnion) Reset() { *m = ResponseUnion{} }
  178. func (m *ResponseUnion) String() string { return proto.CompactTextString(m) }
  179. func (*ResponseUnion) ProtoMessage() {}
  180. func (m *ResponseUnion) GetResponseRange() *RangeResponse {
  181. if m != nil {
  182. return m.ResponseRange
  183. }
  184. return nil
  185. }
  186. func (m *ResponseUnion) GetResponsePut() *PutResponse {
  187. if m != nil {
  188. return m.ResponsePut
  189. }
  190. return nil
  191. }
  192. func (m *ResponseUnion) GetResponseDeleteRange() *DeleteRangeResponse {
  193. if m != nil {
  194. return m.ResponseDeleteRange
  195. }
  196. return nil
  197. }
  198. type Compare struct {
  199. Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult" json:"result,omitempty"`
  200. Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget" json:"target,omitempty"`
  201. // key path
  202. Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
  203. // version of the given key
  204. Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
  205. // create revision of the given key
  206. CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,proto3" json:"create_revision,omitempty"`
  207. // last modified revision of the given key
  208. ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,proto3" json:"mod_revision,omitempty"`
  209. // value of the given key
  210. Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"`
  211. }
  212. func (m *Compare) Reset() { *m = Compare{} }
  213. func (m *Compare) String() string { return proto.CompactTextString(m) }
  214. func (*Compare) ProtoMessage() {}
  215. // From google paxosdb paper:
  216. // Our implementation hinges around a powerful primitive which we call MultiOp. All other database
  217. // operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically
  218. // and consists of three components:
  219. // 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check
  220. // for the absence or presence of a value, or compare with a given value. Two different tests in the guard
  221. // may apply to the same or different entries in the database. All tests in the guard are applied and
  222. // MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise
  223. // it executes f op (see item 3 below).
  224. // 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or
  225. // lookup operation, and applies to a single database entry. Two different operations in the list may apply
  226. // to the same or different entries in the database. These operations are executed
  227. // if guard evaluates to
  228. // true.
  229. // 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false.
  230. type TxnRequest struct {
  231. Compare []*Compare `protobuf:"bytes,1,rep,name=compare" json:"compare,omitempty"`
  232. Success []*RequestUnion `protobuf:"bytes,2,rep,name=success" json:"success,omitempty"`
  233. Failure []*RequestUnion `protobuf:"bytes,3,rep,name=failure" json:"failure,omitempty"`
  234. }
  235. func (m *TxnRequest) Reset() { *m = TxnRequest{} }
  236. func (m *TxnRequest) String() string { return proto.CompactTextString(m) }
  237. func (*TxnRequest) ProtoMessage() {}
  238. func (m *TxnRequest) GetCompare() []*Compare {
  239. if m != nil {
  240. return m.Compare
  241. }
  242. return nil
  243. }
  244. func (m *TxnRequest) GetSuccess() []*RequestUnion {
  245. if m != nil {
  246. return m.Success
  247. }
  248. return nil
  249. }
  250. func (m *TxnRequest) GetFailure() []*RequestUnion {
  251. if m != nil {
  252. return m.Failure
  253. }
  254. return nil
  255. }
  256. type TxnResponse struct {
  257. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  258. Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
  259. Responses []*ResponseUnion `protobuf:"bytes,3,rep,name=responses" json:"responses,omitempty"`
  260. }
  261. func (m *TxnResponse) Reset() { *m = TxnResponse{} }
  262. func (m *TxnResponse) String() string { return proto.CompactTextString(m) }
  263. func (*TxnResponse) ProtoMessage() {}
  264. func (m *TxnResponse) GetHeader() *ResponseHeader {
  265. if m != nil {
  266. return m.Header
  267. }
  268. return nil
  269. }
  270. func (m *TxnResponse) GetResponses() []*ResponseUnion {
  271. if m != nil {
  272. return m.Responses
  273. }
  274. return nil
  275. }
  276. // Compaction compacts the kv store upto the given revision (including).
  277. // It removes the old versions of a key. It keeps the newest version of
  278. // the key even if its latest modification revision is smaller than the given
  279. // revision.
  280. type CompactionRequest struct {
  281. Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
  282. }
  283. func (m *CompactionRequest) Reset() { *m = CompactionRequest{} }
  284. func (m *CompactionRequest) String() string { return proto.CompactTextString(m) }
  285. func (*CompactionRequest) ProtoMessage() {}
  286. type CompactionResponse struct {
  287. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  288. }
  289. func (m *CompactionResponse) Reset() { *m = CompactionResponse{} }
  290. func (m *CompactionResponse) String() string { return proto.CompactTextString(m) }
  291. func (*CompactionResponse) ProtoMessage() {}
  292. func (m *CompactionResponse) GetHeader() *ResponseHeader {
  293. if m != nil {
  294. return m.Header
  295. }
  296. return nil
  297. }
  298. type WatchRequest struct {
  299. CreateRequest *WatchCreateRequest `protobuf:"bytes,1,opt,name=create_request" json:"create_request,omitempty"`
  300. CancelRequest *WatchCancelRequest `protobuf:"bytes,2,opt,name=cancel_request" json:"cancel_request,omitempty"`
  301. }
  302. func (m *WatchRequest) Reset() { *m = WatchRequest{} }
  303. func (m *WatchRequest) String() string { return proto.CompactTextString(m) }
  304. func (*WatchRequest) ProtoMessage() {}
  305. func (m *WatchRequest) GetCreateRequest() *WatchCreateRequest {
  306. if m != nil {
  307. return m.CreateRequest
  308. }
  309. return nil
  310. }
  311. func (m *WatchRequest) GetCancelRequest() *WatchCancelRequest {
  312. if m != nil {
  313. return m.CancelRequest
  314. }
  315. return nil
  316. }
  317. type WatchCreateRequest struct {
  318. // the key to be watched
  319. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  320. // the prefix to be watched.
  321. Prefix []byte `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
  322. // start_revision is an optional revision (including) to watch from. No start_revision is "now".
  323. StartRevision int64 `protobuf:"varint,3,opt,name=start_revision,proto3" json:"start_revision,omitempty"`
  324. }
  325. func (m *WatchCreateRequest) Reset() { *m = WatchCreateRequest{} }
  326. func (m *WatchCreateRequest) String() string { return proto.CompactTextString(m) }
  327. func (*WatchCreateRequest) ProtoMessage() {}
  328. type WatchCancelRequest struct {
  329. WatchId int64 `protobuf:"varint,1,opt,name=watch_id,proto3" json:"watch_id,omitempty"`
  330. }
  331. func (m *WatchCancelRequest) Reset() { *m = WatchCancelRequest{} }
  332. func (m *WatchCancelRequest) String() string { return proto.CompactTextString(m) }
  333. func (*WatchCancelRequest) ProtoMessage() {}
  334. type WatchResponse struct {
  335. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  336. // watch_id is the ID of the watching the response sent to.
  337. WatchId int64 `protobuf:"varint,2,opt,name=watch_id,proto3" json:"watch_id,omitempty"`
  338. // If the response is for a create watch request, created is set to true.
  339. // Client should record the watch_id and prepare for receiving events for
  340. // that watching from the same stream.
  341. // All events sent to the created watching will attach with the same watch_id.
  342. Created bool `protobuf:"varint,3,opt,name=created,proto3" json:"created,omitempty"`
  343. // If the response is for a cancel watch request, cancel is set to true.
  344. // No further events will be sent to the canceled watching.
  345. Canceled bool `protobuf:"varint,4,opt,name=canceled,proto3" json:"canceled,omitempty"`
  346. // If a watching tries to watch at a compacted index, compacted will be set to true.
  347. //
  348. // This happens when creating a watching at a compacted revision or the watching cannot
  349. // catch up with the progress of the KV.
  350. //
  351. // Client should treat the watching as canceled and should not try to create any
  352. // watching with same start_revision again.
  353. Compacted bool `protobuf:"varint,5,opt,name=compacted,proto3" json:"compacted,omitempty"`
  354. Events []*storagepb.Event `protobuf:"bytes,11,rep,name=events" json:"events,omitempty"`
  355. }
  356. func (m *WatchResponse) Reset() { *m = WatchResponse{} }
  357. func (m *WatchResponse) String() string { return proto.CompactTextString(m) }
  358. func (*WatchResponse) ProtoMessage() {}
  359. func (m *WatchResponse) GetHeader() *ResponseHeader {
  360. if m != nil {
  361. return m.Header
  362. }
  363. return nil
  364. }
  365. func (m *WatchResponse) GetEvents() []*storagepb.Event {
  366. if m != nil {
  367. return m.Events
  368. }
  369. return nil
  370. }
  371. type LeaseCreateRequest struct {
  372. // advisory ttl in seconds
  373. Ttl int64 `protobuf:"varint,1,opt,name=ttl,proto3" json:"ttl,omitempty"`
  374. }
  375. func (m *LeaseCreateRequest) Reset() { *m = LeaseCreateRequest{} }
  376. func (m *LeaseCreateRequest) String() string { return proto.CompactTextString(m) }
  377. func (*LeaseCreateRequest) ProtoMessage() {}
  378. type LeaseCreateResponse struct {
  379. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  380. LeaseId int64 `protobuf:"varint,2,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
  381. // server decided ttl in second
  382. Ttl int64 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
  383. Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
  384. }
  385. func (m *LeaseCreateResponse) Reset() { *m = LeaseCreateResponse{} }
  386. func (m *LeaseCreateResponse) String() string { return proto.CompactTextString(m) }
  387. func (*LeaseCreateResponse) ProtoMessage() {}
  388. func (m *LeaseCreateResponse) GetHeader() *ResponseHeader {
  389. if m != nil {
  390. return m.Header
  391. }
  392. return nil
  393. }
  394. type LeaseRevokeRequest struct {
  395. LeaseId int64 `protobuf:"varint,1,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
  396. }
  397. func (m *LeaseRevokeRequest) Reset() { *m = LeaseRevokeRequest{} }
  398. func (m *LeaseRevokeRequest) String() string { return proto.CompactTextString(m) }
  399. func (*LeaseRevokeRequest) ProtoMessage() {}
  400. type LeaseRevokeResponse struct {
  401. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  402. }
  403. func (m *LeaseRevokeResponse) Reset() { *m = LeaseRevokeResponse{} }
  404. func (m *LeaseRevokeResponse) String() string { return proto.CompactTextString(m) }
  405. func (*LeaseRevokeResponse) ProtoMessage() {}
  406. func (m *LeaseRevokeResponse) GetHeader() *ResponseHeader {
  407. if m != nil {
  408. return m.Header
  409. }
  410. return nil
  411. }
  412. type LeaseKeepAliveRequest struct {
  413. LeaseId int64 `protobuf:"varint,1,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
  414. }
  415. func (m *LeaseKeepAliveRequest) Reset() { *m = LeaseKeepAliveRequest{} }
  416. func (m *LeaseKeepAliveRequest) String() string { return proto.CompactTextString(m) }
  417. func (*LeaseKeepAliveRequest) ProtoMessage() {}
  418. type LeaseKeepAliveResponse struct {
  419. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  420. LeaseId int64 `protobuf:"varint,2,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
  421. Ttl int64 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
  422. }
  423. func (m *LeaseKeepAliveResponse) Reset() { *m = LeaseKeepAliveResponse{} }
  424. func (m *LeaseKeepAliveResponse) String() string { return proto.CompactTextString(m) }
  425. func (*LeaseKeepAliveResponse) ProtoMessage() {}
  426. func (m *LeaseKeepAliveResponse) GetHeader() *ResponseHeader {
  427. if m != nil {
  428. return m.Header
  429. }
  430. return nil
  431. }
  432. func init() {
  433. proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value)
  434. proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value)
  435. }
  436. // Reference imports to suppress errors if they are not otherwise used.
  437. var _ context.Context
  438. var _ grpc.ClientConn
  439. // Client API for KV service
  440. type KVClient interface {
  441. // Range gets the keys in the range from the store.
  442. Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error)
  443. // Put puts the given key into the store.
  444. // A put request increases the revision of the store,
  445. // and generates one event in the event history.
  446. Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
  447. // Delete deletes the given range from the store.
  448. // A delete request increase the revision of the store,
  449. // and generates one event in the event history.
  450. DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error)
  451. // Txn processes all the requests in one transaction.
  452. // A txn request increases the revision of the store,
  453. // and generates events with the same revision in the event history.
  454. // It is not allowed to modify the same key several times within one txn.
  455. Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error)
  456. // Compact compacts the event history in etcd. User should compact the
  457. // event history periodically, or it will grow infinitely.
  458. Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error)
  459. }
  460. type kVClient struct {
  461. cc *grpc.ClientConn
  462. }
  463. func NewKVClient(cc *grpc.ClientConn) KVClient {
  464. return &kVClient{cc}
  465. }
  466. func (c *kVClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) {
  467. out := new(RangeResponse)
  468. err := grpc.Invoke(ctx, "/etcdserverpb.KV/Range", in, out, c.cc, opts...)
  469. if err != nil {
  470. return nil, err
  471. }
  472. return out, nil
  473. }
  474. func (c *kVClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) {
  475. out := new(PutResponse)
  476. err := grpc.Invoke(ctx, "/etcdserverpb.KV/Put", in, out, c.cc, opts...)
  477. if err != nil {
  478. return nil, err
  479. }
  480. return out, nil
  481. }
  482. func (c *kVClient) DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) {
  483. out := new(DeleteRangeResponse)
  484. err := grpc.Invoke(ctx, "/etcdserverpb.KV/DeleteRange", in, out, c.cc, opts...)
  485. if err != nil {
  486. return nil, err
  487. }
  488. return out, nil
  489. }
  490. func (c *kVClient) Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) {
  491. out := new(TxnResponse)
  492. err := grpc.Invoke(ctx, "/etcdserverpb.KV/Txn", in, out, c.cc, opts...)
  493. if err != nil {
  494. return nil, err
  495. }
  496. return out, nil
  497. }
  498. func (c *kVClient) Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) {
  499. out := new(CompactionResponse)
  500. err := grpc.Invoke(ctx, "/etcdserverpb.KV/Compact", in, out, c.cc, opts...)
  501. if err != nil {
  502. return nil, err
  503. }
  504. return out, nil
  505. }
  506. // Server API for KV service
  507. type KVServer interface {
  508. // Range gets the keys in the range from the store.
  509. Range(context.Context, *RangeRequest) (*RangeResponse, error)
  510. // Put puts the given key into the store.
  511. // A put request increases the revision of the store,
  512. // and generates one event in the event history.
  513. Put(context.Context, *PutRequest) (*PutResponse, error)
  514. // Delete deletes the given range from the store.
  515. // A delete request increase the revision of the store,
  516. // and generates one event in the event history.
  517. DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error)
  518. // Txn processes all the requests in one transaction.
  519. // A txn request increases the revision of the store,
  520. // and generates events with the same revision in the event history.
  521. // It is not allowed to modify the same key several times within one txn.
  522. Txn(context.Context, *TxnRequest) (*TxnResponse, error)
  523. // Compact compacts the event history in etcd. User should compact the
  524. // event history periodically, or it will grow infinitely.
  525. Compact(context.Context, *CompactionRequest) (*CompactionResponse, error)
  526. }
  527. func RegisterKVServer(s *grpc.Server, srv KVServer) {
  528. s.RegisterService(&_KV_serviceDesc, srv)
  529. }
  530. func _KV_Range_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  531. in := new(RangeRequest)
  532. if err := codec.Unmarshal(buf, in); err != nil {
  533. return nil, err
  534. }
  535. out, err := srv.(KVServer).Range(ctx, in)
  536. if err != nil {
  537. return nil, err
  538. }
  539. return out, nil
  540. }
  541. func _KV_Put_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  542. in := new(PutRequest)
  543. if err := codec.Unmarshal(buf, in); err != nil {
  544. return nil, err
  545. }
  546. out, err := srv.(KVServer).Put(ctx, in)
  547. if err != nil {
  548. return nil, err
  549. }
  550. return out, nil
  551. }
  552. func _KV_DeleteRange_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  553. in := new(DeleteRangeRequest)
  554. if err := codec.Unmarshal(buf, in); err != nil {
  555. return nil, err
  556. }
  557. out, err := srv.(KVServer).DeleteRange(ctx, in)
  558. if err != nil {
  559. return nil, err
  560. }
  561. return out, nil
  562. }
  563. func _KV_Txn_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  564. in := new(TxnRequest)
  565. if err := codec.Unmarshal(buf, in); err != nil {
  566. return nil, err
  567. }
  568. out, err := srv.(KVServer).Txn(ctx, in)
  569. if err != nil {
  570. return nil, err
  571. }
  572. return out, nil
  573. }
  574. func _KV_Compact_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  575. in := new(CompactionRequest)
  576. if err := codec.Unmarshal(buf, in); err != nil {
  577. return nil, err
  578. }
  579. out, err := srv.(KVServer).Compact(ctx, in)
  580. if err != nil {
  581. return nil, err
  582. }
  583. return out, nil
  584. }
  585. var _KV_serviceDesc = grpc.ServiceDesc{
  586. ServiceName: "etcdserverpb.KV",
  587. HandlerType: (*KVServer)(nil),
  588. Methods: []grpc.MethodDesc{
  589. {
  590. MethodName: "Range",
  591. Handler: _KV_Range_Handler,
  592. },
  593. {
  594. MethodName: "Put",
  595. Handler: _KV_Put_Handler,
  596. },
  597. {
  598. MethodName: "DeleteRange",
  599. Handler: _KV_DeleteRange_Handler,
  600. },
  601. {
  602. MethodName: "Txn",
  603. Handler: _KV_Txn_Handler,
  604. },
  605. {
  606. MethodName: "Compact",
  607. Handler: _KV_Compact_Handler,
  608. },
  609. },
  610. Streams: []grpc.StreamDesc{},
  611. }
  612. // Client API for Watch service
  613. type WatchClient interface {
  614. // Watch watches the events happening or happened. Both input and output
  615. // are stream. One watch rpc can watch for multiple keys or prefixs and
  616. // get a stream of events. The whole events history can be watched unless
  617. // compacted.
  618. Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error)
  619. }
  620. type watchClient struct {
  621. cc *grpc.ClientConn
  622. }
  623. func NewWatchClient(cc *grpc.ClientConn) WatchClient {
  624. return &watchClient{cc}
  625. }
  626. func (c *watchClient) Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) {
  627. stream, err := grpc.NewClientStream(ctx, &_Watch_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Watch/Watch", opts...)
  628. if err != nil {
  629. return nil, err
  630. }
  631. x := &watchWatchClient{stream}
  632. return x, nil
  633. }
  634. type Watch_WatchClient interface {
  635. Send(*WatchRequest) error
  636. Recv() (*WatchResponse, error)
  637. grpc.ClientStream
  638. }
  639. type watchWatchClient struct {
  640. grpc.ClientStream
  641. }
  642. func (x *watchWatchClient) Send(m *WatchRequest) error {
  643. return x.ClientStream.SendMsg(m)
  644. }
  645. func (x *watchWatchClient) Recv() (*WatchResponse, error) {
  646. m := new(WatchResponse)
  647. if err := x.ClientStream.RecvMsg(m); err != nil {
  648. return nil, err
  649. }
  650. return m, nil
  651. }
  652. // Server API for Watch service
  653. type WatchServer interface {
  654. // Watch watches the events happening or happened. Both input and output
  655. // are stream. One watch rpc can watch for multiple keys or prefixs and
  656. // get a stream of events. The whole events history can be watched unless
  657. // compacted.
  658. Watch(Watch_WatchServer) error
  659. }
  660. func RegisterWatchServer(s *grpc.Server, srv WatchServer) {
  661. s.RegisterService(&_Watch_serviceDesc, srv)
  662. }
  663. func _Watch_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
  664. return srv.(WatchServer).Watch(&watchWatchServer{stream})
  665. }
  666. type Watch_WatchServer interface {
  667. Send(*WatchResponse) error
  668. Recv() (*WatchRequest, error)
  669. grpc.ServerStream
  670. }
  671. type watchWatchServer struct {
  672. grpc.ServerStream
  673. }
  674. func (x *watchWatchServer) Send(m *WatchResponse) error {
  675. return x.ServerStream.SendMsg(m)
  676. }
  677. func (x *watchWatchServer) Recv() (*WatchRequest, error) {
  678. m := new(WatchRequest)
  679. if err := x.ServerStream.RecvMsg(m); err != nil {
  680. return nil, err
  681. }
  682. return m, nil
  683. }
  684. var _Watch_serviceDesc = grpc.ServiceDesc{
  685. ServiceName: "etcdserverpb.Watch",
  686. HandlerType: (*WatchServer)(nil),
  687. Methods: []grpc.MethodDesc{},
  688. Streams: []grpc.StreamDesc{
  689. {
  690. StreamName: "Watch",
  691. Handler: _Watch_Watch_Handler,
  692. ServerStreams: true,
  693. ClientStreams: true,
  694. },
  695. },
  696. }
  697. // Client API for Lease service
  698. type LeaseClient interface {
  699. // LeaseCreate creates a lease. A lease has a TTL. The lease will expire if the
  700. // server does not receive a keepAlive within TTL from the lease holder.
  701. // All keys attached to the lease will be expired and deleted if the lease expires.
  702. // The key expiration generates an event in event history.
  703. LeaseCreate(ctx context.Context, in *LeaseCreateRequest, opts ...grpc.CallOption) (*LeaseCreateResponse, error)
  704. // LeaseRevoke revokes a lease. All the key attached to the lease will be expired and deleted.
  705. LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error)
  706. // KeepAlive keeps the lease alive.
  707. LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error)
  708. }
  709. type leaseClient struct {
  710. cc *grpc.ClientConn
  711. }
  712. func NewLeaseClient(cc *grpc.ClientConn) LeaseClient {
  713. return &leaseClient{cc}
  714. }
  715. func (c *leaseClient) LeaseCreate(ctx context.Context, in *LeaseCreateRequest, opts ...grpc.CallOption) (*LeaseCreateResponse, error) {
  716. out := new(LeaseCreateResponse)
  717. err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseCreate", in, out, c.cc, opts...)
  718. if err != nil {
  719. return nil, err
  720. }
  721. return out, nil
  722. }
  723. func (c *leaseClient) LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error) {
  724. out := new(LeaseRevokeResponse)
  725. err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseRevoke", in, out, c.cc, opts...)
  726. if err != nil {
  727. return nil, err
  728. }
  729. return out, nil
  730. }
  731. func (c *leaseClient) LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error) {
  732. stream, err := grpc.NewClientStream(ctx, &_Lease_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Lease/LeaseKeepAlive", opts...)
  733. if err != nil {
  734. return nil, err
  735. }
  736. x := &leaseLeaseKeepAliveClient{stream}
  737. return x, nil
  738. }
  739. type Lease_LeaseKeepAliveClient interface {
  740. Send(*LeaseKeepAliveRequest) error
  741. Recv() (*LeaseKeepAliveResponse, error)
  742. grpc.ClientStream
  743. }
  744. type leaseLeaseKeepAliveClient struct {
  745. grpc.ClientStream
  746. }
  747. func (x *leaseLeaseKeepAliveClient) Send(m *LeaseKeepAliveRequest) error {
  748. return x.ClientStream.SendMsg(m)
  749. }
  750. func (x *leaseLeaseKeepAliveClient) Recv() (*LeaseKeepAliveResponse, error) {
  751. m := new(LeaseKeepAliveResponse)
  752. if err := x.ClientStream.RecvMsg(m); err != nil {
  753. return nil, err
  754. }
  755. return m, nil
  756. }
  757. // Server API for Lease service
  758. type LeaseServer interface {
  759. // LeaseCreate creates a lease. A lease has a TTL. The lease will expire if the
  760. // server does not receive a keepAlive within TTL from the lease holder.
  761. // All keys attached to the lease will be expired and deleted if the lease expires.
  762. // The key expiration generates an event in event history.
  763. LeaseCreate(context.Context, *LeaseCreateRequest) (*LeaseCreateResponse, error)
  764. // LeaseRevoke revokes a lease. All the key attached to the lease will be expired and deleted.
  765. LeaseRevoke(context.Context, *LeaseRevokeRequest) (*LeaseRevokeResponse, error)
  766. // KeepAlive keeps the lease alive.
  767. LeaseKeepAlive(Lease_LeaseKeepAliveServer) error
  768. }
  769. func RegisterLeaseServer(s *grpc.Server, srv LeaseServer) {
  770. s.RegisterService(&_Lease_serviceDesc, srv)
  771. }
  772. func _Lease_LeaseCreate_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  773. in := new(LeaseCreateRequest)
  774. if err := codec.Unmarshal(buf, in); err != nil {
  775. return nil, err
  776. }
  777. out, err := srv.(LeaseServer).LeaseCreate(ctx, in)
  778. if err != nil {
  779. return nil, err
  780. }
  781. return out, nil
  782. }
  783. func _Lease_LeaseRevoke_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  784. in := new(LeaseRevokeRequest)
  785. if err := codec.Unmarshal(buf, in); err != nil {
  786. return nil, err
  787. }
  788. out, err := srv.(LeaseServer).LeaseRevoke(ctx, in)
  789. if err != nil {
  790. return nil, err
  791. }
  792. return out, nil
  793. }
  794. func _Lease_LeaseKeepAlive_Handler(srv interface{}, stream grpc.ServerStream) error {
  795. return srv.(LeaseServer).LeaseKeepAlive(&leaseLeaseKeepAliveServer{stream})
  796. }
  797. type Lease_LeaseKeepAliveServer interface {
  798. Send(*LeaseKeepAliveResponse) error
  799. Recv() (*LeaseKeepAliveRequest, error)
  800. grpc.ServerStream
  801. }
  802. type leaseLeaseKeepAliveServer struct {
  803. grpc.ServerStream
  804. }
  805. func (x *leaseLeaseKeepAliveServer) Send(m *LeaseKeepAliveResponse) error {
  806. return x.ServerStream.SendMsg(m)
  807. }
  808. func (x *leaseLeaseKeepAliveServer) Recv() (*LeaseKeepAliveRequest, error) {
  809. m := new(LeaseKeepAliveRequest)
  810. if err := x.ServerStream.RecvMsg(m); err != nil {
  811. return nil, err
  812. }
  813. return m, nil
  814. }
  815. var _Lease_serviceDesc = grpc.ServiceDesc{
  816. ServiceName: "etcdserverpb.Lease",
  817. HandlerType: (*LeaseServer)(nil),
  818. Methods: []grpc.MethodDesc{
  819. {
  820. MethodName: "LeaseCreate",
  821. Handler: _Lease_LeaseCreate_Handler,
  822. },
  823. {
  824. MethodName: "LeaseRevoke",
  825. Handler: _Lease_LeaseRevoke_Handler,
  826. },
  827. },
  828. Streams: []grpc.StreamDesc{
  829. {
  830. StreamName: "LeaseKeepAlive",
  831. Handler: _Lease_LeaseKeepAlive_Handler,
  832. ServerStreams: true,
  833. ClientStreams: true,
  834. },
  835. },
  836. }
  837. func (m *ResponseHeader) Marshal() (data []byte, err error) {
  838. size := m.Size()
  839. data = make([]byte, size)
  840. n, err := m.MarshalTo(data)
  841. if err != nil {
  842. return nil, err
  843. }
  844. return data[:n], nil
  845. }
  846. func (m *ResponseHeader) MarshalTo(data []byte) (int, error) {
  847. var i int
  848. _ = i
  849. var l int
  850. _ = l
  851. if m.ClusterId != 0 {
  852. data[i] = 0x8
  853. i++
  854. i = encodeVarintRpc(data, i, uint64(m.ClusterId))
  855. }
  856. if m.MemberId != 0 {
  857. data[i] = 0x10
  858. i++
  859. i = encodeVarintRpc(data, i, uint64(m.MemberId))
  860. }
  861. if m.Revision != 0 {
  862. data[i] = 0x18
  863. i++
  864. i = encodeVarintRpc(data, i, uint64(m.Revision))
  865. }
  866. if m.RaftTerm != 0 {
  867. data[i] = 0x20
  868. i++
  869. i = encodeVarintRpc(data, i, uint64(m.RaftTerm))
  870. }
  871. return i, nil
  872. }
  873. func (m *RangeRequest) Marshal() (data []byte, err error) {
  874. size := m.Size()
  875. data = make([]byte, size)
  876. n, err := m.MarshalTo(data)
  877. if err != nil {
  878. return nil, err
  879. }
  880. return data[:n], nil
  881. }
  882. func (m *RangeRequest) MarshalTo(data []byte) (int, error) {
  883. var i int
  884. _ = i
  885. var l int
  886. _ = l
  887. if m.Key != nil {
  888. if len(m.Key) > 0 {
  889. data[i] = 0xa
  890. i++
  891. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  892. i += copy(data[i:], m.Key)
  893. }
  894. }
  895. if m.RangeEnd != nil {
  896. if len(m.RangeEnd) > 0 {
  897. data[i] = 0x12
  898. i++
  899. i = encodeVarintRpc(data, i, uint64(len(m.RangeEnd)))
  900. i += copy(data[i:], m.RangeEnd)
  901. }
  902. }
  903. if m.Limit != 0 {
  904. data[i] = 0x18
  905. i++
  906. i = encodeVarintRpc(data, i, uint64(m.Limit))
  907. }
  908. if m.Revision != 0 {
  909. data[i] = 0x20
  910. i++
  911. i = encodeVarintRpc(data, i, uint64(m.Revision))
  912. }
  913. return i, nil
  914. }
  915. func (m *RangeResponse) Marshal() (data []byte, err error) {
  916. size := m.Size()
  917. data = make([]byte, size)
  918. n, err := m.MarshalTo(data)
  919. if err != nil {
  920. return nil, err
  921. }
  922. return data[:n], nil
  923. }
  924. func (m *RangeResponse) MarshalTo(data []byte) (int, error) {
  925. var i int
  926. _ = i
  927. var l int
  928. _ = l
  929. if m.Header != nil {
  930. data[i] = 0xa
  931. i++
  932. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  933. n1, err := m.Header.MarshalTo(data[i:])
  934. if err != nil {
  935. return 0, err
  936. }
  937. i += n1
  938. }
  939. if len(m.Kvs) > 0 {
  940. for _, msg := range m.Kvs {
  941. data[i] = 0x12
  942. i++
  943. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  944. n, err := msg.MarshalTo(data[i:])
  945. if err != nil {
  946. return 0, err
  947. }
  948. i += n
  949. }
  950. }
  951. if m.More {
  952. data[i] = 0x18
  953. i++
  954. if m.More {
  955. data[i] = 1
  956. } else {
  957. data[i] = 0
  958. }
  959. i++
  960. }
  961. return i, nil
  962. }
  963. func (m *PutRequest) Marshal() (data []byte, err error) {
  964. size := m.Size()
  965. data = make([]byte, size)
  966. n, err := m.MarshalTo(data)
  967. if err != nil {
  968. return nil, err
  969. }
  970. return data[:n], nil
  971. }
  972. func (m *PutRequest) MarshalTo(data []byte) (int, error) {
  973. var i int
  974. _ = i
  975. var l int
  976. _ = l
  977. if m.Key != nil {
  978. if len(m.Key) > 0 {
  979. data[i] = 0xa
  980. i++
  981. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  982. i += copy(data[i:], m.Key)
  983. }
  984. }
  985. if m.Value != nil {
  986. if len(m.Value) > 0 {
  987. data[i] = 0x12
  988. i++
  989. i = encodeVarintRpc(data, i, uint64(len(m.Value)))
  990. i += copy(data[i:], m.Value)
  991. }
  992. }
  993. if m.Lease != 0 {
  994. data[i] = 0x18
  995. i++
  996. i = encodeVarintRpc(data, i, uint64(m.Lease))
  997. }
  998. return i, nil
  999. }
  1000. func (m *PutResponse) Marshal() (data []byte, err error) {
  1001. size := m.Size()
  1002. data = make([]byte, size)
  1003. n, err := m.MarshalTo(data)
  1004. if err != nil {
  1005. return nil, err
  1006. }
  1007. return data[:n], nil
  1008. }
  1009. func (m *PutResponse) MarshalTo(data []byte) (int, error) {
  1010. var i int
  1011. _ = i
  1012. var l int
  1013. _ = l
  1014. if m.Header != nil {
  1015. data[i] = 0xa
  1016. i++
  1017. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1018. n2, err := m.Header.MarshalTo(data[i:])
  1019. if err != nil {
  1020. return 0, err
  1021. }
  1022. i += n2
  1023. }
  1024. return i, nil
  1025. }
  1026. func (m *DeleteRangeRequest) Marshal() (data []byte, err error) {
  1027. size := m.Size()
  1028. data = make([]byte, size)
  1029. n, err := m.MarshalTo(data)
  1030. if err != nil {
  1031. return nil, err
  1032. }
  1033. return data[:n], nil
  1034. }
  1035. func (m *DeleteRangeRequest) MarshalTo(data []byte) (int, error) {
  1036. var i int
  1037. _ = i
  1038. var l int
  1039. _ = l
  1040. if m.Key != nil {
  1041. if len(m.Key) > 0 {
  1042. data[i] = 0xa
  1043. i++
  1044. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  1045. i += copy(data[i:], m.Key)
  1046. }
  1047. }
  1048. if m.RangeEnd != nil {
  1049. if len(m.RangeEnd) > 0 {
  1050. data[i] = 0x12
  1051. i++
  1052. i = encodeVarintRpc(data, i, uint64(len(m.RangeEnd)))
  1053. i += copy(data[i:], m.RangeEnd)
  1054. }
  1055. }
  1056. return i, nil
  1057. }
  1058. func (m *DeleteRangeResponse) Marshal() (data []byte, err error) {
  1059. size := m.Size()
  1060. data = make([]byte, size)
  1061. n, err := m.MarshalTo(data)
  1062. if err != nil {
  1063. return nil, err
  1064. }
  1065. return data[:n], nil
  1066. }
  1067. func (m *DeleteRangeResponse) MarshalTo(data []byte) (int, error) {
  1068. var i int
  1069. _ = i
  1070. var l int
  1071. _ = l
  1072. if m.Header != nil {
  1073. data[i] = 0xa
  1074. i++
  1075. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1076. n3, err := m.Header.MarshalTo(data[i:])
  1077. if err != nil {
  1078. return 0, err
  1079. }
  1080. i += n3
  1081. }
  1082. return i, nil
  1083. }
  1084. func (m *RequestUnion) Marshal() (data []byte, err error) {
  1085. size := m.Size()
  1086. data = make([]byte, size)
  1087. n, err := m.MarshalTo(data)
  1088. if err != nil {
  1089. return nil, err
  1090. }
  1091. return data[:n], nil
  1092. }
  1093. func (m *RequestUnion) MarshalTo(data []byte) (int, error) {
  1094. var i int
  1095. _ = i
  1096. var l int
  1097. _ = l
  1098. if m.RequestRange != nil {
  1099. data[i] = 0xa
  1100. i++
  1101. i = encodeVarintRpc(data, i, uint64(m.RequestRange.Size()))
  1102. n4, err := m.RequestRange.MarshalTo(data[i:])
  1103. if err != nil {
  1104. return 0, err
  1105. }
  1106. i += n4
  1107. }
  1108. if m.RequestPut != nil {
  1109. data[i] = 0x12
  1110. i++
  1111. i = encodeVarintRpc(data, i, uint64(m.RequestPut.Size()))
  1112. n5, err := m.RequestPut.MarshalTo(data[i:])
  1113. if err != nil {
  1114. return 0, err
  1115. }
  1116. i += n5
  1117. }
  1118. if m.RequestDeleteRange != nil {
  1119. data[i] = 0x1a
  1120. i++
  1121. i = encodeVarintRpc(data, i, uint64(m.RequestDeleteRange.Size()))
  1122. n6, err := m.RequestDeleteRange.MarshalTo(data[i:])
  1123. if err != nil {
  1124. return 0, err
  1125. }
  1126. i += n6
  1127. }
  1128. return i, nil
  1129. }
  1130. func (m *ResponseUnion) Marshal() (data []byte, err error) {
  1131. size := m.Size()
  1132. data = make([]byte, size)
  1133. n, err := m.MarshalTo(data)
  1134. if err != nil {
  1135. return nil, err
  1136. }
  1137. return data[:n], nil
  1138. }
  1139. func (m *ResponseUnion) MarshalTo(data []byte) (int, error) {
  1140. var i int
  1141. _ = i
  1142. var l int
  1143. _ = l
  1144. if m.ResponseRange != nil {
  1145. data[i] = 0xa
  1146. i++
  1147. i = encodeVarintRpc(data, i, uint64(m.ResponseRange.Size()))
  1148. n7, err := m.ResponseRange.MarshalTo(data[i:])
  1149. if err != nil {
  1150. return 0, err
  1151. }
  1152. i += n7
  1153. }
  1154. if m.ResponsePut != nil {
  1155. data[i] = 0x12
  1156. i++
  1157. i = encodeVarintRpc(data, i, uint64(m.ResponsePut.Size()))
  1158. n8, err := m.ResponsePut.MarshalTo(data[i:])
  1159. if err != nil {
  1160. return 0, err
  1161. }
  1162. i += n8
  1163. }
  1164. if m.ResponseDeleteRange != nil {
  1165. data[i] = 0x1a
  1166. i++
  1167. i = encodeVarintRpc(data, i, uint64(m.ResponseDeleteRange.Size()))
  1168. n9, err := m.ResponseDeleteRange.MarshalTo(data[i:])
  1169. if err != nil {
  1170. return 0, err
  1171. }
  1172. i += n9
  1173. }
  1174. return i, nil
  1175. }
  1176. func (m *Compare) Marshal() (data []byte, err error) {
  1177. size := m.Size()
  1178. data = make([]byte, size)
  1179. n, err := m.MarshalTo(data)
  1180. if err != nil {
  1181. return nil, err
  1182. }
  1183. return data[:n], nil
  1184. }
  1185. func (m *Compare) MarshalTo(data []byte) (int, error) {
  1186. var i int
  1187. _ = i
  1188. var l int
  1189. _ = l
  1190. if m.Result != 0 {
  1191. data[i] = 0x8
  1192. i++
  1193. i = encodeVarintRpc(data, i, uint64(m.Result))
  1194. }
  1195. if m.Target != 0 {
  1196. data[i] = 0x10
  1197. i++
  1198. i = encodeVarintRpc(data, i, uint64(m.Target))
  1199. }
  1200. if m.Key != nil {
  1201. if len(m.Key) > 0 {
  1202. data[i] = 0x1a
  1203. i++
  1204. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  1205. i += copy(data[i:], m.Key)
  1206. }
  1207. }
  1208. if m.Version != 0 {
  1209. data[i] = 0x20
  1210. i++
  1211. i = encodeVarintRpc(data, i, uint64(m.Version))
  1212. }
  1213. if m.CreateRevision != 0 {
  1214. data[i] = 0x28
  1215. i++
  1216. i = encodeVarintRpc(data, i, uint64(m.CreateRevision))
  1217. }
  1218. if m.ModRevision != 0 {
  1219. data[i] = 0x30
  1220. i++
  1221. i = encodeVarintRpc(data, i, uint64(m.ModRevision))
  1222. }
  1223. if m.Value != nil {
  1224. if len(m.Value) > 0 {
  1225. data[i] = 0x3a
  1226. i++
  1227. i = encodeVarintRpc(data, i, uint64(len(m.Value)))
  1228. i += copy(data[i:], m.Value)
  1229. }
  1230. }
  1231. return i, nil
  1232. }
  1233. func (m *TxnRequest) Marshal() (data []byte, err error) {
  1234. size := m.Size()
  1235. data = make([]byte, size)
  1236. n, err := m.MarshalTo(data)
  1237. if err != nil {
  1238. return nil, err
  1239. }
  1240. return data[:n], nil
  1241. }
  1242. func (m *TxnRequest) MarshalTo(data []byte) (int, error) {
  1243. var i int
  1244. _ = i
  1245. var l int
  1246. _ = l
  1247. if len(m.Compare) > 0 {
  1248. for _, msg := range m.Compare {
  1249. data[i] = 0xa
  1250. i++
  1251. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  1252. n, err := msg.MarshalTo(data[i:])
  1253. if err != nil {
  1254. return 0, err
  1255. }
  1256. i += n
  1257. }
  1258. }
  1259. if len(m.Success) > 0 {
  1260. for _, msg := range m.Success {
  1261. data[i] = 0x12
  1262. i++
  1263. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  1264. n, err := msg.MarshalTo(data[i:])
  1265. if err != nil {
  1266. return 0, err
  1267. }
  1268. i += n
  1269. }
  1270. }
  1271. if len(m.Failure) > 0 {
  1272. for _, msg := range m.Failure {
  1273. data[i] = 0x1a
  1274. i++
  1275. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  1276. n, err := msg.MarshalTo(data[i:])
  1277. if err != nil {
  1278. return 0, err
  1279. }
  1280. i += n
  1281. }
  1282. }
  1283. return i, nil
  1284. }
  1285. func (m *TxnResponse) Marshal() (data []byte, err error) {
  1286. size := m.Size()
  1287. data = make([]byte, size)
  1288. n, err := m.MarshalTo(data)
  1289. if err != nil {
  1290. return nil, err
  1291. }
  1292. return data[:n], nil
  1293. }
  1294. func (m *TxnResponse) MarshalTo(data []byte) (int, error) {
  1295. var i int
  1296. _ = i
  1297. var l int
  1298. _ = l
  1299. if m.Header != nil {
  1300. data[i] = 0xa
  1301. i++
  1302. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1303. n10, err := m.Header.MarshalTo(data[i:])
  1304. if err != nil {
  1305. return 0, err
  1306. }
  1307. i += n10
  1308. }
  1309. if m.Succeeded {
  1310. data[i] = 0x10
  1311. i++
  1312. if m.Succeeded {
  1313. data[i] = 1
  1314. } else {
  1315. data[i] = 0
  1316. }
  1317. i++
  1318. }
  1319. if len(m.Responses) > 0 {
  1320. for _, msg := range m.Responses {
  1321. data[i] = 0x1a
  1322. i++
  1323. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  1324. n, err := msg.MarshalTo(data[i:])
  1325. if err != nil {
  1326. return 0, err
  1327. }
  1328. i += n
  1329. }
  1330. }
  1331. return i, nil
  1332. }
  1333. func (m *CompactionRequest) Marshal() (data []byte, err error) {
  1334. size := m.Size()
  1335. data = make([]byte, size)
  1336. n, err := m.MarshalTo(data)
  1337. if err != nil {
  1338. return nil, err
  1339. }
  1340. return data[:n], nil
  1341. }
  1342. func (m *CompactionRequest) MarshalTo(data []byte) (int, error) {
  1343. var i int
  1344. _ = i
  1345. var l int
  1346. _ = l
  1347. if m.Revision != 0 {
  1348. data[i] = 0x8
  1349. i++
  1350. i = encodeVarintRpc(data, i, uint64(m.Revision))
  1351. }
  1352. return i, nil
  1353. }
  1354. func (m *CompactionResponse) Marshal() (data []byte, err error) {
  1355. size := m.Size()
  1356. data = make([]byte, size)
  1357. n, err := m.MarshalTo(data)
  1358. if err != nil {
  1359. return nil, err
  1360. }
  1361. return data[:n], nil
  1362. }
  1363. func (m *CompactionResponse) MarshalTo(data []byte) (int, error) {
  1364. var i int
  1365. _ = i
  1366. var l int
  1367. _ = l
  1368. if m.Header != nil {
  1369. data[i] = 0xa
  1370. i++
  1371. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1372. n11, err := m.Header.MarshalTo(data[i:])
  1373. if err != nil {
  1374. return 0, err
  1375. }
  1376. i += n11
  1377. }
  1378. return i, nil
  1379. }
  1380. func (m *WatchRequest) Marshal() (data []byte, err error) {
  1381. size := m.Size()
  1382. data = make([]byte, size)
  1383. n, err := m.MarshalTo(data)
  1384. if err != nil {
  1385. return nil, err
  1386. }
  1387. return data[:n], nil
  1388. }
  1389. func (m *WatchRequest) MarshalTo(data []byte) (int, error) {
  1390. var i int
  1391. _ = i
  1392. var l int
  1393. _ = l
  1394. if m.CreateRequest != nil {
  1395. data[i] = 0xa
  1396. i++
  1397. i = encodeVarintRpc(data, i, uint64(m.CreateRequest.Size()))
  1398. n12, err := m.CreateRequest.MarshalTo(data[i:])
  1399. if err != nil {
  1400. return 0, err
  1401. }
  1402. i += n12
  1403. }
  1404. if m.CancelRequest != nil {
  1405. data[i] = 0x12
  1406. i++
  1407. i = encodeVarintRpc(data, i, uint64(m.CancelRequest.Size()))
  1408. n13, err := m.CancelRequest.MarshalTo(data[i:])
  1409. if err != nil {
  1410. return 0, err
  1411. }
  1412. i += n13
  1413. }
  1414. return i, nil
  1415. }
  1416. func (m *WatchCreateRequest) Marshal() (data []byte, err error) {
  1417. size := m.Size()
  1418. data = make([]byte, size)
  1419. n, err := m.MarshalTo(data)
  1420. if err != nil {
  1421. return nil, err
  1422. }
  1423. return data[:n], nil
  1424. }
  1425. func (m *WatchCreateRequest) MarshalTo(data []byte) (int, error) {
  1426. var i int
  1427. _ = i
  1428. var l int
  1429. _ = l
  1430. if m.Key != nil {
  1431. if len(m.Key) > 0 {
  1432. data[i] = 0xa
  1433. i++
  1434. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  1435. i += copy(data[i:], m.Key)
  1436. }
  1437. }
  1438. if m.Prefix != nil {
  1439. if len(m.Prefix) > 0 {
  1440. data[i] = 0x12
  1441. i++
  1442. i = encodeVarintRpc(data, i, uint64(len(m.Prefix)))
  1443. i += copy(data[i:], m.Prefix)
  1444. }
  1445. }
  1446. if m.StartRevision != 0 {
  1447. data[i] = 0x18
  1448. i++
  1449. i = encodeVarintRpc(data, i, uint64(m.StartRevision))
  1450. }
  1451. return i, nil
  1452. }
  1453. func (m *WatchCancelRequest) Marshal() (data []byte, err error) {
  1454. size := m.Size()
  1455. data = make([]byte, size)
  1456. n, err := m.MarshalTo(data)
  1457. if err != nil {
  1458. return nil, err
  1459. }
  1460. return data[:n], nil
  1461. }
  1462. func (m *WatchCancelRequest) MarshalTo(data []byte) (int, error) {
  1463. var i int
  1464. _ = i
  1465. var l int
  1466. _ = l
  1467. if m.WatchId != 0 {
  1468. data[i] = 0x8
  1469. i++
  1470. i = encodeVarintRpc(data, i, uint64(m.WatchId))
  1471. }
  1472. return i, nil
  1473. }
  1474. func (m *WatchResponse) Marshal() (data []byte, err error) {
  1475. size := m.Size()
  1476. data = make([]byte, size)
  1477. n, err := m.MarshalTo(data)
  1478. if err != nil {
  1479. return nil, err
  1480. }
  1481. return data[:n], nil
  1482. }
  1483. func (m *WatchResponse) MarshalTo(data []byte) (int, error) {
  1484. var i int
  1485. _ = i
  1486. var l int
  1487. _ = l
  1488. if m.Header != nil {
  1489. data[i] = 0xa
  1490. i++
  1491. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1492. n14, err := m.Header.MarshalTo(data[i:])
  1493. if err != nil {
  1494. return 0, err
  1495. }
  1496. i += n14
  1497. }
  1498. if m.WatchId != 0 {
  1499. data[i] = 0x10
  1500. i++
  1501. i = encodeVarintRpc(data, i, uint64(m.WatchId))
  1502. }
  1503. if m.Created {
  1504. data[i] = 0x18
  1505. i++
  1506. if m.Created {
  1507. data[i] = 1
  1508. } else {
  1509. data[i] = 0
  1510. }
  1511. i++
  1512. }
  1513. if m.Canceled {
  1514. data[i] = 0x20
  1515. i++
  1516. if m.Canceled {
  1517. data[i] = 1
  1518. } else {
  1519. data[i] = 0
  1520. }
  1521. i++
  1522. }
  1523. if m.Compacted {
  1524. data[i] = 0x28
  1525. i++
  1526. if m.Compacted {
  1527. data[i] = 1
  1528. } else {
  1529. data[i] = 0
  1530. }
  1531. i++
  1532. }
  1533. if len(m.Events) > 0 {
  1534. for _, msg := range m.Events {
  1535. data[i] = 0x5a
  1536. i++
  1537. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  1538. n, err := msg.MarshalTo(data[i:])
  1539. if err != nil {
  1540. return 0, err
  1541. }
  1542. i += n
  1543. }
  1544. }
  1545. return i, nil
  1546. }
  1547. func (m *LeaseCreateRequest) Marshal() (data []byte, err error) {
  1548. size := m.Size()
  1549. data = make([]byte, size)
  1550. n, err := m.MarshalTo(data)
  1551. if err != nil {
  1552. return nil, err
  1553. }
  1554. return data[:n], nil
  1555. }
  1556. func (m *LeaseCreateRequest) MarshalTo(data []byte) (int, error) {
  1557. var i int
  1558. _ = i
  1559. var l int
  1560. _ = l
  1561. if m.Ttl != 0 {
  1562. data[i] = 0x8
  1563. i++
  1564. i = encodeVarintRpc(data, i, uint64(m.Ttl))
  1565. }
  1566. return i, nil
  1567. }
  1568. func (m *LeaseCreateResponse) Marshal() (data []byte, err error) {
  1569. size := m.Size()
  1570. data = make([]byte, size)
  1571. n, err := m.MarshalTo(data)
  1572. if err != nil {
  1573. return nil, err
  1574. }
  1575. return data[:n], nil
  1576. }
  1577. func (m *LeaseCreateResponse) MarshalTo(data []byte) (int, error) {
  1578. var i int
  1579. _ = i
  1580. var l int
  1581. _ = l
  1582. if m.Header != nil {
  1583. data[i] = 0xa
  1584. i++
  1585. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1586. n15, err := m.Header.MarshalTo(data[i:])
  1587. if err != nil {
  1588. return 0, err
  1589. }
  1590. i += n15
  1591. }
  1592. if m.LeaseId != 0 {
  1593. data[i] = 0x10
  1594. i++
  1595. i = encodeVarintRpc(data, i, uint64(m.LeaseId))
  1596. }
  1597. if m.Ttl != 0 {
  1598. data[i] = 0x18
  1599. i++
  1600. i = encodeVarintRpc(data, i, uint64(m.Ttl))
  1601. }
  1602. if len(m.Error) > 0 {
  1603. data[i] = 0x22
  1604. i++
  1605. i = encodeVarintRpc(data, i, uint64(len(m.Error)))
  1606. i += copy(data[i:], m.Error)
  1607. }
  1608. return i, nil
  1609. }
  1610. func (m *LeaseRevokeRequest) Marshal() (data []byte, err error) {
  1611. size := m.Size()
  1612. data = make([]byte, size)
  1613. n, err := m.MarshalTo(data)
  1614. if err != nil {
  1615. return nil, err
  1616. }
  1617. return data[:n], nil
  1618. }
  1619. func (m *LeaseRevokeRequest) MarshalTo(data []byte) (int, error) {
  1620. var i int
  1621. _ = i
  1622. var l int
  1623. _ = l
  1624. if m.LeaseId != 0 {
  1625. data[i] = 0x8
  1626. i++
  1627. i = encodeVarintRpc(data, i, uint64(m.LeaseId))
  1628. }
  1629. return i, nil
  1630. }
  1631. func (m *LeaseRevokeResponse) Marshal() (data []byte, err error) {
  1632. size := m.Size()
  1633. data = make([]byte, size)
  1634. n, err := m.MarshalTo(data)
  1635. if err != nil {
  1636. return nil, err
  1637. }
  1638. return data[:n], nil
  1639. }
  1640. func (m *LeaseRevokeResponse) MarshalTo(data []byte) (int, error) {
  1641. var i int
  1642. _ = i
  1643. var l int
  1644. _ = l
  1645. if m.Header != nil {
  1646. data[i] = 0xa
  1647. i++
  1648. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1649. n16, err := m.Header.MarshalTo(data[i:])
  1650. if err != nil {
  1651. return 0, err
  1652. }
  1653. i += n16
  1654. }
  1655. return i, nil
  1656. }
  1657. func (m *LeaseKeepAliveRequest) Marshal() (data []byte, err error) {
  1658. size := m.Size()
  1659. data = make([]byte, size)
  1660. n, err := m.MarshalTo(data)
  1661. if err != nil {
  1662. return nil, err
  1663. }
  1664. return data[:n], nil
  1665. }
  1666. func (m *LeaseKeepAliveRequest) MarshalTo(data []byte) (int, error) {
  1667. var i int
  1668. _ = i
  1669. var l int
  1670. _ = l
  1671. if m.LeaseId != 0 {
  1672. data[i] = 0x8
  1673. i++
  1674. i = encodeVarintRpc(data, i, uint64(m.LeaseId))
  1675. }
  1676. return i, nil
  1677. }
  1678. func (m *LeaseKeepAliveResponse) Marshal() (data []byte, err error) {
  1679. size := m.Size()
  1680. data = make([]byte, size)
  1681. n, err := m.MarshalTo(data)
  1682. if err != nil {
  1683. return nil, err
  1684. }
  1685. return data[:n], nil
  1686. }
  1687. func (m *LeaseKeepAliveResponse) MarshalTo(data []byte) (int, error) {
  1688. var i int
  1689. _ = i
  1690. var l int
  1691. _ = l
  1692. if m.Header != nil {
  1693. data[i] = 0xa
  1694. i++
  1695. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1696. n17, err := m.Header.MarshalTo(data[i:])
  1697. if err != nil {
  1698. return 0, err
  1699. }
  1700. i += n17
  1701. }
  1702. if m.LeaseId != 0 {
  1703. data[i] = 0x10
  1704. i++
  1705. i = encodeVarintRpc(data, i, uint64(m.LeaseId))
  1706. }
  1707. if m.Ttl != 0 {
  1708. data[i] = 0x18
  1709. i++
  1710. i = encodeVarintRpc(data, i, uint64(m.Ttl))
  1711. }
  1712. return i, nil
  1713. }
  1714. func encodeFixed64Rpc(data []byte, offset int, v uint64) int {
  1715. data[offset] = uint8(v)
  1716. data[offset+1] = uint8(v >> 8)
  1717. data[offset+2] = uint8(v >> 16)
  1718. data[offset+3] = uint8(v >> 24)
  1719. data[offset+4] = uint8(v >> 32)
  1720. data[offset+5] = uint8(v >> 40)
  1721. data[offset+6] = uint8(v >> 48)
  1722. data[offset+7] = uint8(v >> 56)
  1723. return offset + 8
  1724. }
  1725. func encodeFixed32Rpc(data []byte, offset int, v uint32) int {
  1726. data[offset] = uint8(v)
  1727. data[offset+1] = uint8(v >> 8)
  1728. data[offset+2] = uint8(v >> 16)
  1729. data[offset+3] = uint8(v >> 24)
  1730. return offset + 4
  1731. }
  1732. func encodeVarintRpc(data []byte, offset int, v uint64) int {
  1733. for v >= 1<<7 {
  1734. data[offset] = uint8(v&0x7f | 0x80)
  1735. v >>= 7
  1736. offset++
  1737. }
  1738. data[offset] = uint8(v)
  1739. return offset + 1
  1740. }
  1741. func (m *ResponseHeader) Size() (n int) {
  1742. var l int
  1743. _ = l
  1744. if m.ClusterId != 0 {
  1745. n += 1 + sovRpc(uint64(m.ClusterId))
  1746. }
  1747. if m.MemberId != 0 {
  1748. n += 1 + sovRpc(uint64(m.MemberId))
  1749. }
  1750. if m.Revision != 0 {
  1751. n += 1 + sovRpc(uint64(m.Revision))
  1752. }
  1753. if m.RaftTerm != 0 {
  1754. n += 1 + sovRpc(uint64(m.RaftTerm))
  1755. }
  1756. return n
  1757. }
  1758. func (m *RangeRequest) Size() (n int) {
  1759. var l int
  1760. _ = l
  1761. if m.Key != nil {
  1762. l = len(m.Key)
  1763. if l > 0 {
  1764. n += 1 + l + sovRpc(uint64(l))
  1765. }
  1766. }
  1767. if m.RangeEnd != nil {
  1768. l = len(m.RangeEnd)
  1769. if l > 0 {
  1770. n += 1 + l + sovRpc(uint64(l))
  1771. }
  1772. }
  1773. if m.Limit != 0 {
  1774. n += 1 + sovRpc(uint64(m.Limit))
  1775. }
  1776. if m.Revision != 0 {
  1777. n += 1 + sovRpc(uint64(m.Revision))
  1778. }
  1779. return n
  1780. }
  1781. func (m *RangeResponse) Size() (n int) {
  1782. var l int
  1783. _ = l
  1784. if m.Header != nil {
  1785. l = m.Header.Size()
  1786. n += 1 + l + sovRpc(uint64(l))
  1787. }
  1788. if len(m.Kvs) > 0 {
  1789. for _, e := range m.Kvs {
  1790. l = e.Size()
  1791. n += 1 + l + sovRpc(uint64(l))
  1792. }
  1793. }
  1794. if m.More {
  1795. n += 2
  1796. }
  1797. return n
  1798. }
  1799. func (m *PutRequest) Size() (n int) {
  1800. var l int
  1801. _ = l
  1802. if m.Key != nil {
  1803. l = len(m.Key)
  1804. if l > 0 {
  1805. n += 1 + l + sovRpc(uint64(l))
  1806. }
  1807. }
  1808. if m.Value != nil {
  1809. l = len(m.Value)
  1810. if l > 0 {
  1811. n += 1 + l + sovRpc(uint64(l))
  1812. }
  1813. }
  1814. if m.Lease != 0 {
  1815. n += 1 + sovRpc(uint64(m.Lease))
  1816. }
  1817. return n
  1818. }
  1819. func (m *PutResponse) Size() (n int) {
  1820. var l int
  1821. _ = l
  1822. if m.Header != nil {
  1823. l = m.Header.Size()
  1824. n += 1 + l + sovRpc(uint64(l))
  1825. }
  1826. return n
  1827. }
  1828. func (m *DeleteRangeRequest) Size() (n int) {
  1829. var l int
  1830. _ = l
  1831. if m.Key != nil {
  1832. l = len(m.Key)
  1833. if l > 0 {
  1834. n += 1 + l + sovRpc(uint64(l))
  1835. }
  1836. }
  1837. if m.RangeEnd != nil {
  1838. l = len(m.RangeEnd)
  1839. if l > 0 {
  1840. n += 1 + l + sovRpc(uint64(l))
  1841. }
  1842. }
  1843. return n
  1844. }
  1845. func (m *DeleteRangeResponse) Size() (n int) {
  1846. var l int
  1847. _ = l
  1848. if m.Header != nil {
  1849. l = m.Header.Size()
  1850. n += 1 + l + sovRpc(uint64(l))
  1851. }
  1852. return n
  1853. }
  1854. func (m *RequestUnion) Size() (n int) {
  1855. var l int
  1856. _ = l
  1857. if m.RequestRange != nil {
  1858. l = m.RequestRange.Size()
  1859. n += 1 + l + sovRpc(uint64(l))
  1860. }
  1861. if m.RequestPut != nil {
  1862. l = m.RequestPut.Size()
  1863. n += 1 + l + sovRpc(uint64(l))
  1864. }
  1865. if m.RequestDeleteRange != nil {
  1866. l = m.RequestDeleteRange.Size()
  1867. n += 1 + l + sovRpc(uint64(l))
  1868. }
  1869. return n
  1870. }
  1871. func (m *ResponseUnion) Size() (n int) {
  1872. var l int
  1873. _ = l
  1874. if m.ResponseRange != nil {
  1875. l = m.ResponseRange.Size()
  1876. n += 1 + l + sovRpc(uint64(l))
  1877. }
  1878. if m.ResponsePut != nil {
  1879. l = m.ResponsePut.Size()
  1880. n += 1 + l + sovRpc(uint64(l))
  1881. }
  1882. if m.ResponseDeleteRange != nil {
  1883. l = m.ResponseDeleteRange.Size()
  1884. n += 1 + l + sovRpc(uint64(l))
  1885. }
  1886. return n
  1887. }
  1888. func (m *Compare) Size() (n int) {
  1889. var l int
  1890. _ = l
  1891. if m.Result != 0 {
  1892. n += 1 + sovRpc(uint64(m.Result))
  1893. }
  1894. if m.Target != 0 {
  1895. n += 1 + sovRpc(uint64(m.Target))
  1896. }
  1897. if m.Key != nil {
  1898. l = len(m.Key)
  1899. if l > 0 {
  1900. n += 1 + l + sovRpc(uint64(l))
  1901. }
  1902. }
  1903. if m.Version != 0 {
  1904. n += 1 + sovRpc(uint64(m.Version))
  1905. }
  1906. if m.CreateRevision != 0 {
  1907. n += 1 + sovRpc(uint64(m.CreateRevision))
  1908. }
  1909. if m.ModRevision != 0 {
  1910. n += 1 + sovRpc(uint64(m.ModRevision))
  1911. }
  1912. if m.Value != nil {
  1913. l = len(m.Value)
  1914. if l > 0 {
  1915. n += 1 + l + sovRpc(uint64(l))
  1916. }
  1917. }
  1918. return n
  1919. }
  1920. func (m *TxnRequest) Size() (n int) {
  1921. var l int
  1922. _ = l
  1923. if len(m.Compare) > 0 {
  1924. for _, e := range m.Compare {
  1925. l = e.Size()
  1926. n += 1 + l + sovRpc(uint64(l))
  1927. }
  1928. }
  1929. if len(m.Success) > 0 {
  1930. for _, e := range m.Success {
  1931. l = e.Size()
  1932. n += 1 + l + sovRpc(uint64(l))
  1933. }
  1934. }
  1935. if len(m.Failure) > 0 {
  1936. for _, e := range m.Failure {
  1937. l = e.Size()
  1938. n += 1 + l + sovRpc(uint64(l))
  1939. }
  1940. }
  1941. return n
  1942. }
  1943. func (m *TxnResponse) Size() (n int) {
  1944. var l int
  1945. _ = l
  1946. if m.Header != nil {
  1947. l = m.Header.Size()
  1948. n += 1 + l + sovRpc(uint64(l))
  1949. }
  1950. if m.Succeeded {
  1951. n += 2
  1952. }
  1953. if len(m.Responses) > 0 {
  1954. for _, e := range m.Responses {
  1955. l = e.Size()
  1956. n += 1 + l + sovRpc(uint64(l))
  1957. }
  1958. }
  1959. return n
  1960. }
  1961. func (m *CompactionRequest) Size() (n int) {
  1962. var l int
  1963. _ = l
  1964. if m.Revision != 0 {
  1965. n += 1 + sovRpc(uint64(m.Revision))
  1966. }
  1967. return n
  1968. }
  1969. func (m *CompactionResponse) Size() (n int) {
  1970. var l int
  1971. _ = l
  1972. if m.Header != nil {
  1973. l = m.Header.Size()
  1974. n += 1 + l + sovRpc(uint64(l))
  1975. }
  1976. return n
  1977. }
  1978. func (m *WatchRequest) Size() (n int) {
  1979. var l int
  1980. _ = l
  1981. if m.CreateRequest != nil {
  1982. l = m.CreateRequest.Size()
  1983. n += 1 + l + sovRpc(uint64(l))
  1984. }
  1985. if m.CancelRequest != nil {
  1986. l = m.CancelRequest.Size()
  1987. n += 1 + l + sovRpc(uint64(l))
  1988. }
  1989. return n
  1990. }
  1991. func (m *WatchCreateRequest) Size() (n int) {
  1992. var l int
  1993. _ = l
  1994. if m.Key != nil {
  1995. l = len(m.Key)
  1996. if l > 0 {
  1997. n += 1 + l + sovRpc(uint64(l))
  1998. }
  1999. }
  2000. if m.Prefix != nil {
  2001. l = len(m.Prefix)
  2002. if l > 0 {
  2003. n += 1 + l + sovRpc(uint64(l))
  2004. }
  2005. }
  2006. if m.StartRevision != 0 {
  2007. n += 1 + sovRpc(uint64(m.StartRevision))
  2008. }
  2009. return n
  2010. }
  2011. func (m *WatchCancelRequest) Size() (n int) {
  2012. var l int
  2013. _ = l
  2014. if m.WatchId != 0 {
  2015. n += 1 + sovRpc(uint64(m.WatchId))
  2016. }
  2017. return n
  2018. }
  2019. func (m *WatchResponse) Size() (n int) {
  2020. var l int
  2021. _ = l
  2022. if m.Header != nil {
  2023. l = m.Header.Size()
  2024. n += 1 + l + sovRpc(uint64(l))
  2025. }
  2026. if m.WatchId != 0 {
  2027. n += 1 + sovRpc(uint64(m.WatchId))
  2028. }
  2029. if m.Created {
  2030. n += 2
  2031. }
  2032. if m.Canceled {
  2033. n += 2
  2034. }
  2035. if m.Compacted {
  2036. n += 2
  2037. }
  2038. if len(m.Events) > 0 {
  2039. for _, e := range m.Events {
  2040. l = e.Size()
  2041. n += 1 + l + sovRpc(uint64(l))
  2042. }
  2043. }
  2044. return n
  2045. }
  2046. func (m *LeaseCreateRequest) Size() (n int) {
  2047. var l int
  2048. _ = l
  2049. if m.Ttl != 0 {
  2050. n += 1 + sovRpc(uint64(m.Ttl))
  2051. }
  2052. return n
  2053. }
  2054. func (m *LeaseCreateResponse) Size() (n int) {
  2055. var l int
  2056. _ = l
  2057. if m.Header != nil {
  2058. l = m.Header.Size()
  2059. n += 1 + l + sovRpc(uint64(l))
  2060. }
  2061. if m.LeaseId != 0 {
  2062. n += 1 + sovRpc(uint64(m.LeaseId))
  2063. }
  2064. if m.Ttl != 0 {
  2065. n += 1 + sovRpc(uint64(m.Ttl))
  2066. }
  2067. l = len(m.Error)
  2068. if l > 0 {
  2069. n += 1 + l + sovRpc(uint64(l))
  2070. }
  2071. return n
  2072. }
  2073. func (m *LeaseRevokeRequest) Size() (n int) {
  2074. var l int
  2075. _ = l
  2076. if m.LeaseId != 0 {
  2077. n += 1 + sovRpc(uint64(m.LeaseId))
  2078. }
  2079. return n
  2080. }
  2081. func (m *LeaseRevokeResponse) Size() (n int) {
  2082. var l int
  2083. _ = l
  2084. if m.Header != nil {
  2085. l = m.Header.Size()
  2086. n += 1 + l + sovRpc(uint64(l))
  2087. }
  2088. return n
  2089. }
  2090. func (m *LeaseKeepAliveRequest) Size() (n int) {
  2091. var l int
  2092. _ = l
  2093. if m.LeaseId != 0 {
  2094. n += 1 + sovRpc(uint64(m.LeaseId))
  2095. }
  2096. return n
  2097. }
  2098. func (m *LeaseKeepAliveResponse) Size() (n int) {
  2099. var l int
  2100. _ = l
  2101. if m.Header != nil {
  2102. l = m.Header.Size()
  2103. n += 1 + l + sovRpc(uint64(l))
  2104. }
  2105. if m.LeaseId != 0 {
  2106. n += 1 + sovRpc(uint64(m.LeaseId))
  2107. }
  2108. if m.Ttl != 0 {
  2109. n += 1 + sovRpc(uint64(m.Ttl))
  2110. }
  2111. return n
  2112. }
  2113. func sovRpc(x uint64) (n int) {
  2114. for {
  2115. n++
  2116. x >>= 7
  2117. if x == 0 {
  2118. break
  2119. }
  2120. }
  2121. return n
  2122. }
  2123. func sozRpc(x uint64) (n int) {
  2124. return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  2125. }
  2126. func (m *ResponseHeader) Unmarshal(data []byte) error {
  2127. l := len(data)
  2128. iNdEx := 0
  2129. for iNdEx < l {
  2130. var wire uint64
  2131. for shift := uint(0); ; shift += 7 {
  2132. if iNdEx >= l {
  2133. return io.ErrUnexpectedEOF
  2134. }
  2135. b := data[iNdEx]
  2136. iNdEx++
  2137. wire |= (uint64(b) & 0x7F) << shift
  2138. if b < 0x80 {
  2139. break
  2140. }
  2141. }
  2142. fieldNum := int32(wire >> 3)
  2143. wireType := int(wire & 0x7)
  2144. switch fieldNum {
  2145. case 1:
  2146. if wireType != 0 {
  2147. return fmt.Errorf("proto: wrong wireType = %d for field ClusterId", wireType)
  2148. }
  2149. m.ClusterId = 0
  2150. for shift := uint(0); ; shift += 7 {
  2151. if iNdEx >= l {
  2152. return io.ErrUnexpectedEOF
  2153. }
  2154. b := data[iNdEx]
  2155. iNdEx++
  2156. m.ClusterId |= (uint64(b) & 0x7F) << shift
  2157. if b < 0x80 {
  2158. break
  2159. }
  2160. }
  2161. case 2:
  2162. if wireType != 0 {
  2163. return fmt.Errorf("proto: wrong wireType = %d for field MemberId", wireType)
  2164. }
  2165. m.MemberId = 0
  2166. for shift := uint(0); ; shift += 7 {
  2167. if iNdEx >= l {
  2168. return io.ErrUnexpectedEOF
  2169. }
  2170. b := data[iNdEx]
  2171. iNdEx++
  2172. m.MemberId |= (uint64(b) & 0x7F) << shift
  2173. if b < 0x80 {
  2174. break
  2175. }
  2176. }
  2177. case 3:
  2178. if wireType != 0 {
  2179. return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
  2180. }
  2181. m.Revision = 0
  2182. for shift := uint(0); ; shift += 7 {
  2183. if iNdEx >= l {
  2184. return io.ErrUnexpectedEOF
  2185. }
  2186. b := data[iNdEx]
  2187. iNdEx++
  2188. m.Revision |= (int64(b) & 0x7F) << shift
  2189. if b < 0x80 {
  2190. break
  2191. }
  2192. }
  2193. case 4:
  2194. if wireType != 0 {
  2195. return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType)
  2196. }
  2197. m.RaftTerm = 0
  2198. for shift := uint(0); ; shift += 7 {
  2199. if iNdEx >= l {
  2200. return io.ErrUnexpectedEOF
  2201. }
  2202. b := data[iNdEx]
  2203. iNdEx++
  2204. m.RaftTerm |= (uint64(b) & 0x7F) << shift
  2205. if b < 0x80 {
  2206. break
  2207. }
  2208. }
  2209. default:
  2210. var sizeOfWire int
  2211. for {
  2212. sizeOfWire++
  2213. wire >>= 7
  2214. if wire == 0 {
  2215. break
  2216. }
  2217. }
  2218. iNdEx -= sizeOfWire
  2219. skippy, err := skipRpc(data[iNdEx:])
  2220. if err != nil {
  2221. return err
  2222. }
  2223. if skippy < 0 {
  2224. return ErrInvalidLengthRpc
  2225. }
  2226. if (iNdEx + skippy) > l {
  2227. return io.ErrUnexpectedEOF
  2228. }
  2229. iNdEx += skippy
  2230. }
  2231. }
  2232. return nil
  2233. }
  2234. func (m *RangeRequest) Unmarshal(data []byte) error {
  2235. l := len(data)
  2236. iNdEx := 0
  2237. for iNdEx < l {
  2238. var wire uint64
  2239. for shift := uint(0); ; shift += 7 {
  2240. if iNdEx >= l {
  2241. return io.ErrUnexpectedEOF
  2242. }
  2243. b := data[iNdEx]
  2244. iNdEx++
  2245. wire |= (uint64(b) & 0x7F) << shift
  2246. if b < 0x80 {
  2247. break
  2248. }
  2249. }
  2250. fieldNum := int32(wire >> 3)
  2251. wireType := int(wire & 0x7)
  2252. switch fieldNum {
  2253. case 1:
  2254. if wireType != 2 {
  2255. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  2256. }
  2257. var byteLen int
  2258. for shift := uint(0); ; shift += 7 {
  2259. if iNdEx >= l {
  2260. return io.ErrUnexpectedEOF
  2261. }
  2262. b := data[iNdEx]
  2263. iNdEx++
  2264. byteLen |= (int(b) & 0x7F) << shift
  2265. if b < 0x80 {
  2266. break
  2267. }
  2268. }
  2269. if byteLen < 0 {
  2270. return ErrInvalidLengthRpc
  2271. }
  2272. postIndex := iNdEx + byteLen
  2273. if postIndex > l {
  2274. return io.ErrUnexpectedEOF
  2275. }
  2276. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  2277. iNdEx = postIndex
  2278. case 2:
  2279. if wireType != 2 {
  2280. return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType)
  2281. }
  2282. var byteLen int
  2283. for shift := uint(0); ; shift += 7 {
  2284. if iNdEx >= l {
  2285. return io.ErrUnexpectedEOF
  2286. }
  2287. b := data[iNdEx]
  2288. iNdEx++
  2289. byteLen |= (int(b) & 0x7F) << shift
  2290. if b < 0x80 {
  2291. break
  2292. }
  2293. }
  2294. if byteLen < 0 {
  2295. return ErrInvalidLengthRpc
  2296. }
  2297. postIndex := iNdEx + byteLen
  2298. if postIndex > l {
  2299. return io.ErrUnexpectedEOF
  2300. }
  2301. m.RangeEnd = append([]byte{}, data[iNdEx:postIndex]...)
  2302. iNdEx = postIndex
  2303. case 3:
  2304. if wireType != 0 {
  2305. return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType)
  2306. }
  2307. m.Limit = 0
  2308. for shift := uint(0); ; shift += 7 {
  2309. if iNdEx >= l {
  2310. return io.ErrUnexpectedEOF
  2311. }
  2312. b := data[iNdEx]
  2313. iNdEx++
  2314. m.Limit |= (int64(b) & 0x7F) << shift
  2315. if b < 0x80 {
  2316. break
  2317. }
  2318. }
  2319. case 4:
  2320. if wireType != 0 {
  2321. return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
  2322. }
  2323. m.Revision = 0
  2324. for shift := uint(0); ; shift += 7 {
  2325. if iNdEx >= l {
  2326. return io.ErrUnexpectedEOF
  2327. }
  2328. b := data[iNdEx]
  2329. iNdEx++
  2330. m.Revision |= (int64(b) & 0x7F) << shift
  2331. if b < 0x80 {
  2332. break
  2333. }
  2334. }
  2335. default:
  2336. var sizeOfWire int
  2337. for {
  2338. sizeOfWire++
  2339. wire >>= 7
  2340. if wire == 0 {
  2341. break
  2342. }
  2343. }
  2344. iNdEx -= sizeOfWire
  2345. skippy, err := skipRpc(data[iNdEx:])
  2346. if err != nil {
  2347. return err
  2348. }
  2349. if skippy < 0 {
  2350. return ErrInvalidLengthRpc
  2351. }
  2352. if (iNdEx + skippy) > l {
  2353. return io.ErrUnexpectedEOF
  2354. }
  2355. iNdEx += skippy
  2356. }
  2357. }
  2358. return nil
  2359. }
  2360. func (m *RangeResponse) Unmarshal(data []byte) error {
  2361. l := len(data)
  2362. iNdEx := 0
  2363. for iNdEx < l {
  2364. var wire uint64
  2365. for shift := uint(0); ; shift += 7 {
  2366. if iNdEx >= l {
  2367. return io.ErrUnexpectedEOF
  2368. }
  2369. b := data[iNdEx]
  2370. iNdEx++
  2371. wire |= (uint64(b) & 0x7F) << shift
  2372. if b < 0x80 {
  2373. break
  2374. }
  2375. }
  2376. fieldNum := int32(wire >> 3)
  2377. wireType := int(wire & 0x7)
  2378. switch fieldNum {
  2379. case 1:
  2380. if wireType != 2 {
  2381. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  2382. }
  2383. var msglen int
  2384. for shift := uint(0); ; shift += 7 {
  2385. if iNdEx >= l {
  2386. return io.ErrUnexpectedEOF
  2387. }
  2388. b := data[iNdEx]
  2389. iNdEx++
  2390. msglen |= (int(b) & 0x7F) << shift
  2391. if b < 0x80 {
  2392. break
  2393. }
  2394. }
  2395. if msglen < 0 {
  2396. return ErrInvalidLengthRpc
  2397. }
  2398. postIndex := iNdEx + msglen
  2399. if postIndex > l {
  2400. return io.ErrUnexpectedEOF
  2401. }
  2402. if m.Header == nil {
  2403. m.Header = &ResponseHeader{}
  2404. }
  2405. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2406. return err
  2407. }
  2408. iNdEx = postIndex
  2409. case 2:
  2410. if wireType != 2 {
  2411. return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType)
  2412. }
  2413. var msglen int
  2414. for shift := uint(0); ; shift += 7 {
  2415. if iNdEx >= l {
  2416. return io.ErrUnexpectedEOF
  2417. }
  2418. b := data[iNdEx]
  2419. iNdEx++
  2420. msglen |= (int(b) & 0x7F) << shift
  2421. if b < 0x80 {
  2422. break
  2423. }
  2424. }
  2425. if msglen < 0 {
  2426. return ErrInvalidLengthRpc
  2427. }
  2428. postIndex := iNdEx + msglen
  2429. if postIndex > l {
  2430. return io.ErrUnexpectedEOF
  2431. }
  2432. m.Kvs = append(m.Kvs, &storagepb.KeyValue{})
  2433. if err := m.Kvs[len(m.Kvs)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2434. return err
  2435. }
  2436. iNdEx = postIndex
  2437. case 3:
  2438. if wireType != 0 {
  2439. return fmt.Errorf("proto: wrong wireType = %d for field More", wireType)
  2440. }
  2441. var v int
  2442. for shift := uint(0); ; shift += 7 {
  2443. if iNdEx >= l {
  2444. return io.ErrUnexpectedEOF
  2445. }
  2446. b := data[iNdEx]
  2447. iNdEx++
  2448. v |= (int(b) & 0x7F) << shift
  2449. if b < 0x80 {
  2450. break
  2451. }
  2452. }
  2453. m.More = bool(v != 0)
  2454. default:
  2455. var sizeOfWire int
  2456. for {
  2457. sizeOfWire++
  2458. wire >>= 7
  2459. if wire == 0 {
  2460. break
  2461. }
  2462. }
  2463. iNdEx -= sizeOfWire
  2464. skippy, err := skipRpc(data[iNdEx:])
  2465. if err != nil {
  2466. return err
  2467. }
  2468. if skippy < 0 {
  2469. return ErrInvalidLengthRpc
  2470. }
  2471. if (iNdEx + skippy) > l {
  2472. return io.ErrUnexpectedEOF
  2473. }
  2474. iNdEx += skippy
  2475. }
  2476. }
  2477. return nil
  2478. }
  2479. func (m *PutRequest) Unmarshal(data []byte) error {
  2480. l := len(data)
  2481. iNdEx := 0
  2482. for iNdEx < l {
  2483. var wire uint64
  2484. for shift := uint(0); ; shift += 7 {
  2485. if iNdEx >= l {
  2486. return io.ErrUnexpectedEOF
  2487. }
  2488. b := data[iNdEx]
  2489. iNdEx++
  2490. wire |= (uint64(b) & 0x7F) << shift
  2491. if b < 0x80 {
  2492. break
  2493. }
  2494. }
  2495. fieldNum := int32(wire >> 3)
  2496. wireType := int(wire & 0x7)
  2497. switch fieldNum {
  2498. case 1:
  2499. if wireType != 2 {
  2500. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  2501. }
  2502. var byteLen int
  2503. for shift := uint(0); ; shift += 7 {
  2504. if iNdEx >= l {
  2505. return io.ErrUnexpectedEOF
  2506. }
  2507. b := data[iNdEx]
  2508. iNdEx++
  2509. byteLen |= (int(b) & 0x7F) << shift
  2510. if b < 0x80 {
  2511. break
  2512. }
  2513. }
  2514. if byteLen < 0 {
  2515. return ErrInvalidLengthRpc
  2516. }
  2517. postIndex := iNdEx + byteLen
  2518. if postIndex > l {
  2519. return io.ErrUnexpectedEOF
  2520. }
  2521. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  2522. iNdEx = postIndex
  2523. case 2:
  2524. if wireType != 2 {
  2525. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  2526. }
  2527. var byteLen int
  2528. for shift := uint(0); ; shift += 7 {
  2529. if iNdEx >= l {
  2530. return io.ErrUnexpectedEOF
  2531. }
  2532. b := data[iNdEx]
  2533. iNdEx++
  2534. byteLen |= (int(b) & 0x7F) << shift
  2535. if b < 0x80 {
  2536. break
  2537. }
  2538. }
  2539. if byteLen < 0 {
  2540. return ErrInvalidLengthRpc
  2541. }
  2542. postIndex := iNdEx + byteLen
  2543. if postIndex > l {
  2544. return io.ErrUnexpectedEOF
  2545. }
  2546. m.Value = append([]byte{}, data[iNdEx:postIndex]...)
  2547. iNdEx = postIndex
  2548. case 3:
  2549. if wireType != 0 {
  2550. return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
  2551. }
  2552. m.Lease = 0
  2553. for shift := uint(0); ; shift += 7 {
  2554. if iNdEx >= l {
  2555. return io.ErrUnexpectedEOF
  2556. }
  2557. b := data[iNdEx]
  2558. iNdEx++
  2559. m.Lease |= (int64(b) & 0x7F) << shift
  2560. if b < 0x80 {
  2561. break
  2562. }
  2563. }
  2564. default:
  2565. var sizeOfWire int
  2566. for {
  2567. sizeOfWire++
  2568. wire >>= 7
  2569. if wire == 0 {
  2570. break
  2571. }
  2572. }
  2573. iNdEx -= sizeOfWire
  2574. skippy, err := skipRpc(data[iNdEx:])
  2575. if err != nil {
  2576. return err
  2577. }
  2578. if skippy < 0 {
  2579. return ErrInvalidLengthRpc
  2580. }
  2581. if (iNdEx + skippy) > l {
  2582. return io.ErrUnexpectedEOF
  2583. }
  2584. iNdEx += skippy
  2585. }
  2586. }
  2587. return nil
  2588. }
  2589. func (m *PutResponse) Unmarshal(data []byte) error {
  2590. l := len(data)
  2591. iNdEx := 0
  2592. for iNdEx < l {
  2593. var wire uint64
  2594. for shift := uint(0); ; shift += 7 {
  2595. if iNdEx >= l {
  2596. return io.ErrUnexpectedEOF
  2597. }
  2598. b := data[iNdEx]
  2599. iNdEx++
  2600. wire |= (uint64(b) & 0x7F) << shift
  2601. if b < 0x80 {
  2602. break
  2603. }
  2604. }
  2605. fieldNum := int32(wire >> 3)
  2606. wireType := int(wire & 0x7)
  2607. switch fieldNum {
  2608. case 1:
  2609. if wireType != 2 {
  2610. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  2611. }
  2612. var msglen int
  2613. for shift := uint(0); ; shift += 7 {
  2614. if iNdEx >= l {
  2615. return io.ErrUnexpectedEOF
  2616. }
  2617. b := data[iNdEx]
  2618. iNdEx++
  2619. msglen |= (int(b) & 0x7F) << shift
  2620. if b < 0x80 {
  2621. break
  2622. }
  2623. }
  2624. if msglen < 0 {
  2625. return ErrInvalidLengthRpc
  2626. }
  2627. postIndex := iNdEx + msglen
  2628. if postIndex > l {
  2629. return io.ErrUnexpectedEOF
  2630. }
  2631. if m.Header == nil {
  2632. m.Header = &ResponseHeader{}
  2633. }
  2634. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2635. return err
  2636. }
  2637. iNdEx = postIndex
  2638. default:
  2639. var sizeOfWire int
  2640. for {
  2641. sizeOfWire++
  2642. wire >>= 7
  2643. if wire == 0 {
  2644. break
  2645. }
  2646. }
  2647. iNdEx -= sizeOfWire
  2648. skippy, err := skipRpc(data[iNdEx:])
  2649. if err != nil {
  2650. return err
  2651. }
  2652. if skippy < 0 {
  2653. return ErrInvalidLengthRpc
  2654. }
  2655. if (iNdEx + skippy) > l {
  2656. return io.ErrUnexpectedEOF
  2657. }
  2658. iNdEx += skippy
  2659. }
  2660. }
  2661. return nil
  2662. }
  2663. func (m *DeleteRangeRequest) Unmarshal(data []byte) error {
  2664. l := len(data)
  2665. iNdEx := 0
  2666. for iNdEx < l {
  2667. var wire uint64
  2668. for shift := uint(0); ; shift += 7 {
  2669. if iNdEx >= l {
  2670. return io.ErrUnexpectedEOF
  2671. }
  2672. b := data[iNdEx]
  2673. iNdEx++
  2674. wire |= (uint64(b) & 0x7F) << shift
  2675. if b < 0x80 {
  2676. break
  2677. }
  2678. }
  2679. fieldNum := int32(wire >> 3)
  2680. wireType := int(wire & 0x7)
  2681. switch fieldNum {
  2682. case 1:
  2683. if wireType != 2 {
  2684. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  2685. }
  2686. var byteLen int
  2687. for shift := uint(0); ; shift += 7 {
  2688. if iNdEx >= l {
  2689. return io.ErrUnexpectedEOF
  2690. }
  2691. b := data[iNdEx]
  2692. iNdEx++
  2693. byteLen |= (int(b) & 0x7F) << shift
  2694. if b < 0x80 {
  2695. break
  2696. }
  2697. }
  2698. if byteLen < 0 {
  2699. return ErrInvalidLengthRpc
  2700. }
  2701. postIndex := iNdEx + byteLen
  2702. if postIndex > l {
  2703. return io.ErrUnexpectedEOF
  2704. }
  2705. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  2706. iNdEx = postIndex
  2707. case 2:
  2708. if wireType != 2 {
  2709. return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType)
  2710. }
  2711. var byteLen int
  2712. for shift := uint(0); ; shift += 7 {
  2713. if iNdEx >= l {
  2714. return io.ErrUnexpectedEOF
  2715. }
  2716. b := data[iNdEx]
  2717. iNdEx++
  2718. byteLen |= (int(b) & 0x7F) << shift
  2719. if b < 0x80 {
  2720. break
  2721. }
  2722. }
  2723. if byteLen < 0 {
  2724. return ErrInvalidLengthRpc
  2725. }
  2726. postIndex := iNdEx + byteLen
  2727. if postIndex > l {
  2728. return io.ErrUnexpectedEOF
  2729. }
  2730. m.RangeEnd = append([]byte{}, data[iNdEx:postIndex]...)
  2731. iNdEx = postIndex
  2732. default:
  2733. var sizeOfWire int
  2734. for {
  2735. sizeOfWire++
  2736. wire >>= 7
  2737. if wire == 0 {
  2738. break
  2739. }
  2740. }
  2741. iNdEx -= sizeOfWire
  2742. skippy, err := skipRpc(data[iNdEx:])
  2743. if err != nil {
  2744. return err
  2745. }
  2746. if skippy < 0 {
  2747. return ErrInvalidLengthRpc
  2748. }
  2749. if (iNdEx + skippy) > l {
  2750. return io.ErrUnexpectedEOF
  2751. }
  2752. iNdEx += skippy
  2753. }
  2754. }
  2755. return nil
  2756. }
  2757. func (m *DeleteRangeResponse) Unmarshal(data []byte) error {
  2758. l := len(data)
  2759. iNdEx := 0
  2760. for iNdEx < l {
  2761. var wire uint64
  2762. for shift := uint(0); ; shift += 7 {
  2763. if iNdEx >= l {
  2764. return io.ErrUnexpectedEOF
  2765. }
  2766. b := data[iNdEx]
  2767. iNdEx++
  2768. wire |= (uint64(b) & 0x7F) << shift
  2769. if b < 0x80 {
  2770. break
  2771. }
  2772. }
  2773. fieldNum := int32(wire >> 3)
  2774. wireType := int(wire & 0x7)
  2775. switch fieldNum {
  2776. case 1:
  2777. if wireType != 2 {
  2778. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  2779. }
  2780. var msglen int
  2781. for shift := uint(0); ; shift += 7 {
  2782. if iNdEx >= l {
  2783. return io.ErrUnexpectedEOF
  2784. }
  2785. b := data[iNdEx]
  2786. iNdEx++
  2787. msglen |= (int(b) & 0x7F) << shift
  2788. if b < 0x80 {
  2789. break
  2790. }
  2791. }
  2792. if msglen < 0 {
  2793. return ErrInvalidLengthRpc
  2794. }
  2795. postIndex := iNdEx + msglen
  2796. if postIndex > l {
  2797. return io.ErrUnexpectedEOF
  2798. }
  2799. if m.Header == nil {
  2800. m.Header = &ResponseHeader{}
  2801. }
  2802. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2803. return err
  2804. }
  2805. iNdEx = postIndex
  2806. default:
  2807. var sizeOfWire int
  2808. for {
  2809. sizeOfWire++
  2810. wire >>= 7
  2811. if wire == 0 {
  2812. break
  2813. }
  2814. }
  2815. iNdEx -= sizeOfWire
  2816. skippy, err := skipRpc(data[iNdEx:])
  2817. if err != nil {
  2818. return err
  2819. }
  2820. if skippy < 0 {
  2821. return ErrInvalidLengthRpc
  2822. }
  2823. if (iNdEx + skippy) > l {
  2824. return io.ErrUnexpectedEOF
  2825. }
  2826. iNdEx += skippy
  2827. }
  2828. }
  2829. return nil
  2830. }
  2831. func (m *RequestUnion) Unmarshal(data []byte) error {
  2832. l := len(data)
  2833. iNdEx := 0
  2834. for iNdEx < l {
  2835. var wire uint64
  2836. for shift := uint(0); ; shift += 7 {
  2837. if iNdEx >= l {
  2838. return io.ErrUnexpectedEOF
  2839. }
  2840. b := data[iNdEx]
  2841. iNdEx++
  2842. wire |= (uint64(b) & 0x7F) << shift
  2843. if b < 0x80 {
  2844. break
  2845. }
  2846. }
  2847. fieldNum := int32(wire >> 3)
  2848. wireType := int(wire & 0x7)
  2849. switch fieldNum {
  2850. case 1:
  2851. if wireType != 2 {
  2852. return fmt.Errorf("proto: wrong wireType = %d for field RequestRange", wireType)
  2853. }
  2854. var msglen int
  2855. for shift := uint(0); ; shift += 7 {
  2856. if iNdEx >= l {
  2857. return io.ErrUnexpectedEOF
  2858. }
  2859. b := data[iNdEx]
  2860. iNdEx++
  2861. msglen |= (int(b) & 0x7F) << shift
  2862. if b < 0x80 {
  2863. break
  2864. }
  2865. }
  2866. if msglen < 0 {
  2867. return ErrInvalidLengthRpc
  2868. }
  2869. postIndex := iNdEx + msglen
  2870. if postIndex > l {
  2871. return io.ErrUnexpectedEOF
  2872. }
  2873. if m.RequestRange == nil {
  2874. m.RequestRange = &RangeRequest{}
  2875. }
  2876. if err := m.RequestRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2877. return err
  2878. }
  2879. iNdEx = postIndex
  2880. case 2:
  2881. if wireType != 2 {
  2882. return fmt.Errorf("proto: wrong wireType = %d for field RequestPut", wireType)
  2883. }
  2884. var msglen int
  2885. for shift := uint(0); ; shift += 7 {
  2886. if iNdEx >= l {
  2887. return io.ErrUnexpectedEOF
  2888. }
  2889. b := data[iNdEx]
  2890. iNdEx++
  2891. msglen |= (int(b) & 0x7F) << shift
  2892. if b < 0x80 {
  2893. break
  2894. }
  2895. }
  2896. if msglen < 0 {
  2897. return ErrInvalidLengthRpc
  2898. }
  2899. postIndex := iNdEx + msglen
  2900. if postIndex > l {
  2901. return io.ErrUnexpectedEOF
  2902. }
  2903. if m.RequestPut == nil {
  2904. m.RequestPut = &PutRequest{}
  2905. }
  2906. if err := m.RequestPut.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2907. return err
  2908. }
  2909. iNdEx = postIndex
  2910. case 3:
  2911. if wireType != 2 {
  2912. return fmt.Errorf("proto: wrong wireType = %d for field RequestDeleteRange", wireType)
  2913. }
  2914. var msglen int
  2915. for shift := uint(0); ; shift += 7 {
  2916. if iNdEx >= l {
  2917. return io.ErrUnexpectedEOF
  2918. }
  2919. b := data[iNdEx]
  2920. iNdEx++
  2921. msglen |= (int(b) & 0x7F) << shift
  2922. if b < 0x80 {
  2923. break
  2924. }
  2925. }
  2926. if msglen < 0 {
  2927. return ErrInvalidLengthRpc
  2928. }
  2929. postIndex := iNdEx + msglen
  2930. if postIndex > l {
  2931. return io.ErrUnexpectedEOF
  2932. }
  2933. if m.RequestDeleteRange == nil {
  2934. m.RequestDeleteRange = &DeleteRangeRequest{}
  2935. }
  2936. if err := m.RequestDeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2937. return err
  2938. }
  2939. iNdEx = postIndex
  2940. default:
  2941. var sizeOfWire int
  2942. for {
  2943. sizeOfWire++
  2944. wire >>= 7
  2945. if wire == 0 {
  2946. break
  2947. }
  2948. }
  2949. iNdEx -= sizeOfWire
  2950. skippy, err := skipRpc(data[iNdEx:])
  2951. if err != nil {
  2952. return err
  2953. }
  2954. if skippy < 0 {
  2955. return ErrInvalidLengthRpc
  2956. }
  2957. if (iNdEx + skippy) > l {
  2958. return io.ErrUnexpectedEOF
  2959. }
  2960. iNdEx += skippy
  2961. }
  2962. }
  2963. return nil
  2964. }
  2965. func (m *ResponseUnion) Unmarshal(data []byte) error {
  2966. l := len(data)
  2967. iNdEx := 0
  2968. for iNdEx < l {
  2969. var wire uint64
  2970. for shift := uint(0); ; shift += 7 {
  2971. if iNdEx >= l {
  2972. return io.ErrUnexpectedEOF
  2973. }
  2974. b := data[iNdEx]
  2975. iNdEx++
  2976. wire |= (uint64(b) & 0x7F) << shift
  2977. if b < 0x80 {
  2978. break
  2979. }
  2980. }
  2981. fieldNum := int32(wire >> 3)
  2982. wireType := int(wire & 0x7)
  2983. switch fieldNum {
  2984. case 1:
  2985. if wireType != 2 {
  2986. return fmt.Errorf("proto: wrong wireType = %d for field ResponseRange", wireType)
  2987. }
  2988. var msglen int
  2989. for shift := uint(0); ; shift += 7 {
  2990. if iNdEx >= l {
  2991. return io.ErrUnexpectedEOF
  2992. }
  2993. b := data[iNdEx]
  2994. iNdEx++
  2995. msglen |= (int(b) & 0x7F) << shift
  2996. if b < 0x80 {
  2997. break
  2998. }
  2999. }
  3000. if msglen < 0 {
  3001. return ErrInvalidLengthRpc
  3002. }
  3003. postIndex := iNdEx + msglen
  3004. if postIndex > l {
  3005. return io.ErrUnexpectedEOF
  3006. }
  3007. if m.ResponseRange == nil {
  3008. m.ResponseRange = &RangeResponse{}
  3009. }
  3010. if err := m.ResponseRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3011. return err
  3012. }
  3013. iNdEx = postIndex
  3014. case 2:
  3015. if wireType != 2 {
  3016. return fmt.Errorf("proto: wrong wireType = %d for field ResponsePut", wireType)
  3017. }
  3018. var msglen int
  3019. for shift := uint(0); ; shift += 7 {
  3020. if iNdEx >= l {
  3021. return io.ErrUnexpectedEOF
  3022. }
  3023. b := data[iNdEx]
  3024. iNdEx++
  3025. msglen |= (int(b) & 0x7F) << shift
  3026. if b < 0x80 {
  3027. break
  3028. }
  3029. }
  3030. if msglen < 0 {
  3031. return ErrInvalidLengthRpc
  3032. }
  3033. postIndex := iNdEx + msglen
  3034. if postIndex > l {
  3035. return io.ErrUnexpectedEOF
  3036. }
  3037. if m.ResponsePut == nil {
  3038. m.ResponsePut = &PutResponse{}
  3039. }
  3040. if err := m.ResponsePut.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3041. return err
  3042. }
  3043. iNdEx = postIndex
  3044. case 3:
  3045. if wireType != 2 {
  3046. return fmt.Errorf("proto: wrong wireType = %d for field ResponseDeleteRange", wireType)
  3047. }
  3048. var msglen int
  3049. for shift := uint(0); ; shift += 7 {
  3050. if iNdEx >= l {
  3051. return io.ErrUnexpectedEOF
  3052. }
  3053. b := data[iNdEx]
  3054. iNdEx++
  3055. msglen |= (int(b) & 0x7F) << shift
  3056. if b < 0x80 {
  3057. break
  3058. }
  3059. }
  3060. if msglen < 0 {
  3061. return ErrInvalidLengthRpc
  3062. }
  3063. postIndex := iNdEx + msglen
  3064. if postIndex > l {
  3065. return io.ErrUnexpectedEOF
  3066. }
  3067. if m.ResponseDeleteRange == nil {
  3068. m.ResponseDeleteRange = &DeleteRangeResponse{}
  3069. }
  3070. if err := m.ResponseDeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3071. return err
  3072. }
  3073. iNdEx = postIndex
  3074. default:
  3075. var sizeOfWire int
  3076. for {
  3077. sizeOfWire++
  3078. wire >>= 7
  3079. if wire == 0 {
  3080. break
  3081. }
  3082. }
  3083. iNdEx -= sizeOfWire
  3084. skippy, err := skipRpc(data[iNdEx:])
  3085. if err != nil {
  3086. return err
  3087. }
  3088. if skippy < 0 {
  3089. return ErrInvalidLengthRpc
  3090. }
  3091. if (iNdEx + skippy) > l {
  3092. return io.ErrUnexpectedEOF
  3093. }
  3094. iNdEx += skippy
  3095. }
  3096. }
  3097. return nil
  3098. }
  3099. func (m *Compare) Unmarshal(data []byte) error {
  3100. l := len(data)
  3101. iNdEx := 0
  3102. for iNdEx < l {
  3103. var wire uint64
  3104. for shift := uint(0); ; shift += 7 {
  3105. if iNdEx >= l {
  3106. return io.ErrUnexpectedEOF
  3107. }
  3108. b := data[iNdEx]
  3109. iNdEx++
  3110. wire |= (uint64(b) & 0x7F) << shift
  3111. if b < 0x80 {
  3112. break
  3113. }
  3114. }
  3115. fieldNum := int32(wire >> 3)
  3116. wireType := int(wire & 0x7)
  3117. switch fieldNum {
  3118. case 1:
  3119. if wireType != 0 {
  3120. return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType)
  3121. }
  3122. m.Result = 0
  3123. for shift := uint(0); ; shift += 7 {
  3124. if iNdEx >= l {
  3125. return io.ErrUnexpectedEOF
  3126. }
  3127. b := data[iNdEx]
  3128. iNdEx++
  3129. m.Result |= (Compare_CompareResult(b) & 0x7F) << shift
  3130. if b < 0x80 {
  3131. break
  3132. }
  3133. }
  3134. case 2:
  3135. if wireType != 0 {
  3136. return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
  3137. }
  3138. m.Target = 0
  3139. for shift := uint(0); ; shift += 7 {
  3140. if iNdEx >= l {
  3141. return io.ErrUnexpectedEOF
  3142. }
  3143. b := data[iNdEx]
  3144. iNdEx++
  3145. m.Target |= (Compare_CompareTarget(b) & 0x7F) << shift
  3146. if b < 0x80 {
  3147. break
  3148. }
  3149. }
  3150. case 3:
  3151. if wireType != 2 {
  3152. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  3153. }
  3154. var byteLen int
  3155. for shift := uint(0); ; shift += 7 {
  3156. if iNdEx >= l {
  3157. return io.ErrUnexpectedEOF
  3158. }
  3159. b := data[iNdEx]
  3160. iNdEx++
  3161. byteLen |= (int(b) & 0x7F) << shift
  3162. if b < 0x80 {
  3163. break
  3164. }
  3165. }
  3166. if byteLen < 0 {
  3167. return ErrInvalidLengthRpc
  3168. }
  3169. postIndex := iNdEx + byteLen
  3170. if postIndex > l {
  3171. return io.ErrUnexpectedEOF
  3172. }
  3173. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  3174. iNdEx = postIndex
  3175. case 4:
  3176. if wireType != 0 {
  3177. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  3178. }
  3179. m.Version = 0
  3180. for shift := uint(0); ; shift += 7 {
  3181. if iNdEx >= l {
  3182. return io.ErrUnexpectedEOF
  3183. }
  3184. b := data[iNdEx]
  3185. iNdEx++
  3186. m.Version |= (int64(b) & 0x7F) << shift
  3187. if b < 0x80 {
  3188. break
  3189. }
  3190. }
  3191. case 5:
  3192. if wireType != 0 {
  3193. return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType)
  3194. }
  3195. m.CreateRevision = 0
  3196. for shift := uint(0); ; shift += 7 {
  3197. if iNdEx >= l {
  3198. return io.ErrUnexpectedEOF
  3199. }
  3200. b := data[iNdEx]
  3201. iNdEx++
  3202. m.CreateRevision |= (int64(b) & 0x7F) << shift
  3203. if b < 0x80 {
  3204. break
  3205. }
  3206. }
  3207. case 6:
  3208. if wireType != 0 {
  3209. return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType)
  3210. }
  3211. m.ModRevision = 0
  3212. for shift := uint(0); ; shift += 7 {
  3213. if iNdEx >= l {
  3214. return io.ErrUnexpectedEOF
  3215. }
  3216. b := data[iNdEx]
  3217. iNdEx++
  3218. m.ModRevision |= (int64(b) & 0x7F) << shift
  3219. if b < 0x80 {
  3220. break
  3221. }
  3222. }
  3223. case 7:
  3224. if wireType != 2 {
  3225. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  3226. }
  3227. var byteLen int
  3228. for shift := uint(0); ; shift += 7 {
  3229. if iNdEx >= l {
  3230. return io.ErrUnexpectedEOF
  3231. }
  3232. b := data[iNdEx]
  3233. iNdEx++
  3234. byteLen |= (int(b) & 0x7F) << shift
  3235. if b < 0x80 {
  3236. break
  3237. }
  3238. }
  3239. if byteLen < 0 {
  3240. return ErrInvalidLengthRpc
  3241. }
  3242. postIndex := iNdEx + byteLen
  3243. if postIndex > l {
  3244. return io.ErrUnexpectedEOF
  3245. }
  3246. m.Value = append([]byte{}, data[iNdEx:postIndex]...)
  3247. iNdEx = postIndex
  3248. default:
  3249. var sizeOfWire int
  3250. for {
  3251. sizeOfWire++
  3252. wire >>= 7
  3253. if wire == 0 {
  3254. break
  3255. }
  3256. }
  3257. iNdEx -= sizeOfWire
  3258. skippy, err := skipRpc(data[iNdEx:])
  3259. if err != nil {
  3260. return err
  3261. }
  3262. if skippy < 0 {
  3263. return ErrInvalidLengthRpc
  3264. }
  3265. if (iNdEx + skippy) > l {
  3266. return io.ErrUnexpectedEOF
  3267. }
  3268. iNdEx += skippy
  3269. }
  3270. }
  3271. return nil
  3272. }
  3273. func (m *TxnRequest) Unmarshal(data []byte) error {
  3274. l := len(data)
  3275. iNdEx := 0
  3276. for iNdEx < l {
  3277. var wire uint64
  3278. for shift := uint(0); ; shift += 7 {
  3279. if iNdEx >= l {
  3280. return io.ErrUnexpectedEOF
  3281. }
  3282. b := data[iNdEx]
  3283. iNdEx++
  3284. wire |= (uint64(b) & 0x7F) << shift
  3285. if b < 0x80 {
  3286. break
  3287. }
  3288. }
  3289. fieldNum := int32(wire >> 3)
  3290. wireType := int(wire & 0x7)
  3291. switch fieldNum {
  3292. case 1:
  3293. if wireType != 2 {
  3294. return fmt.Errorf("proto: wrong wireType = %d for field Compare", wireType)
  3295. }
  3296. var msglen int
  3297. for shift := uint(0); ; shift += 7 {
  3298. if iNdEx >= l {
  3299. return io.ErrUnexpectedEOF
  3300. }
  3301. b := data[iNdEx]
  3302. iNdEx++
  3303. msglen |= (int(b) & 0x7F) << shift
  3304. if b < 0x80 {
  3305. break
  3306. }
  3307. }
  3308. if msglen < 0 {
  3309. return ErrInvalidLengthRpc
  3310. }
  3311. postIndex := iNdEx + msglen
  3312. if postIndex > l {
  3313. return io.ErrUnexpectedEOF
  3314. }
  3315. m.Compare = append(m.Compare, &Compare{})
  3316. if err := m.Compare[len(m.Compare)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  3317. return err
  3318. }
  3319. iNdEx = postIndex
  3320. case 2:
  3321. if wireType != 2 {
  3322. return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType)
  3323. }
  3324. var msglen int
  3325. for shift := uint(0); ; shift += 7 {
  3326. if iNdEx >= l {
  3327. return io.ErrUnexpectedEOF
  3328. }
  3329. b := data[iNdEx]
  3330. iNdEx++
  3331. msglen |= (int(b) & 0x7F) << shift
  3332. if b < 0x80 {
  3333. break
  3334. }
  3335. }
  3336. if msglen < 0 {
  3337. return ErrInvalidLengthRpc
  3338. }
  3339. postIndex := iNdEx + msglen
  3340. if postIndex > l {
  3341. return io.ErrUnexpectedEOF
  3342. }
  3343. m.Success = append(m.Success, &RequestUnion{})
  3344. if err := m.Success[len(m.Success)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  3345. return err
  3346. }
  3347. iNdEx = postIndex
  3348. case 3:
  3349. if wireType != 2 {
  3350. return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType)
  3351. }
  3352. var msglen int
  3353. for shift := uint(0); ; shift += 7 {
  3354. if iNdEx >= l {
  3355. return io.ErrUnexpectedEOF
  3356. }
  3357. b := data[iNdEx]
  3358. iNdEx++
  3359. msglen |= (int(b) & 0x7F) << shift
  3360. if b < 0x80 {
  3361. break
  3362. }
  3363. }
  3364. if msglen < 0 {
  3365. return ErrInvalidLengthRpc
  3366. }
  3367. postIndex := iNdEx + msglen
  3368. if postIndex > l {
  3369. return io.ErrUnexpectedEOF
  3370. }
  3371. m.Failure = append(m.Failure, &RequestUnion{})
  3372. if err := m.Failure[len(m.Failure)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  3373. return err
  3374. }
  3375. iNdEx = postIndex
  3376. default:
  3377. var sizeOfWire int
  3378. for {
  3379. sizeOfWire++
  3380. wire >>= 7
  3381. if wire == 0 {
  3382. break
  3383. }
  3384. }
  3385. iNdEx -= sizeOfWire
  3386. skippy, err := skipRpc(data[iNdEx:])
  3387. if err != nil {
  3388. return err
  3389. }
  3390. if skippy < 0 {
  3391. return ErrInvalidLengthRpc
  3392. }
  3393. if (iNdEx + skippy) > l {
  3394. return io.ErrUnexpectedEOF
  3395. }
  3396. iNdEx += skippy
  3397. }
  3398. }
  3399. return nil
  3400. }
  3401. func (m *TxnResponse) Unmarshal(data []byte) error {
  3402. l := len(data)
  3403. iNdEx := 0
  3404. for iNdEx < l {
  3405. var wire uint64
  3406. for shift := uint(0); ; shift += 7 {
  3407. if iNdEx >= l {
  3408. return io.ErrUnexpectedEOF
  3409. }
  3410. b := data[iNdEx]
  3411. iNdEx++
  3412. wire |= (uint64(b) & 0x7F) << shift
  3413. if b < 0x80 {
  3414. break
  3415. }
  3416. }
  3417. fieldNum := int32(wire >> 3)
  3418. wireType := int(wire & 0x7)
  3419. switch fieldNum {
  3420. case 1:
  3421. if wireType != 2 {
  3422. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  3423. }
  3424. var msglen int
  3425. for shift := uint(0); ; shift += 7 {
  3426. if iNdEx >= l {
  3427. return io.ErrUnexpectedEOF
  3428. }
  3429. b := data[iNdEx]
  3430. iNdEx++
  3431. msglen |= (int(b) & 0x7F) << shift
  3432. if b < 0x80 {
  3433. break
  3434. }
  3435. }
  3436. if msglen < 0 {
  3437. return ErrInvalidLengthRpc
  3438. }
  3439. postIndex := iNdEx + msglen
  3440. if postIndex > l {
  3441. return io.ErrUnexpectedEOF
  3442. }
  3443. if m.Header == nil {
  3444. m.Header = &ResponseHeader{}
  3445. }
  3446. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3447. return err
  3448. }
  3449. iNdEx = postIndex
  3450. case 2:
  3451. if wireType != 0 {
  3452. return fmt.Errorf("proto: wrong wireType = %d for field Succeeded", wireType)
  3453. }
  3454. var v int
  3455. for shift := uint(0); ; shift += 7 {
  3456. if iNdEx >= l {
  3457. return io.ErrUnexpectedEOF
  3458. }
  3459. b := data[iNdEx]
  3460. iNdEx++
  3461. v |= (int(b) & 0x7F) << shift
  3462. if b < 0x80 {
  3463. break
  3464. }
  3465. }
  3466. m.Succeeded = bool(v != 0)
  3467. case 3:
  3468. if wireType != 2 {
  3469. return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType)
  3470. }
  3471. var msglen int
  3472. for shift := uint(0); ; shift += 7 {
  3473. if iNdEx >= l {
  3474. return io.ErrUnexpectedEOF
  3475. }
  3476. b := data[iNdEx]
  3477. iNdEx++
  3478. msglen |= (int(b) & 0x7F) << shift
  3479. if b < 0x80 {
  3480. break
  3481. }
  3482. }
  3483. if msglen < 0 {
  3484. return ErrInvalidLengthRpc
  3485. }
  3486. postIndex := iNdEx + msglen
  3487. if postIndex > l {
  3488. return io.ErrUnexpectedEOF
  3489. }
  3490. m.Responses = append(m.Responses, &ResponseUnion{})
  3491. if err := m.Responses[len(m.Responses)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  3492. return err
  3493. }
  3494. iNdEx = postIndex
  3495. default:
  3496. var sizeOfWire int
  3497. for {
  3498. sizeOfWire++
  3499. wire >>= 7
  3500. if wire == 0 {
  3501. break
  3502. }
  3503. }
  3504. iNdEx -= sizeOfWire
  3505. skippy, err := skipRpc(data[iNdEx:])
  3506. if err != nil {
  3507. return err
  3508. }
  3509. if skippy < 0 {
  3510. return ErrInvalidLengthRpc
  3511. }
  3512. if (iNdEx + skippy) > l {
  3513. return io.ErrUnexpectedEOF
  3514. }
  3515. iNdEx += skippy
  3516. }
  3517. }
  3518. return nil
  3519. }
  3520. func (m *CompactionRequest) Unmarshal(data []byte) error {
  3521. l := len(data)
  3522. iNdEx := 0
  3523. for iNdEx < l {
  3524. var wire uint64
  3525. for shift := uint(0); ; shift += 7 {
  3526. if iNdEx >= l {
  3527. return io.ErrUnexpectedEOF
  3528. }
  3529. b := data[iNdEx]
  3530. iNdEx++
  3531. wire |= (uint64(b) & 0x7F) << shift
  3532. if b < 0x80 {
  3533. break
  3534. }
  3535. }
  3536. fieldNum := int32(wire >> 3)
  3537. wireType := int(wire & 0x7)
  3538. switch fieldNum {
  3539. case 1:
  3540. if wireType != 0 {
  3541. return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
  3542. }
  3543. m.Revision = 0
  3544. for shift := uint(0); ; shift += 7 {
  3545. if iNdEx >= l {
  3546. return io.ErrUnexpectedEOF
  3547. }
  3548. b := data[iNdEx]
  3549. iNdEx++
  3550. m.Revision |= (int64(b) & 0x7F) << shift
  3551. if b < 0x80 {
  3552. break
  3553. }
  3554. }
  3555. default:
  3556. var sizeOfWire int
  3557. for {
  3558. sizeOfWire++
  3559. wire >>= 7
  3560. if wire == 0 {
  3561. break
  3562. }
  3563. }
  3564. iNdEx -= sizeOfWire
  3565. skippy, err := skipRpc(data[iNdEx:])
  3566. if err != nil {
  3567. return err
  3568. }
  3569. if skippy < 0 {
  3570. return ErrInvalidLengthRpc
  3571. }
  3572. if (iNdEx + skippy) > l {
  3573. return io.ErrUnexpectedEOF
  3574. }
  3575. iNdEx += skippy
  3576. }
  3577. }
  3578. return nil
  3579. }
  3580. func (m *CompactionResponse) Unmarshal(data []byte) error {
  3581. l := len(data)
  3582. iNdEx := 0
  3583. for iNdEx < l {
  3584. var wire uint64
  3585. for shift := uint(0); ; shift += 7 {
  3586. if iNdEx >= l {
  3587. return io.ErrUnexpectedEOF
  3588. }
  3589. b := data[iNdEx]
  3590. iNdEx++
  3591. wire |= (uint64(b) & 0x7F) << shift
  3592. if b < 0x80 {
  3593. break
  3594. }
  3595. }
  3596. fieldNum := int32(wire >> 3)
  3597. wireType := int(wire & 0x7)
  3598. switch fieldNum {
  3599. case 1:
  3600. if wireType != 2 {
  3601. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  3602. }
  3603. var msglen int
  3604. for shift := uint(0); ; shift += 7 {
  3605. if iNdEx >= l {
  3606. return io.ErrUnexpectedEOF
  3607. }
  3608. b := data[iNdEx]
  3609. iNdEx++
  3610. msglen |= (int(b) & 0x7F) << shift
  3611. if b < 0x80 {
  3612. break
  3613. }
  3614. }
  3615. if msglen < 0 {
  3616. return ErrInvalidLengthRpc
  3617. }
  3618. postIndex := iNdEx + msglen
  3619. if postIndex > l {
  3620. return io.ErrUnexpectedEOF
  3621. }
  3622. if m.Header == nil {
  3623. m.Header = &ResponseHeader{}
  3624. }
  3625. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3626. return err
  3627. }
  3628. iNdEx = postIndex
  3629. default:
  3630. var sizeOfWire int
  3631. for {
  3632. sizeOfWire++
  3633. wire >>= 7
  3634. if wire == 0 {
  3635. break
  3636. }
  3637. }
  3638. iNdEx -= sizeOfWire
  3639. skippy, err := skipRpc(data[iNdEx:])
  3640. if err != nil {
  3641. return err
  3642. }
  3643. if skippy < 0 {
  3644. return ErrInvalidLengthRpc
  3645. }
  3646. if (iNdEx + skippy) > l {
  3647. return io.ErrUnexpectedEOF
  3648. }
  3649. iNdEx += skippy
  3650. }
  3651. }
  3652. return nil
  3653. }
  3654. func (m *WatchRequest) Unmarshal(data []byte) error {
  3655. l := len(data)
  3656. iNdEx := 0
  3657. for iNdEx < l {
  3658. var wire uint64
  3659. for shift := uint(0); ; shift += 7 {
  3660. if iNdEx >= l {
  3661. return io.ErrUnexpectedEOF
  3662. }
  3663. b := data[iNdEx]
  3664. iNdEx++
  3665. wire |= (uint64(b) & 0x7F) << shift
  3666. if b < 0x80 {
  3667. break
  3668. }
  3669. }
  3670. fieldNum := int32(wire >> 3)
  3671. wireType := int(wire & 0x7)
  3672. switch fieldNum {
  3673. case 1:
  3674. if wireType != 2 {
  3675. return fmt.Errorf("proto: wrong wireType = %d for field CreateRequest", wireType)
  3676. }
  3677. var msglen int
  3678. for shift := uint(0); ; shift += 7 {
  3679. if iNdEx >= l {
  3680. return io.ErrUnexpectedEOF
  3681. }
  3682. b := data[iNdEx]
  3683. iNdEx++
  3684. msglen |= (int(b) & 0x7F) << shift
  3685. if b < 0x80 {
  3686. break
  3687. }
  3688. }
  3689. if msglen < 0 {
  3690. return ErrInvalidLengthRpc
  3691. }
  3692. postIndex := iNdEx + msglen
  3693. if postIndex > l {
  3694. return io.ErrUnexpectedEOF
  3695. }
  3696. if m.CreateRequest == nil {
  3697. m.CreateRequest = &WatchCreateRequest{}
  3698. }
  3699. if err := m.CreateRequest.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3700. return err
  3701. }
  3702. iNdEx = postIndex
  3703. case 2:
  3704. if wireType != 2 {
  3705. return fmt.Errorf("proto: wrong wireType = %d for field CancelRequest", wireType)
  3706. }
  3707. var msglen int
  3708. for shift := uint(0); ; shift += 7 {
  3709. if iNdEx >= l {
  3710. return io.ErrUnexpectedEOF
  3711. }
  3712. b := data[iNdEx]
  3713. iNdEx++
  3714. msglen |= (int(b) & 0x7F) << shift
  3715. if b < 0x80 {
  3716. break
  3717. }
  3718. }
  3719. if msglen < 0 {
  3720. return ErrInvalidLengthRpc
  3721. }
  3722. postIndex := iNdEx + msglen
  3723. if postIndex > l {
  3724. return io.ErrUnexpectedEOF
  3725. }
  3726. if m.CancelRequest == nil {
  3727. m.CancelRequest = &WatchCancelRequest{}
  3728. }
  3729. if err := m.CancelRequest.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3730. return err
  3731. }
  3732. iNdEx = postIndex
  3733. default:
  3734. var sizeOfWire int
  3735. for {
  3736. sizeOfWire++
  3737. wire >>= 7
  3738. if wire == 0 {
  3739. break
  3740. }
  3741. }
  3742. iNdEx -= sizeOfWire
  3743. skippy, err := skipRpc(data[iNdEx:])
  3744. if err != nil {
  3745. return err
  3746. }
  3747. if skippy < 0 {
  3748. return ErrInvalidLengthRpc
  3749. }
  3750. if (iNdEx + skippy) > l {
  3751. return io.ErrUnexpectedEOF
  3752. }
  3753. iNdEx += skippy
  3754. }
  3755. }
  3756. return nil
  3757. }
  3758. func (m *WatchCreateRequest) Unmarshal(data []byte) error {
  3759. l := len(data)
  3760. iNdEx := 0
  3761. for iNdEx < l {
  3762. var wire uint64
  3763. for shift := uint(0); ; shift += 7 {
  3764. if iNdEx >= l {
  3765. return io.ErrUnexpectedEOF
  3766. }
  3767. b := data[iNdEx]
  3768. iNdEx++
  3769. wire |= (uint64(b) & 0x7F) << shift
  3770. if b < 0x80 {
  3771. break
  3772. }
  3773. }
  3774. fieldNum := int32(wire >> 3)
  3775. wireType := int(wire & 0x7)
  3776. switch fieldNum {
  3777. case 1:
  3778. if wireType != 2 {
  3779. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  3780. }
  3781. var byteLen int
  3782. for shift := uint(0); ; shift += 7 {
  3783. if iNdEx >= l {
  3784. return io.ErrUnexpectedEOF
  3785. }
  3786. b := data[iNdEx]
  3787. iNdEx++
  3788. byteLen |= (int(b) & 0x7F) << shift
  3789. if b < 0x80 {
  3790. break
  3791. }
  3792. }
  3793. if byteLen < 0 {
  3794. return ErrInvalidLengthRpc
  3795. }
  3796. postIndex := iNdEx + byteLen
  3797. if postIndex > l {
  3798. return io.ErrUnexpectedEOF
  3799. }
  3800. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  3801. iNdEx = postIndex
  3802. case 2:
  3803. if wireType != 2 {
  3804. return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType)
  3805. }
  3806. var byteLen int
  3807. for shift := uint(0); ; shift += 7 {
  3808. if iNdEx >= l {
  3809. return io.ErrUnexpectedEOF
  3810. }
  3811. b := data[iNdEx]
  3812. iNdEx++
  3813. byteLen |= (int(b) & 0x7F) << shift
  3814. if b < 0x80 {
  3815. break
  3816. }
  3817. }
  3818. if byteLen < 0 {
  3819. return ErrInvalidLengthRpc
  3820. }
  3821. postIndex := iNdEx + byteLen
  3822. if postIndex > l {
  3823. return io.ErrUnexpectedEOF
  3824. }
  3825. m.Prefix = append([]byte{}, data[iNdEx:postIndex]...)
  3826. iNdEx = postIndex
  3827. case 3:
  3828. if wireType != 0 {
  3829. return fmt.Errorf("proto: wrong wireType = %d for field StartRevision", wireType)
  3830. }
  3831. m.StartRevision = 0
  3832. for shift := uint(0); ; shift += 7 {
  3833. if iNdEx >= l {
  3834. return io.ErrUnexpectedEOF
  3835. }
  3836. b := data[iNdEx]
  3837. iNdEx++
  3838. m.StartRevision |= (int64(b) & 0x7F) << shift
  3839. if b < 0x80 {
  3840. break
  3841. }
  3842. }
  3843. default:
  3844. var sizeOfWire int
  3845. for {
  3846. sizeOfWire++
  3847. wire >>= 7
  3848. if wire == 0 {
  3849. break
  3850. }
  3851. }
  3852. iNdEx -= sizeOfWire
  3853. skippy, err := skipRpc(data[iNdEx:])
  3854. if err != nil {
  3855. return err
  3856. }
  3857. if skippy < 0 {
  3858. return ErrInvalidLengthRpc
  3859. }
  3860. if (iNdEx + skippy) > l {
  3861. return io.ErrUnexpectedEOF
  3862. }
  3863. iNdEx += skippy
  3864. }
  3865. }
  3866. return nil
  3867. }
  3868. func (m *WatchCancelRequest) Unmarshal(data []byte) error {
  3869. l := len(data)
  3870. iNdEx := 0
  3871. for iNdEx < l {
  3872. var wire uint64
  3873. for shift := uint(0); ; shift += 7 {
  3874. if iNdEx >= l {
  3875. return io.ErrUnexpectedEOF
  3876. }
  3877. b := data[iNdEx]
  3878. iNdEx++
  3879. wire |= (uint64(b) & 0x7F) << shift
  3880. if b < 0x80 {
  3881. break
  3882. }
  3883. }
  3884. fieldNum := int32(wire >> 3)
  3885. wireType := int(wire & 0x7)
  3886. switch fieldNum {
  3887. case 1:
  3888. if wireType != 0 {
  3889. return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType)
  3890. }
  3891. m.WatchId = 0
  3892. for shift := uint(0); ; shift += 7 {
  3893. if iNdEx >= l {
  3894. return io.ErrUnexpectedEOF
  3895. }
  3896. b := data[iNdEx]
  3897. iNdEx++
  3898. m.WatchId |= (int64(b) & 0x7F) << shift
  3899. if b < 0x80 {
  3900. break
  3901. }
  3902. }
  3903. default:
  3904. var sizeOfWire int
  3905. for {
  3906. sizeOfWire++
  3907. wire >>= 7
  3908. if wire == 0 {
  3909. break
  3910. }
  3911. }
  3912. iNdEx -= sizeOfWire
  3913. skippy, err := skipRpc(data[iNdEx:])
  3914. if err != nil {
  3915. return err
  3916. }
  3917. if skippy < 0 {
  3918. return ErrInvalidLengthRpc
  3919. }
  3920. if (iNdEx + skippy) > l {
  3921. return io.ErrUnexpectedEOF
  3922. }
  3923. iNdEx += skippy
  3924. }
  3925. }
  3926. return nil
  3927. }
  3928. func (m *WatchResponse) Unmarshal(data []byte) error {
  3929. l := len(data)
  3930. iNdEx := 0
  3931. for iNdEx < l {
  3932. var wire uint64
  3933. for shift := uint(0); ; shift += 7 {
  3934. if iNdEx >= l {
  3935. return io.ErrUnexpectedEOF
  3936. }
  3937. b := data[iNdEx]
  3938. iNdEx++
  3939. wire |= (uint64(b) & 0x7F) << shift
  3940. if b < 0x80 {
  3941. break
  3942. }
  3943. }
  3944. fieldNum := int32(wire >> 3)
  3945. wireType := int(wire & 0x7)
  3946. switch fieldNum {
  3947. case 1:
  3948. if wireType != 2 {
  3949. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  3950. }
  3951. var msglen int
  3952. for shift := uint(0); ; shift += 7 {
  3953. if iNdEx >= l {
  3954. return io.ErrUnexpectedEOF
  3955. }
  3956. b := data[iNdEx]
  3957. iNdEx++
  3958. msglen |= (int(b) & 0x7F) << shift
  3959. if b < 0x80 {
  3960. break
  3961. }
  3962. }
  3963. if msglen < 0 {
  3964. return ErrInvalidLengthRpc
  3965. }
  3966. postIndex := iNdEx + msglen
  3967. if postIndex > l {
  3968. return io.ErrUnexpectedEOF
  3969. }
  3970. if m.Header == nil {
  3971. m.Header = &ResponseHeader{}
  3972. }
  3973. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3974. return err
  3975. }
  3976. iNdEx = postIndex
  3977. case 2:
  3978. if wireType != 0 {
  3979. return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType)
  3980. }
  3981. m.WatchId = 0
  3982. for shift := uint(0); ; shift += 7 {
  3983. if iNdEx >= l {
  3984. return io.ErrUnexpectedEOF
  3985. }
  3986. b := data[iNdEx]
  3987. iNdEx++
  3988. m.WatchId |= (int64(b) & 0x7F) << shift
  3989. if b < 0x80 {
  3990. break
  3991. }
  3992. }
  3993. case 3:
  3994. if wireType != 0 {
  3995. return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType)
  3996. }
  3997. var v int
  3998. for shift := uint(0); ; shift += 7 {
  3999. if iNdEx >= l {
  4000. return io.ErrUnexpectedEOF
  4001. }
  4002. b := data[iNdEx]
  4003. iNdEx++
  4004. v |= (int(b) & 0x7F) << shift
  4005. if b < 0x80 {
  4006. break
  4007. }
  4008. }
  4009. m.Created = bool(v != 0)
  4010. case 4:
  4011. if wireType != 0 {
  4012. return fmt.Errorf("proto: wrong wireType = %d for field Canceled", wireType)
  4013. }
  4014. var v int
  4015. for shift := uint(0); ; shift += 7 {
  4016. if iNdEx >= l {
  4017. return io.ErrUnexpectedEOF
  4018. }
  4019. b := data[iNdEx]
  4020. iNdEx++
  4021. v |= (int(b) & 0x7F) << shift
  4022. if b < 0x80 {
  4023. break
  4024. }
  4025. }
  4026. m.Canceled = bool(v != 0)
  4027. case 5:
  4028. if wireType != 0 {
  4029. return fmt.Errorf("proto: wrong wireType = %d for field Compacted", wireType)
  4030. }
  4031. var v int
  4032. for shift := uint(0); ; shift += 7 {
  4033. if iNdEx >= l {
  4034. return io.ErrUnexpectedEOF
  4035. }
  4036. b := data[iNdEx]
  4037. iNdEx++
  4038. v |= (int(b) & 0x7F) << shift
  4039. if b < 0x80 {
  4040. break
  4041. }
  4042. }
  4043. m.Compacted = bool(v != 0)
  4044. case 11:
  4045. if wireType != 2 {
  4046. return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType)
  4047. }
  4048. var msglen int
  4049. for shift := uint(0); ; shift += 7 {
  4050. if iNdEx >= l {
  4051. return io.ErrUnexpectedEOF
  4052. }
  4053. b := data[iNdEx]
  4054. iNdEx++
  4055. msglen |= (int(b) & 0x7F) << shift
  4056. if b < 0x80 {
  4057. break
  4058. }
  4059. }
  4060. if msglen < 0 {
  4061. return ErrInvalidLengthRpc
  4062. }
  4063. postIndex := iNdEx + msglen
  4064. if postIndex > l {
  4065. return io.ErrUnexpectedEOF
  4066. }
  4067. m.Events = append(m.Events, &storagepb.Event{})
  4068. if err := m.Events[len(m.Events)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  4069. return err
  4070. }
  4071. iNdEx = postIndex
  4072. default:
  4073. var sizeOfWire int
  4074. for {
  4075. sizeOfWire++
  4076. wire >>= 7
  4077. if wire == 0 {
  4078. break
  4079. }
  4080. }
  4081. iNdEx -= sizeOfWire
  4082. skippy, err := skipRpc(data[iNdEx:])
  4083. if err != nil {
  4084. return err
  4085. }
  4086. if skippy < 0 {
  4087. return ErrInvalidLengthRpc
  4088. }
  4089. if (iNdEx + skippy) > l {
  4090. return io.ErrUnexpectedEOF
  4091. }
  4092. iNdEx += skippy
  4093. }
  4094. }
  4095. return nil
  4096. }
  4097. func (m *LeaseCreateRequest) Unmarshal(data []byte) error {
  4098. l := len(data)
  4099. iNdEx := 0
  4100. for iNdEx < l {
  4101. var wire uint64
  4102. for shift := uint(0); ; shift += 7 {
  4103. if iNdEx >= l {
  4104. return io.ErrUnexpectedEOF
  4105. }
  4106. b := data[iNdEx]
  4107. iNdEx++
  4108. wire |= (uint64(b) & 0x7F) << shift
  4109. if b < 0x80 {
  4110. break
  4111. }
  4112. }
  4113. fieldNum := int32(wire >> 3)
  4114. wireType := int(wire & 0x7)
  4115. switch fieldNum {
  4116. case 1:
  4117. if wireType != 0 {
  4118. return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType)
  4119. }
  4120. m.Ttl = 0
  4121. for shift := uint(0); ; shift += 7 {
  4122. if iNdEx >= l {
  4123. return io.ErrUnexpectedEOF
  4124. }
  4125. b := data[iNdEx]
  4126. iNdEx++
  4127. m.Ttl |= (int64(b) & 0x7F) << shift
  4128. if b < 0x80 {
  4129. break
  4130. }
  4131. }
  4132. default:
  4133. var sizeOfWire int
  4134. for {
  4135. sizeOfWire++
  4136. wire >>= 7
  4137. if wire == 0 {
  4138. break
  4139. }
  4140. }
  4141. iNdEx -= sizeOfWire
  4142. skippy, err := skipRpc(data[iNdEx:])
  4143. if err != nil {
  4144. return err
  4145. }
  4146. if skippy < 0 {
  4147. return ErrInvalidLengthRpc
  4148. }
  4149. if (iNdEx + skippy) > l {
  4150. return io.ErrUnexpectedEOF
  4151. }
  4152. iNdEx += skippy
  4153. }
  4154. }
  4155. return nil
  4156. }
  4157. func (m *LeaseCreateResponse) Unmarshal(data []byte) error {
  4158. l := len(data)
  4159. iNdEx := 0
  4160. for iNdEx < l {
  4161. var wire uint64
  4162. for shift := uint(0); ; shift += 7 {
  4163. if iNdEx >= l {
  4164. return io.ErrUnexpectedEOF
  4165. }
  4166. b := data[iNdEx]
  4167. iNdEx++
  4168. wire |= (uint64(b) & 0x7F) << shift
  4169. if b < 0x80 {
  4170. break
  4171. }
  4172. }
  4173. fieldNum := int32(wire >> 3)
  4174. wireType := int(wire & 0x7)
  4175. switch fieldNum {
  4176. case 1:
  4177. if wireType != 2 {
  4178. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  4179. }
  4180. var msglen int
  4181. for shift := uint(0); ; shift += 7 {
  4182. if iNdEx >= l {
  4183. return io.ErrUnexpectedEOF
  4184. }
  4185. b := data[iNdEx]
  4186. iNdEx++
  4187. msglen |= (int(b) & 0x7F) << shift
  4188. if b < 0x80 {
  4189. break
  4190. }
  4191. }
  4192. if msglen < 0 {
  4193. return ErrInvalidLengthRpc
  4194. }
  4195. postIndex := iNdEx + msglen
  4196. if postIndex > l {
  4197. return io.ErrUnexpectedEOF
  4198. }
  4199. if m.Header == nil {
  4200. m.Header = &ResponseHeader{}
  4201. }
  4202. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  4203. return err
  4204. }
  4205. iNdEx = postIndex
  4206. case 2:
  4207. if wireType != 0 {
  4208. return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
  4209. }
  4210. m.LeaseId = 0
  4211. for shift := uint(0); ; shift += 7 {
  4212. if iNdEx >= l {
  4213. return io.ErrUnexpectedEOF
  4214. }
  4215. b := data[iNdEx]
  4216. iNdEx++
  4217. m.LeaseId |= (int64(b) & 0x7F) << shift
  4218. if b < 0x80 {
  4219. break
  4220. }
  4221. }
  4222. case 3:
  4223. if wireType != 0 {
  4224. return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType)
  4225. }
  4226. m.Ttl = 0
  4227. for shift := uint(0); ; shift += 7 {
  4228. if iNdEx >= l {
  4229. return io.ErrUnexpectedEOF
  4230. }
  4231. b := data[iNdEx]
  4232. iNdEx++
  4233. m.Ttl |= (int64(b) & 0x7F) << shift
  4234. if b < 0x80 {
  4235. break
  4236. }
  4237. }
  4238. case 4:
  4239. if wireType != 2 {
  4240. return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType)
  4241. }
  4242. var stringLen uint64
  4243. for shift := uint(0); ; shift += 7 {
  4244. if iNdEx >= l {
  4245. return io.ErrUnexpectedEOF
  4246. }
  4247. b := data[iNdEx]
  4248. iNdEx++
  4249. stringLen |= (uint64(b) & 0x7F) << shift
  4250. if b < 0x80 {
  4251. break
  4252. }
  4253. }
  4254. intStringLen := int(stringLen)
  4255. if intStringLen < 0 {
  4256. return ErrInvalidLengthRpc
  4257. }
  4258. postIndex := iNdEx + intStringLen
  4259. if postIndex > l {
  4260. return io.ErrUnexpectedEOF
  4261. }
  4262. m.Error = string(data[iNdEx:postIndex])
  4263. iNdEx = postIndex
  4264. default:
  4265. var sizeOfWire int
  4266. for {
  4267. sizeOfWire++
  4268. wire >>= 7
  4269. if wire == 0 {
  4270. break
  4271. }
  4272. }
  4273. iNdEx -= sizeOfWire
  4274. skippy, err := skipRpc(data[iNdEx:])
  4275. if err != nil {
  4276. return err
  4277. }
  4278. if skippy < 0 {
  4279. return ErrInvalidLengthRpc
  4280. }
  4281. if (iNdEx + skippy) > l {
  4282. return io.ErrUnexpectedEOF
  4283. }
  4284. iNdEx += skippy
  4285. }
  4286. }
  4287. return nil
  4288. }
  4289. func (m *LeaseRevokeRequest) Unmarshal(data []byte) error {
  4290. l := len(data)
  4291. iNdEx := 0
  4292. for iNdEx < l {
  4293. var wire uint64
  4294. for shift := uint(0); ; shift += 7 {
  4295. if iNdEx >= l {
  4296. return io.ErrUnexpectedEOF
  4297. }
  4298. b := data[iNdEx]
  4299. iNdEx++
  4300. wire |= (uint64(b) & 0x7F) << shift
  4301. if b < 0x80 {
  4302. break
  4303. }
  4304. }
  4305. fieldNum := int32(wire >> 3)
  4306. wireType := int(wire & 0x7)
  4307. switch fieldNum {
  4308. case 1:
  4309. if wireType != 0 {
  4310. return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
  4311. }
  4312. m.LeaseId = 0
  4313. for shift := uint(0); ; shift += 7 {
  4314. if iNdEx >= l {
  4315. return io.ErrUnexpectedEOF
  4316. }
  4317. b := data[iNdEx]
  4318. iNdEx++
  4319. m.LeaseId |= (int64(b) & 0x7F) << shift
  4320. if b < 0x80 {
  4321. break
  4322. }
  4323. }
  4324. default:
  4325. var sizeOfWire int
  4326. for {
  4327. sizeOfWire++
  4328. wire >>= 7
  4329. if wire == 0 {
  4330. break
  4331. }
  4332. }
  4333. iNdEx -= sizeOfWire
  4334. skippy, err := skipRpc(data[iNdEx:])
  4335. if err != nil {
  4336. return err
  4337. }
  4338. if skippy < 0 {
  4339. return ErrInvalidLengthRpc
  4340. }
  4341. if (iNdEx + skippy) > l {
  4342. return io.ErrUnexpectedEOF
  4343. }
  4344. iNdEx += skippy
  4345. }
  4346. }
  4347. return nil
  4348. }
  4349. func (m *LeaseRevokeResponse) Unmarshal(data []byte) error {
  4350. l := len(data)
  4351. iNdEx := 0
  4352. for iNdEx < l {
  4353. var wire uint64
  4354. for shift := uint(0); ; shift += 7 {
  4355. if iNdEx >= l {
  4356. return io.ErrUnexpectedEOF
  4357. }
  4358. b := data[iNdEx]
  4359. iNdEx++
  4360. wire |= (uint64(b) & 0x7F) << shift
  4361. if b < 0x80 {
  4362. break
  4363. }
  4364. }
  4365. fieldNum := int32(wire >> 3)
  4366. wireType := int(wire & 0x7)
  4367. switch fieldNum {
  4368. case 1:
  4369. if wireType != 2 {
  4370. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  4371. }
  4372. var msglen int
  4373. for shift := uint(0); ; shift += 7 {
  4374. if iNdEx >= l {
  4375. return io.ErrUnexpectedEOF
  4376. }
  4377. b := data[iNdEx]
  4378. iNdEx++
  4379. msglen |= (int(b) & 0x7F) << shift
  4380. if b < 0x80 {
  4381. break
  4382. }
  4383. }
  4384. if msglen < 0 {
  4385. return ErrInvalidLengthRpc
  4386. }
  4387. postIndex := iNdEx + msglen
  4388. if postIndex > l {
  4389. return io.ErrUnexpectedEOF
  4390. }
  4391. if m.Header == nil {
  4392. m.Header = &ResponseHeader{}
  4393. }
  4394. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  4395. return err
  4396. }
  4397. iNdEx = postIndex
  4398. default:
  4399. var sizeOfWire int
  4400. for {
  4401. sizeOfWire++
  4402. wire >>= 7
  4403. if wire == 0 {
  4404. break
  4405. }
  4406. }
  4407. iNdEx -= sizeOfWire
  4408. skippy, err := skipRpc(data[iNdEx:])
  4409. if err != nil {
  4410. return err
  4411. }
  4412. if skippy < 0 {
  4413. return ErrInvalidLengthRpc
  4414. }
  4415. if (iNdEx + skippy) > l {
  4416. return io.ErrUnexpectedEOF
  4417. }
  4418. iNdEx += skippy
  4419. }
  4420. }
  4421. return nil
  4422. }
  4423. func (m *LeaseKeepAliveRequest) Unmarshal(data []byte) error {
  4424. l := len(data)
  4425. iNdEx := 0
  4426. for iNdEx < l {
  4427. var wire uint64
  4428. for shift := uint(0); ; shift += 7 {
  4429. if iNdEx >= l {
  4430. return io.ErrUnexpectedEOF
  4431. }
  4432. b := data[iNdEx]
  4433. iNdEx++
  4434. wire |= (uint64(b) & 0x7F) << shift
  4435. if b < 0x80 {
  4436. break
  4437. }
  4438. }
  4439. fieldNum := int32(wire >> 3)
  4440. wireType := int(wire & 0x7)
  4441. switch fieldNum {
  4442. case 1:
  4443. if wireType != 0 {
  4444. return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
  4445. }
  4446. m.LeaseId = 0
  4447. for shift := uint(0); ; shift += 7 {
  4448. if iNdEx >= l {
  4449. return io.ErrUnexpectedEOF
  4450. }
  4451. b := data[iNdEx]
  4452. iNdEx++
  4453. m.LeaseId |= (int64(b) & 0x7F) << shift
  4454. if b < 0x80 {
  4455. break
  4456. }
  4457. }
  4458. default:
  4459. var sizeOfWire int
  4460. for {
  4461. sizeOfWire++
  4462. wire >>= 7
  4463. if wire == 0 {
  4464. break
  4465. }
  4466. }
  4467. iNdEx -= sizeOfWire
  4468. skippy, err := skipRpc(data[iNdEx:])
  4469. if err != nil {
  4470. return err
  4471. }
  4472. if skippy < 0 {
  4473. return ErrInvalidLengthRpc
  4474. }
  4475. if (iNdEx + skippy) > l {
  4476. return io.ErrUnexpectedEOF
  4477. }
  4478. iNdEx += skippy
  4479. }
  4480. }
  4481. return nil
  4482. }
  4483. func (m *LeaseKeepAliveResponse) Unmarshal(data []byte) error {
  4484. l := len(data)
  4485. iNdEx := 0
  4486. for iNdEx < l {
  4487. var wire uint64
  4488. for shift := uint(0); ; shift += 7 {
  4489. if iNdEx >= l {
  4490. return io.ErrUnexpectedEOF
  4491. }
  4492. b := data[iNdEx]
  4493. iNdEx++
  4494. wire |= (uint64(b) & 0x7F) << shift
  4495. if b < 0x80 {
  4496. break
  4497. }
  4498. }
  4499. fieldNum := int32(wire >> 3)
  4500. wireType := int(wire & 0x7)
  4501. switch fieldNum {
  4502. case 1:
  4503. if wireType != 2 {
  4504. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  4505. }
  4506. var msglen int
  4507. for shift := uint(0); ; shift += 7 {
  4508. if iNdEx >= l {
  4509. return io.ErrUnexpectedEOF
  4510. }
  4511. b := data[iNdEx]
  4512. iNdEx++
  4513. msglen |= (int(b) & 0x7F) << shift
  4514. if b < 0x80 {
  4515. break
  4516. }
  4517. }
  4518. if msglen < 0 {
  4519. return ErrInvalidLengthRpc
  4520. }
  4521. postIndex := iNdEx + msglen
  4522. if postIndex > l {
  4523. return io.ErrUnexpectedEOF
  4524. }
  4525. if m.Header == nil {
  4526. m.Header = &ResponseHeader{}
  4527. }
  4528. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  4529. return err
  4530. }
  4531. iNdEx = postIndex
  4532. case 2:
  4533. if wireType != 0 {
  4534. return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
  4535. }
  4536. m.LeaseId = 0
  4537. for shift := uint(0); ; shift += 7 {
  4538. if iNdEx >= l {
  4539. return io.ErrUnexpectedEOF
  4540. }
  4541. b := data[iNdEx]
  4542. iNdEx++
  4543. m.LeaseId |= (int64(b) & 0x7F) << shift
  4544. if b < 0x80 {
  4545. break
  4546. }
  4547. }
  4548. case 3:
  4549. if wireType != 0 {
  4550. return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType)
  4551. }
  4552. m.Ttl = 0
  4553. for shift := uint(0); ; shift += 7 {
  4554. if iNdEx >= l {
  4555. return io.ErrUnexpectedEOF
  4556. }
  4557. b := data[iNdEx]
  4558. iNdEx++
  4559. m.Ttl |= (int64(b) & 0x7F) << shift
  4560. if b < 0x80 {
  4561. break
  4562. }
  4563. }
  4564. default:
  4565. var sizeOfWire int
  4566. for {
  4567. sizeOfWire++
  4568. wire >>= 7
  4569. if wire == 0 {
  4570. break
  4571. }
  4572. }
  4573. iNdEx -= sizeOfWire
  4574. skippy, err := skipRpc(data[iNdEx:])
  4575. if err != nil {
  4576. return err
  4577. }
  4578. if skippy < 0 {
  4579. return ErrInvalidLengthRpc
  4580. }
  4581. if (iNdEx + skippy) > l {
  4582. return io.ErrUnexpectedEOF
  4583. }
  4584. iNdEx += skippy
  4585. }
  4586. }
  4587. return nil
  4588. }
  4589. func skipRpc(data []byte) (n int, err error) {
  4590. l := len(data)
  4591. iNdEx := 0
  4592. for iNdEx < l {
  4593. var wire uint64
  4594. for shift := uint(0); ; shift += 7 {
  4595. if iNdEx >= l {
  4596. return 0, io.ErrUnexpectedEOF
  4597. }
  4598. b := data[iNdEx]
  4599. iNdEx++
  4600. wire |= (uint64(b) & 0x7F) << shift
  4601. if b < 0x80 {
  4602. break
  4603. }
  4604. }
  4605. wireType := int(wire & 0x7)
  4606. switch wireType {
  4607. case 0:
  4608. for {
  4609. if iNdEx >= l {
  4610. return 0, io.ErrUnexpectedEOF
  4611. }
  4612. iNdEx++
  4613. if data[iNdEx-1] < 0x80 {
  4614. break
  4615. }
  4616. }
  4617. return iNdEx, nil
  4618. case 1:
  4619. iNdEx += 8
  4620. return iNdEx, nil
  4621. case 2:
  4622. var length int
  4623. for shift := uint(0); ; shift += 7 {
  4624. if iNdEx >= l {
  4625. return 0, io.ErrUnexpectedEOF
  4626. }
  4627. b := data[iNdEx]
  4628. iNdEx++
  4629. length |= (int(b) & 0x7F) << shift
  4630. if b < 0x80 {
  4631. break
  4632. }
  4633. }
  4634. iNdEx += length
  4635. if length < 0 {
  4636. return 0, ErrInvalidLengthRpc
  4637. }
  4638. return iNdEx, nil
  4639. case 3:
  4640. for {
  4641. var innerWire uint64
  4642. var start int = iNdEx
  4643. for shift := uint(0); ; shift += 7 {
  4644. if iNdEx >= l {
  4645. return 0, io.ErrUnexpectedEOF
  4646. }
  4647. b := data[iNdEx]
  4648. iNdEx++
  4649. innerWire |= (uint64(b) & 0x7F) << shift
  4650. if b < 0x80 {
  4651. break
  4652. }
  4653. }
  4654. innerWireType := int(innerWire & 0x7)
  4655. if innerWireType == 4 {
  4656. break
  4657. }
  4658. next, err := skipRpc(data[start:])
  4659. if err != nil {
  4660. return 0, err
  4661. }
  4662. iNdEx = start + next
  4663. }
  4664. return iNdEx, nil
  4665. case 4:
  4666. return iNdEx, nil
  4667. case 5:
  4668. iNdEx += 4
  4669. return iNdEx, nil
  4670. default:
  4671. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  4672. }
  4673. }
  4674. panic("unreachable")
  4675. }
  4676. var (
  4677. ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling")
  4678. )