rpc.pb.go 98 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508
  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. // the key to be watched
  300. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  301. // the prefix to be watched.
  302. Prefix []byte `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
  303. // start_revision is an optional revision (including) to watch from. No start_revision is "now".
  304. StartRevision int64 `protobuf:"varint,3,opt,name=start_revision,proto3" json:"start_revision,omitempty"`
  305. }
  306. func (m *WatchRequest) Reset() { *m = WatchRequest{} }
  307. func (m *WatchRequest) String() string { return proto.CompactTextString(m) }
  308. func (*WatchRequest) ProtoMessage() {}
  309. type WatchResponse struct {
  310. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  311. Events []*storagepb.Event `protobuf:"bytes,2,rep,name=events" json:"events,omitempty"`
  312. }
  313. func (m *WatchResponse) Reset() { *m = WatchResponse{} }
  314. func (m *WatchResponse) String() string { return proto.CompactTextString(m) }
  315. func (*WatchResponse) ProtoMessage() {}
  316. func (m *WatchResponse) GetHeader() *ResponseHeader {
  317. if m != nil {
  318. return m.Header
  319. }
  320. return nil
  321. }
  322. func (m *WatchResponse) GetEvents() []*storagepb.Event {
  323. if m != nil {
  324. return m.Events
  325. }
  326. return nil
  327. }
  328. type LeaseCreateRequest struct {
  329. // advisory ttl in seconds
  330. Ttl int64 `protobuf:"varint,1,opt,name=ttl,proto3" json:"ttl,omitempty"`
  331. }
  332. func (m *LeaseCreateRequest) Reset() { *m = LeaseCreateRequest{} }
  333. func (m *LeaseCreateRequest) String() string { return proto.CompactTextString(m) }
  334. func (*LeaseCreateRequest) ProtoMessage() {}
  335. type LeaseCreateResponse struct {
  336. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  337. LeaseId int64 `protobuf:"varint,2,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
  338. // server decided ttl in second
  339. Ttl int64 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
  340. Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
  341. }
  342. func (m *LeaseCreateResponse) Reset() { *m = LeaseCreateResponse{} }
  343. func (m *LeaseCreateResponse) String() string { return proto.CompactTextString(m) }
  344. func (*LeaseCreateResponse) ProtoMessage() {}
  345. func (m *LeaseCreateResponse) GetHeader() *ResponseHeader {
  346. if m != nil {
  347. return m.Header
  348. }
  349. return nil
  350. }
  351. type LeaseRevokeRequest struct {
  352. LeaseId int64 `protobuf:"varint,1,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
  353. }
  354. func (m *LeaseRevokeRequest) Reset() { *m = LeaseRevokeRequest{} }
  355. func (m *LeaseRevokeRequest) String() string { return proto.CompactTextString(m) }
  356. func (*LeaseRevokeRequest) ProtoMessage() {}
  357. type LeaseRevokeResponse struct {
  358. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  359. }
  360. func (m *LeaseRevokeResponse) Reset() { *m = LeaseRevokeResponse{} }
  361. func (m *LeaseRevokeResponse) String() string { return proto.CompactTextString(m) }
  362. func (*LeaseRevokeResponse) ProtoMessage() {}
  363. func (m *LeaseRevokeResponse) GetHeader() *ResponseHeader {
  364. if m != nil {
  365. return m.Header
  366. }
  367. return nil
  368. }
  369. type LeaseKeepAliveRequest struct {
  370. LeaseId int64 `protobuf:"varint,1,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
  371. }
  372. func (m *LeaseKeepAliveRequest) Reset() { *m = LeaseKeepAliveRequest{} }
  373. func (m *LeaseKeepAliveRequest) String() string { return proto.CompactTextString(m) }
  374. func (*LeaseKeepAliveRequest) ProtoMessage() {}
  375. type LeaseKeepAliveResponse struct {
  376. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  377. LeaseId int64 `protobuf:"varint,2,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
  378. Ttl int64 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
  379. }
  380. func (m *LeaseKeepAliveResponse) Reset() { *m = LeaseKeepAliveResponse{} }
  381. func (m *LeaseKeepAliveResponse) String() string { return proto.CompactTextString(m) }
  382. func (*LeaseKeepAliveResponse) ProtoMessage() {}
  383. func (m *LeaseKeepAliveResponse) GetHeader() *ResponseHeader {
  384. if m != nil {
  385. return m.Header
  386. }
  387. return nil
  388. }
  389. func init() {
  390. proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value)
  391. proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value)
  392. }
  393. // Reference imports to suppress errors if they are not otherwise used.
  394. var _ context.Context
  395. var _ grpc.ClientConn
  396. // Client API for KV service
  397. type KVClient interface {
  398. // Range gets the keys in the range from the store.
  399. Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error)
  400. // Put puts the given key into the store.
  401. // A put request increases the revision of the store,
  402. // and generates one event in the event history.
  403. Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
  404. // Delete deletes the given range from the store.
  405. // A delete request increase the revision of the store,
  406. // and generates one event in the event history.
  407. DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error)
  408. // Txn processes all the requests in one transaction.
  409. // A txn request increases the revision of the store,
  410. // and generates events with the same revision in the event history.
  411. // It is not allowed to modify the same key several times within one txn.
  412. Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error)
  413. // Compact compacts the event history in etcd. User should compact the
  414. // event history periodically, or it will grow infinitely.
  415. Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error)
  416. }
  417. type kVClient struct {
  418. cc *grpc.ClientConn
  419. }
  420. func NewKVClient(cc *grpc.ClientConn) KVClient {
  421. return &kVClient{cc}
  422. }
  423. func (c *kVClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) {
  424. out := new(RangeResponse)
  425. err := grpc.Invoke(ctx, "/etcdserverpb.KV/Range", in, out, c.cc, opts...)
  426. if err != nil {
  427. return nil, err
  428. }
  429. return out, nil
  430. }
  431. func (c *kVClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) {
  432. out := new(PutResponse)
  433. err := grpc.Invoke(ctx, "/etcdserverpb.KV/Put", in, out, c.cc, opts...)
  434. if err != nil {
  435. return nil, err
  436. }
  437. return out, nil
  438. }
  439. func (c *kVClient) DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) {
  440. out := new(DeleteRangeResponse)
  441. err := grpc.Invoke(ctx, "/etcdserverpb.KV/DeleteRange", in, out, c.cc, opts...)
  442. if err != nil {
  443. return nil, err
  444. }
  445. return out, nil
  446. }
  447. func (c *kVClient) Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) {
  448. out := new(TxnResponse)
  449. err := grpc.Invoke(ctx, "/etcdserverpb.KV/Txn", in, out, c.cc, opts...)
  450. if err != nil {
  451. return nil, err
  452. }
  453. return out, nil
  454. }
  455. func (c *kVClient) Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) {
  456. out := new(CompactionResponse)
  457. err := grpc.Invoke(ctx, "/etcdserverpb.KV/Compact", in, out, c.cc, opts...)
  458. if err != nil {
  459. return nil, err
  460. }
  461. return out, nil
  462. }
  463. // Server API for KV service
  464. type KVServer interface {
  465. // Range gets the keys in the range from the store.
  466. Range(context.Context, *RangeRequest) (*RangeResponse, error)
  467. // Put puts the given key into the store.
  468. // A put request increases the revision of the store,
  469. // and generates one event in the event history.
  470. Put(context.Context, *PutRequest) (*PutResponse, error)
  471. // Delete deletes the given range from the store.
  472. // A delete request increase the revision of the store,
  473. // and generates one event in the event history.
  474. DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error)
  475. // Txn processes all the requests in one transaction.
  476. // A txn request increases the revision of the store,
  477. // and generates events with the same revision in the event history.
  478. // It is not allowed to modify the same key several times within one txn.
  479. Txn(context.Context, *TxnRequest) (*TxnResponse, error)
  480. // Compact compacts the event history in etcd. User should compact the
  481. // event history periodically, or it will grow infinitely.
  482. Compact(context.Context, *CompactionRequest) (*CompactionResponse, error)
  483. }
  484. func RegisterKVServer(s *grpc.Server, srv KVServer) {
  485. s.RegisterService(&_KV_serviceDesc, srv)
  486. }
  487. func _KV_Range_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  488. in := new(RangeRequest)
  489. if err := codec.Unmarshal(buf, in); err != nil {
  490. return nil, err
  491. }
  492. out, err := srv.(KVServer).Range(ctx, in)
  493. if err != nil {
  494. return nil, err
  495. }
  496. return out, nil
  497. }
  498. func _KV_Put_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  499. in := new(PutRequest)
  500. if err := codec.Unmarshal(buf, in); err != nil {
  501. return nil, err
  502. }
  503. out, err := srv.(KVServer).Put(ctx, in)
  504. if err != nil {
  505. return nil, err
  506. }
  507. return out, nil
  508. }
  509. func _KV_DeleteRange_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  510. in := new(DeleteRangeRequest)
  511. if err := codec.Unmarshal(buf, in); err != nil {
  512. return nil, err
  513. }
  514. out, err := srv.(KVServer).DeleteRange(ctx, in)
  515. if err != nil {
  516. return nil, err
  517. }
  518. return out, nil
  519. }
  520. func _KV_Txn_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  521. in := new(TxnRequest)
  522. if err := codec.Unmarshal(buf, in); err != nil {
  523. return nil, err
  524. }
  525. out, err := srv.(KVServer).Txn(ctx, in)
  526. if err != nil {
  527. return nil, err
  528. }
  529. return out, nil
  530. }
  531. func _KV_Compact_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  532. in := new(CompactionRequest)
  533. if err := codec.Unmarshal(buf, in); err != nil {
  534. return nil, err
  535. }
  536. out, err := srv.(KVServer).Compact(ctx, in)
  537. if err != nil {
  538. return nil, err
  539. }
  540. return out, nil
  541. }
  542. var _KV_serviceDesc = grpc.ServiceDesc{
  543. ServiceName: "etcdserverpb.KV",
  544. HandlerType: (*KVServer)(nil),
  545. Methods: []grpc.MethodDesc{
  546. {
  547. MethodName: "Range",
  548. Handler: _KV_Range_Handler,
  549. },
  550. {
  551. MethodName: "Put",
  552. Handler: _KV_Put_Handler,
  553. },
  554. {
  555. MethodName: "DeleteRange",
  556. Handler: _KV_DeleteRange_Handler,
  557. },
  558. {
  559. MethodName: "Txn",
  560. Handler: _KV_Txn_Handler,
  561. },
  562. {
  563. MethodName: "Compact",
  564. Handler: _KV_Compact_Handler,
  565. },
  566. },
  567. Streams: []grpc.StreamDesc{},
  568. }
  569. // Client API for Watch service
  570. type WatchClient interface {
  571. // Watch watches the events happening or happened. Both input and output
  572. // are stream. One watch rpc can watch for multiple keys or prefixs and
  573. // get a stream of events. The whole events history can be watched unless
  574. // compacted.
  575. Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error)
  576. }
  577. type watchClient struct {
  578. cc *grpc.ClientConn
  579. }
  580. func NewWatchClient(cc *grpc.ClientConn) WatchClient {
  581. return &watchClient{cc}
  582. }
  583. func (c *watchClient) Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) {
  584. stream, err := grpc.NewClientStream(ctx, &_Watch_serviceDesc.Streams[0], c.cc, "/etcdserverpb.watch/Watch", opts...)
  585. if err != nil {
  586. return nil, err
  587. }
  588. x := &watchWatchClient{stream}
  589. return x, nil
  590. }
  591. type Watch_WatchClient interface {
  592. Send(*WatchRequest) error
  593. Recv() (*WatchResponse, error)
  594. grpc.ClientStream
  595. }
  596. type watchWatchClient struct {
  597. grpc.ClientStream
  598. }
  599. func (x *watchWatchClient) Send(m *WatchRequest) error {
  600. return x.ClientStream.SendMsg(m)
  601. }
  602. func (x *watchWatchClient) Recv() (*WatchResponse, error) {
  603. m := new(WatchResponse)
  604. if err := x.ClientStream.RecvMsg(m); err != nil {
  605. return nil, err
  606. }
  607. return m, nil
  608. }
  609. // Server API for Watch service
  610. type WatchServer interface {
  611. // Watch watches the events happening or happened. Both input and output
  612. // are stream. One watch rpc can watch for multiple keys or prefixs and
  613. // get a stream of events. The whole events history can be watched unless
  614. // compacted.
  615. Watch(Watch_WatchServer) error
  616. }
  617. func RegisterWatchServer(s *grpc.Server, srv WatchServer) {
  618. s.RegisterService(&_Watch_serviceDesc, srv)
  619. }
  620. func _Watch_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
  621. return srv.(WatchServer).Watch(&watchWatchServer{stream})
  622. }
  623. type Watch_WatchServer interface {
  624. Send(*WatchResponse) error
  625. Recv() (*WatchRequest, error)
  626. grpc.ServerStream
  627. }
  628. type watchWatchServer struct {
  629. grpc.ServerStream
  630. }
  631. func (x *watchWatchServer) Send(m *WatchResponse) error {
  632. return x.ServerStream.SendMsg(m)
  633. }
  634. func (x *watchWatchServer) Recv() (*WatchRequest, error) {
  635. m := new(WatchRequest)
  636. if err := x.ServerStream.RecvMsg(m); err != nil {
  637. return nil, err
  638. }
  639. return m, nil
  640. }
  641. var _Watch_serviceDesc = grpc.ServiceDesc{
  642. ServiceName: "etcdserverpb.watch",
  643. HandlerType: (*WatchServer)(nil),
  644. Methods: []grpc.MethodDesc{},
  645. Streams: []grpc.StreamDesc{
  646. {
  647. StreamName: "Watch",
  648. Handler: _Watch_Watch_Handler,
  649. ServerStreams: true,
  650. ClientStreams: true,
  651. },
  652. },
  653. }
  654. // Client API for Lease service
  655. type LeaseClient interface {
  656. // LeaseCreate creates a lease. A lease has a TTL. The lease will expire if the
  657. // server does not receive a keepAlive within TTL from the lease holder.
  658. // All keys attached to the lease will be expired and deleted if the lease expires.
  659. // The key expiration generates an event in event history.
  660. LeaseCreate(ctx context.Context, in *LeaseCreateRequest, opts ...grpc.CallOption) (*LeaseCreateResponse, error)
  661. // LeaseRevoke revokes a lease. All the key attached to the lease will be expired and deleted.
  662. LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error)
  663. // KeepAlive keeps the lease alive.
  664. LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error)
  665. }
  666. type leaseClient struct {
  667. cc *grpc.ClientConn
  668. }
  669. func NewLeaseClient(cc *grpc.ClientConn) LeaseClient {
  670. return &leaseClient{cc}
  671. }
  672. func (c *leaseClient) LeaseCreate(ctx context.Context, in *LeaseCreateRequest, opts ...grpc.CallOption) (*LeaseCreateResponse, error) {
  673. out := new(LeaseCreateResponse)
  674. err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseCreate", in, out, c.cc, opts...)
  675. if err != nil {
  676. return nil, err
  677. }
  678. return out, nil
  679. }
  680. func (c *leaseClient) LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error) {
  681. out := new(LeaseRevokeResponse)
  682. err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseRevoke", in, out, c.cc, opts...)
  683. if err != nil {
  684. return nil, err
  685. }
  686. return out, nil
  687. }
  688. func (c *leaseClient) LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error) {
  689. stream, err := grpc.NewClientStream(ctx, &_Lease_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Lease/LeaseKeepAlive", opts...)
  690. if err != nil {
  691. return nil, err
  692. }
  693. x := &leaseLeaseKeepAliveClient{stream}
  694. return x, nil
  695. }
  696. type Lease_LeaseKeepAliveClient interface {
  697. Send(*LeaseKeepAliveRequest) error
  698. Recv() (*LeaseKeepAliveResponse, error)
  699. grpc.ClientStream
  700. }
  701. type leaseLeaseKeepAliveClient struct {
  702. grpc.ClientStream
  703. }
  704. func (x *leaseLeaseKeepAliveClient) Send(m *LeaseKeepAliveRequest) error {
  705. return x.ClientStream.SendMsg(m)
  706. }
  707. func (x *leaseLeaseKeepAliveClient) Recv() (*LeaseKeepAliveResponse, error) {
  708. m := new(LeaseKeepAliveResponse)
  709. if err := x.ClientStream.RecvMsg(m); err != nil {
  710. return nil, err
  711. }
  712. return m, nil
  713. }
  714. // Server API for Lease service
  715. type LeaseServer interface {
  716. // LeaseCreate creates a lease. A lease has a TTL. The lease will expire if the
  717. // server does not receive a keepAlive within TTL from the lease holder.
  718. // All keys attached to the lease will be expired and deleted if the lease expires.
  719. // The key expiration generates an event in event history.
  720. LeaseCreate(context.Context, *LeaseCreateRequest) (*LeaseCreateResponse, error)
  721. // LeaseRevoke revokes a lease. All the key attached to the lease will be expired and deleted.
  722. LeaseRevoke(context.Context, *LeaseRevokeRequest) (*LeaseRevokeResponse, error)
  723. // KeepAlive keeps the lease alive.
  724. LeaseKeepAlive(Lease_LeaseKeepAliveServer) error
  725. }
  726. func RegisterLeaseServer(s *grpc.Server, srv LeaseServer) {
  727. s.RegisterService(&_Lease_serviceDesc, srv)
  728. }
  729. func _Lease_LeaseCreate_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  730. in := new(LeaseCreateRequest)
  731. if err := codec.Unmarshal(buf, in); err != nil {
  732. return nil, err
  733. }
  734. out, err := srv.(LeaseServer).LeaseCreate(ctx, in)
  735. if err != nil {
  736. return nil, err
  737. }
  738. return out, nil
  739. }
  740. func _Lease_LeaseRevoke_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  741. in := new(LeaseRevokeRequest)
  742. if err := codec.Unmarshal(buf, in); err != nil {
  743. return nil, err
  744. }
  745. out, err := srv.(LeaseServer).LeaseRevoke(ctx, in)
  746. if err != nil {
  747. return nil, err
  748. }
  749. return out, nil
  750. }
  751. func _Lease_LeaseKeepAlive_Handler(srv interface{}, stream grpc.ServerStream) error {
  752. return srv.(LeaseServer).LeaseKeepAlive(&leaseLeaseKeepAliveServer{stream})
  753. }
  754. type Lease_LeaseKeepAliveServer interface {
  755. Send(*LeaseKeepAliveResponse) error
  756. Recv() (*LeaseKeepAliveRequest, error)
  757. grpc.ServerStream
  758. }
  759. type leaseLeaseKeepAliveServer struct {
  760. grpc.ServerStream
  761. }
  762. func (x *leaseLeaseKeepAliveServer) Send(m *LeaseKeepAliveResponse) error {
  763. return x.ServerStream.SendMsg(m)
  764. }
  765. func (x *leaseLeaseKeepAliveServer) Recv() (*LeaseKeepAliveRequest, error) {
  766. m := new(LeaseKeepAliveRequest)
  767. if err := x.ServerStream.RecvMsg(m); err != nil {
  768. return nil, err
  769. }
  770. return m, nil
  771. }
  772. var _Lease_serviceDesc = grpc.ServiceDesc{
  773. ServiceName: "etcdserverpb.Lease",
  774. HandlerType: (*LeaseServer)(nil),
  775. Methods: []grpc.MethodDesc{
  776. {
  777. MethodName: "LeaseCreate",
  778. Handler: _Lease_LeaseCreate_Handler,
  779. },
  780. {
  781. MethodName: "LeaseRevoke",
  782. Handler: _Lease_LeaseRevoke_Handler,
  783. },
  784. },
  785. Streams: []grpc.StreamDesc{
  786. {
  787. StreamName: "LeaseKeepAlive",
  788. Handler: _Lease_LeaseKeepAlive_Handler,
  789. ServerStreams: true,
  790. ClientStreams: true,
  791. },
  792. },
  793. }
  794. func (m *ResponseHeader) Marshal() (data []byte, err error) {
  795. size := m.Size()
  796. data = make([]byte, size)
  797. n, err := m.MarshalTo(data)
  798. if err != nil {
  799. return nil, err
  800. }
  801. return data[:n], nil
  802. }
  803. func (m *ResponseHeader) MarshalTo(data []byte) (int, error) {
  804. var i int
  805. _ = i
  806. var l int
  807. _ = l
  808. if m.ClusterId != 0 {
  809. data[i] = 0x8
  810. i++
  811. i = encodeVarintRpc(data, i, uint64(m.ClusterId))
  812. }
  813. if m.MemberId != 0 {
  814. data[i] = 0x10
  815. i++
  816. i = encodeVarintRpc(data, i, uint64(m.MemberId))
  817. }
  818. if m.Revision != 0 {
  819. data[i] = 0x18
  820. i++
  821. i = encodeVarintRpc(data, i, uint64(m.Revision))
  822. }
  823. if m.RaftTerm != 0 {
  824. data[i] = 0x20
  825. i++
  826. i = encodeVarintRpc(data, i, uint64(m.RaftTerm))
  827. }
  828. return i, nil
  829. }
  830. func (m *RangeRequest) Marshal() (data []byte, err error) {
  831. size := m.Size()
  832. data = make([]byte, size)
  833. n, err := m.MarshalTo(data)
  834. if err != nil {
  835. return nil, err
  836. }
  837. return data[:n], nil
  838. }
  839. func (m *RangeRequest) MarshalTo(data []byte) (int, error) {
  840. var i int
  841. _ = i
  842. var l int
  843. _ = l
  844. if m.Key != nil {
  845. if len(m.Key) > 0 {
  846. data[i] = 0xa
  847. i++
  848. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  849. i += copy(data[i:], m.Key)
  850. }
  851. }
  852. if m.RangeEnd != nil {
  853. if len(m.RangeEnd) > 0 {
  854. data[i] = 0x12
  855. i++
  856. i = encodeVarintRpc(data, i, uint64(len(m.RangeEnd)))
  857. i += copy(data[i:], m.RangeEnd)
  858. }
  859. }
  860. if m.Limit != 0 {
  861. data[i] = 0x18
  862. i++
  863. i = encodeVarintRpc(data, i, uint64(m.Limit))
  864. }
  865. if m.Revision != 0 {
  866. data[i] = 0x20
  867. i++
  868. i = encodeVarintRpc(data, i, uint64(m.Revision))
  869. }
  870. return i, nil
  871. }
  872. func (m *RangeResponse) Marshal() (data []byte, err error) {
  873. size := m.Size()
  874. data = make([]byte, size)
  875. n, err := m.MarshalTo(data)
  876. if err != nil {
  877. return nil, err
  878. }
  879. return data[:n], nil
  880. }
  881. func (m *RangeResponse) MarshalTo(data []byte) (int, error) {
  882. var i int
  883. _ = i
  884. var l int
  885. _ = l
  886. if m.Header != nil {
  887. data[i] = 0xa
  888. i++
  889. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  890. n1, err := m.Header.MarshalTo(data[i:])
  891. if err != nil {
  892. return 0, err
  893. }
  894. i += n1
  895. }
  896. if len(m.Kvs) > 0 {
  897. for _, msg := range m.Kvs {
  898. data[i] = 0x12
  899. i++
  900. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  901. n, err := msg.MarshalTo(data[i:])
  902. if err != nil {
  903. return 0, err
  904. }
  905. i += n
  906. }
  907. }
  908. if m.More {
  909. data[i] = 0x18
  910. i++
  911. if m.More {
  912. data[i] = 1
  913. } else {
  914. data[i] = 0
  915. }
  916. i++
  917. }
  918. return i, nil
  919. }
  920. func (m *PutRequest) Marshal() (data []byte, err error) {
  921. size := m.Size()
  922. data = make([]byte, size)
  923. n, err := m.MarshalTo(data)
  924. if err != nil {
  925. return nil, err
  926. }
  927. return data[:n], nil
  928. }
  929. func (m *PutRequest) MarshalTo(data []byte) (int, error) {
  930. var i int
  931. _ = i
  932. var l int
  933. _ = l
  934. if m.Key != nil {
  935. if len(m.Key) > 0 {
  936. data[i] = 0xa
  937. i++
  938. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  939. i += copy(data[i:], m.Key)
  940. }
  941. }
  942. if m.Value != nil {
  943. if len(m.Value) > 0 {
  944. data[i] = 0x12
  945. i++
  946. i = encodeVarintRpc(data, i, uint64(len(m.Value)))
  947. i += copy(data[i:], m.Value)
  948. }
  949. }
  950. if m.Lease != 0 {
  951. data[i] = 0x18
  952. i++
  953. i = encodeVarintRpc(data, i, uint64(m.Lease))
  954. }
  955. return i, nil
  956. }
  957. func (m *PutResponse) Marshal() (data []byte, err error) {
  958. size := m.Size()
  959. data = make([]byte, size)
  960. n, err := m.MarshalTo(data)
  961. if err != nil {
  962. return nil, err
  963. }
  964. return data[:n], nil
  965. }
  966. func (m *PutResponse) MarshalTo(data []byte) (int, error) {
  967. var i int
  968. _ = i
  969. var l int
  970. _ = l
  971. if m.Header != nil {
  972. data[i] = 0xa
  973. i++
  974. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  975. n2, err := m.Header.MarshalTo(data[i:])
  976. if err != nil {
  977. return 0, err
  978. }
  979. i += n2
  980. }
  981. return i, nil
  982. }
  983. func (m *DeleteRangeRequest) Marshal() (data []byte, err error) {
  984. size := m.Size()
  985. data = make([]byte, size)
  986. n, err := m.MarshalTo(data)
  987. if err != nil {
  988. return nil, err
  989. }
  990. return data[:n], nil
  991. }
  992. func (m *DeleteRangeRequest) MarshalTo(data []byte) (int, error) {
  993. var i int
  994. _ = i
  995. var l int
  996. _ = l
  997. if m.Key != nil {
  998. if len(m.Key) > 0 {
  999. data[i] = 0xa
  1000. i++
  1001. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  1002. i += copy(data[i:], m.Key)
  1003. }
  1004. }
  1005. if m.RangeEnd != nil {
  1006. if len(m.RangeEnd) > 0 {
  1007. data[i] = 0x12
  1008. i++
  1009. i = encodeVarintRpc(data, i, uint64(len(m.RangeEnd)))
  1010. i += copy(data[i:], m.RangeEnd)
  1011. }
  1012. }
  1013. return i, nil
  1014. }
  1015. func (m *DeleteRangeResponse) Marshal() (data []byte, err error) {
  1016. size := m.Size()
  1017. data = make([]byte, size)
  1018. n, err := m.MarshalTo(data)
  1019. if err != nil {
  1020. return nil, err
  1021. }
  1022. return data[:n], nil
  1023. }
  1024. func (m *DeleteRangeResponse) MarshalTo(data []byte) (int, error) {
  1025. var i int
  1026. _ = i
  1027. var l int
  1028. _ = l
  1029. if m.Header != nil {
  1030. data[i] = 0xa
  1031. i++
  1032. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1033. n3, err := m.Header.MarshalTo(data[i:])
  1034. if err != nil {
  1035. return 0, err
  1036. }
  1037. i += n3
  1038. }
  1039. return i, nil
  1040. }
  1041. func (m *RequestUnion) Marshal() (data []byte, err error) {
  1042. size := m.Size()
  1043. data = make([]byte, size)
  1044. n, err := m.MarshalTo(data)
  1045. if err != nil {
  1046. return nil, err
  1047. }
  1048. return data[:n], nil
  1049. }
  1050. func (m *RequestUnion) MarshalTo(data []byte) (int, error) {
  1051. var i int
  1052. _ = i
  1053. var l int
  1054. _ = l
  1055. if m.RequestRange != nil {
  1056. data[i] = 0xa
  1057. i++
  1058. i = encodeVarintRpc(data, i, uint64(m.RequestRange.Size()))
  1059. n4, err := m.RequestRange.MarshalTo(data[i:])
  1060. if err != nil {
  1061. return 0, err
  1062. }
  1063. i += n4
  1064. }
  1065. if m.RequestPut != nil {
  1066. data[i] = 0x12
  1067. i++
  1068. i = encodeVarintRpc(data, i, uint64(m.RequestPut.Size()))
  1069. n5, err := m.RequestPut.MarshalTo(data[i:])
  1070. if err != nil {
  1071. return 0, err
  1072. }
  1073. i += n5
  1074. }
  1075. if m.RequestDeleteRange != nil {
  1076. data[i] = 0x1a
  1077. i++
  1078. i = encodeVarintRpc(data, i, uint64(m.RequestDeleteRange.Size()))
  1079. n6, err := m.RequestDeleteRange.MarshalTo(data[i:])
  1080. if err != nil {
  1081. return 0, err
  1082. }
  1083. i += n6
  1084. }
  1085. return i, nil
  1086. }
  1087. func (m *ResponseUnion) Marshal() (data []byte, err error) {
  1088. size := m.Size()
  1089. data = make([]byte, size)
  1090. n, err := m.MarshalTo(data)
  1091. if err != nil {
  1092. return nil, err
  1093. }
  1094. return data[:n], nil
  1095. }
  1096. func (m *ResponseUnion) MarshalTo(data []byte) (int, error) {
  1097. var i int
  1098. _ = i
  1099. var l int
  1100. _ = l
  1101. if m.ResponseRange != nil {
  1102. data[i] = 0xa
  1103. i++
  1104. i = encodeVarintRpc(data, i, uint64(m.ResponseRange.Size()))
  1105. n7, err := m.ResponseRange.MarshalTo(data[i:])
  1106. if err != nil {
  1107. return 0, err
  1108. }
  1109. i += n7
  1110. }
  1111. if m.ResponsePut != nil {
  1112. data[i] = 0x12
  1113. i++
  1114. i = encodeVarintRpc(data, i, uint64(m.ResponsePut.Size()))
  1115. n8, err := m.ResponsePut.MarshalTo(data[i:])
  1116. if err != nil {
  1117. return 0, err
  1118. }
  1119. i += n8
  1120. }
  1121. if m.ResponseDeleteRange != nil {
  1122. data[i] = 0x1a
  1123. i++
  1124. i = encodeVarintRpc(data, i, uint64(m.ResponseDeleteRange.Size()))
  1125. n9, err := m.ResponseDeleteRange.MarshalTo(data[i:])
  1126. if err != nil {
  1127. return 0, err
  1128. }
  1129. i += n9
  1130. }
  1131. return i, nil
  1132. }
  1133. func (m *Compare) Marshal() (data []byte, err error) {
  1134. size := m.Size()
  1135. data = make([]byte, size)
  1136. n, err := m.MarshalTo(data)
  1137. if err != nil {
  1138. return nil, err
  1139. }
  1140. return data[:n], nil
  1141. }
  1142. func (m *Compare) MarshalTo(data []byte) (int, error) {
  1143. var i int
  1144. _ = i
  1145. var l int
  1146. _ = l
  1147. if m.Result != 0 {
  1148. data[i] = 0x8
  1149. i++
  1150. i = encodeVarintRpc(data, i, uint64(m.Result))
  1151. }
  1152. if m.Target != 0 {
  1153. data[i] = 0x10
  1154. i++
  1155. i = encodeVarintRpc(data, i, uint64(m.Target))
  1156. }
  1157. if m.Key != nil {
  1158. if len(m.Key) > 0 {
  1159. data[i] = 0x1a
  1160. i++
  1161. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  1162. i += copy(data[i:], m.Key)
  1163. }
  1164. }
  1165. if m.Version != 0 {
  1166. data[i] = 0x20
  1167. i++
  1168. i = encodeVarintRpc(data, i, uint64(m.Version))
  1169. }
  1170. if m.CreateRevision != 0 {
  1171. data[i] = 0x28
  1172. i++
  1173. i = encodeVarintRpc(data, i, uint64(m.CreateRevision))
  1174. }
  1175. if m.ModRevision != 0 {
  1176. data[i] = 0x30
  1177. i++
  1178. i = encodeVarintRpc(data, i, uint64(m.ModRevision))
  1179. }
  1180. if m.Value != nil {
  1181. if len(m.Value) > 0 {
  1182. data[i] = 0x3a
  1183. i++
  1184. i = encodeVarintRpc(data, i, uint64(len(m.Value)))
  1185. i += copy(data[i:], m.Value)
  1186. }
  1187. }
  1188. return i, nil
  1189. }
  1190. func (m *TxnRequest) Marshal() (data []byte, err error) {
  1191. size := m.Size()
  1192. data = make([]byte, size)
  1193. n, err := m.MarshalTo(data)
  1194. if err != nil {
  1195. return nil, err
  1196. }
  1197. return data[:n], nil
  1198. }
  1199. func (m *TxnRequest) MarshalTo(data []byte) (int, error) {
  1200. var i int
  1201. _ = i
  1202. var l int
  1203. _ = l
  1204. if len(m.Compare) > 0 {
  1205. for _, msg := range m.Compare {
  1206. data[i] = 0xa
  1207. i++
  1208. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  1209. n, err := msg.MarshalTo(data[i:])
  1210. if err != nil {
  1211. return 0, err
  1212. }
  1213. i += n
  1214. }
  1215. }
  1216. if len(m.Success) > 0 {
  1217. for _, msg := range m.Success {
  1218. data[i] = 0x12
  1219. i++
  1220. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  1221. n, err := msg.MarshalTo(data[i:])
  1222. if err != nil {
  1223. return 0, err
  1224. }
  1225. i += n
  1226. }
  1227. }
  1228. if len(m.Failure) > 0 {
  1229. for _, msg := range m.Failure {
  1230. data[i] = 0x1a
  1231. i++
  1232. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  1233. n, err := msg.MarshalTo(data[i:])
  1234. if err != nil {
  1235. return 0, err
  1236. }
  1237. i += n
  1238. }
  1239. }
  1240. return i, nil
  1241. }
  1242. func (m *TxnResponse) Marshal() (data []byte, err error) {
  1243. size := m.Size()
  1244. data = make([]byte, size)
  1245. n, err := m.MarshalTo(data)
  1246. if err != nil {
  1247. return nil, err
  1248. }
  1249. return data[:n], nil
  1250. }
  1251. func (m *TxnResponse) MarshalTo(data []byte) (int, error) {
  1252. var i int
  1253. _ = i
  1254. var l int
  1255. _ = l
  1256. if m.Header != nil {
  1257. data[i] = 0xa
  1258. i++
  1259. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1260. n10, err := m.Header.MarshalTo(data[i:])
  1261. if err != nil {
  1262. return 0, err
  1263. }
  1264. i += n10
  1265. }
  1266. if m.Succeeded {
  1267. data[i] = 0x10
  1268. i++
  1269. if m.Succeeded {
  1270. data[i] = 1
  1271. } else {
  1272. data[i] = 0
  1273. }
  1274. i++
  1275. }
  1276. if len(m.Responses) > 0 {
  1277. for _, msg := range m.Responses {
  1278. data[i] = 0x1a
  1279. i++
  1280. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  1281. n, err := msg.MarshalTo(data[i:])
  1282. if err != nil {
  1283. return 0, err
  1284. }
  1285. i += n
  1286. }
  1287. }
  1288. return i, nil
  1289. }
  1290. func (m *CompactionRequest) Marshal() (data []byte, err error) {
  1291. size := m.Size()
  1292. data = make([]byte, size)
  1293. n, err := m.MarshalTo(data)
  1294. if err != nil {
  1295. return nil, err
  1296. }
  1297. return data[:n], nil
  1298. }
  1299. func (m *CompactionRequest) MarshalTo(data []byte) (int, error) {
  1300. var i int
  1301. _ = i
  1302. var l int
  1303. _ = l
  1304. if m.Revision != 0 {
  1305. data[i] = 0x8
  1306. i++
  1307. i = encodeVarintRpc(data, i, uint64(m.Revision))
  1308. }
  1309. return i, nil
  1310. }
  1311. func (m *CompactionResponse) Marshal() (data []byte, err error) {
  1312. size := m.Size()
  1313. data = make([]byte, size)
  1314. n, err := m.MarshalTo(data)
  1315. if err != nil {
  1316. return nil, err
  1317. }
  1318. return data[:n], nil
  1319. }
  1320. func (m *CompactionResponse) MarshalTo(data []byte) (int, error) {
  1321. var i int
  1322. _ = i
  1323. var l int
  1324. _ = l
  1325. if m.Header != nil {
  1326. data[i] = 0xa
  1327. i++
  1328. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1329. n11, err := m.Header.MarshalTo(data[i:])
  1330. if err != nil {
  1331. return 0, err
  1332. }
  1333. i += n11
  1334. }
  1335. return i, nil
  1336. }
  1337. func (m *WatchRequest) Marshal() (data []byte, err error) {
  1338. size := m.Size()
  1339. data = make([]byte, size)
  1340. n, err := m.MarshalTo(data)
  1341. if err != nil {
  1342. return nil, err
  1343. }
  1344. return data[:n], nil
  1345. }
  1346. func (m *WatchRequest) MarshalTo(data []byte) (int, error) {
  1347. var i int
  1348. _ = i
  1349. var l int
  1350. _ = l
  1351. if m.Key != nil {
  1352. if len(m.Key) > 0 {
  1353. data[i] = 0xa
  1354. i++
  1355. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  1356. i += copy(data[i:], m.Key)
  1357. }
  1358. }
  1359. if m.Prefix != nil {
  1360. if len(m.Prefix) > 0 {
  1361. data[i] = 0x12
  1362. i++
  1363. i = encodeVarintRpc(data, i, uint64(len(m.Prefix)))
  1364. i += copy(data[i:], m.Prefix)
  1365. }
  1366. }
  1367. if m.StartRevision != 0 {
  1368. data[i] = 0x18
  1369. i++
  1370. i = encodeVarintRpc(data, i, uint64(m.StartRevision))
  1371. }
  1372. return i, nil
  1373. }
  1374. func (m *WatchResponse) Marshal() (data []byte, err error) {
  1375. size := m.Size()
  1376. data = make([]byte, size)
  1377. n, err := m.MarshalTo(data)
  1378. if err != nil {
  1379. return nil, err
  1380. }
  1381. return data[:n], nil
  1382. }
  1383. func (m *WatchResponse) MarshalTo(data []byte) (int, error) {
  1384. var i int
  1385. _ = i
  1386. var l int
  1387. _ = l
  1388. if m.Header != nil {
  1389. data[i] = 0xa
  1390. i++
  1391. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1392. n12, err := m.Header.MarshalTo(data[i:])
  1393. if err != nil {
  1394. return 0, err
  1395. }
  1396. i += n12
  1397. }
  1398. if len(m.Events) > 0 {
  1399. for _, msg := range m.Events {
  1400. data[i] = 0x12
  1401. i++
  1402. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  1403. n, err := msg.MarshalTo(data[i:])
  1404. if err != nil {
  1405. return 0, err
  1406. }
  1407. i += n
  1408. }
  1409. }
  1410. return i, nil
  1411. }
  1412. func (m *LeaseCreateRequest) Marshal() (data []byte, err error) {
  1413. size := m.Size()
  1414. data = make([]byte, size)
  1415. n, err := m.MarshalTo(data)
  1416. if err != nil {
  1417. return nil, err
  1418. }
  1419. return data[:n], nil
  1420. }
  1421. func (m *LeaseCreateRequest) MarshalTo(data []byte) (int, error) {
  1422. var i int
  1423. _ = i
  1424. var l int
  1425. _ = l
  1426. if m.Ttl != 0 {
  1427. data[i] = 0x8
  1428. i++
  1429. i = encodeVarintRpc(data, i, uint64(m.Ttl))
  1430. }
  1431. return i, nil
  1432. }
  1433. func (m *LeaseCreateResponse) Marshal() (data []byte, err error) {
  1434. size := m.Size()
  1435. data = make([]byte, size)
  1436. n, err := m.MarshalTo(data)
  1437. if err != nil {
  1438. return nil, err
  1439. }
  1440. return data[:n], nil
  1441. }
  1442. func (m *LeaseCreateResponse) MarshalTo(data []byte) (int, error) {
  1443. var i int
  1444. _ = i
  1445. var l int
  1446. _ = l
  1447. if m.Header != nil {
  1448. data[i] = 0xa
  1449. i++
  1450. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1451. n13, err := m.Header.MarshalTo(data[i:])
  1452. if err != nil {
  1453. return 0, err
  1454. }
  1455. i += n13
  1456. }
  1457. if m.LeaseId != 0 {
  1458. data[i] = 0x10
  1459. i++
  1460. i = encodeVarintRpc(data, i, uint64(m.LeaseId))
  1461. }
  1462. if m.Ttl != 0 {
  1463. data[i] = 0x18
  1464. i++
  1465. i = encodeVarintRpc(data, i, uint64(m.Ttl))
  1466. }
  1467. if len(m.Error) > 0 {
  1468. data[i] = 0x22
  1469. i++
  1470. i = encodeVarintRpc(data, i, uint64(len(m.Error)))
  1471. i += copy(data[i:], m.Error)
  1472. }
  1473. return i, nil
  1474. }
  1475. func (m *LeaseRevokeRequest) Marshal() (data []byte, err error) {
  1476. size := m.Size()
  1477. data = make([]byte, size)
  1478. n, err := m.MarshalTo(data)
  1479. if err != nil {
  1480. return nil, err
  1481. }
  1482. return data[:n], nil
  1483. }
  1484. func (m *LeaseRevokeRequest) MarshalTo(data []byte) (int, error) {
  1485. var i int
  1486. _ = i
  1487. var l int
  1488. _ = l
  1489. if m.LeaseId != 0 {
  1490. data[i] = 0x8
  1491. i++
  1492. i = encodeVarintRpc(data, i, uint64(m.LeaseId))
  1493. }
  1494. return i, nil
  1495. }
  1496. func (m *LeaseRevokeResponse) Marshal() (data []byte, err error) {
  1497. size := m.Size()
  1498. data = make([]byte, size)
  1499. n, err := m.MarshalTo(data)
  1500. if err != nil {
  1501. return nil, err
  1502. }
  1503. return data[:n], nil
  1504. }
  1505. func (m *LeaseRevokeResponse) MarshalTo(data []byte) (int, error) {
  1506. var i int
  1507. _ = i
  1508. var l int
  1509. _ = l
  1510. if m.Header != nil {
  1511. data[i] = 0xa
  1512. i++
  1513. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1514. n14, err := m.Header.MarshalTo(data[i:])
  1515. if err != nil {
  1516. return 0, err
  1517. }
  1518. i += n14
  1519. }
  1520. return i, nil
  1521. }
  1522. func (m *LeaseKeepAliveRequest) Marshal() (data []byte, err error) {
  1523. size := m.Size()
  1524. data = make([]byte, size)
  1525. n, err := m.MarshalTo(data)
  1526. if err != nil {
  1527. return nil, err
  1528. }
  1529. return data[:n], nil
  1530. }
  1531. func (m *LeaseKeepAliveRequest) MarshalTo(data []byte) (int, error) {
  1532. var i int
  1533. _ = i
  1534. var l int
  1535. _ = l
  1536. if m.LeaseId != 0 {
  1537. data[i] = 0x8
  1538. i++
  1539. i = encodeVarintRpc(data, i, uint64(m.LeaseId))
  1540. }
  1541. return i, nil
  1542. }
  1543. func (m *LeaseKeepAliveResponse) Marshal() (data []byte, err error) {
  1544. size := m.Size()
  1545. data = make([]byte, size)
  1546. n, err := m.MarshalTo(data)
  1547. if err != nil {
  1548. return nil, err
  1549. }
  1550. return data[:n], nil
  1551. }
  1552. func (m *LeaseKeepAliveResponse) MarshalTo(data []byte) (int, error) {
  1553. var i int
  1554. _ = i
  1555. var l int
  1556. _ = l
  1557. if m.Header != nil {
  1558. data[i] = 0xa
  1559. i++
  1560. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1561. n15, err := m.Header.MarshalTo(data[i:])
  1562. if err != nil {
  1563. return 0, err
  1564. }
  1565. i += n15
  1566. }
  1567. if m.LeaseId != 0 {
  1568. data[i] = 0x10
  1569. i++
  1570. i = encodeVarintRpc(data, i, uint64(m.LeaseId))
  1571. }
  1572. if m.Ttl != 0 {
  1573. data[i] = 0x18
  1574. i++
  1575. i = encodeVarintRpc(data, i, uint64(m.Ttl))
  1576. }
  1577. return i, nil
  1578. }
  1579. func encodeFixed64Rpc(data []byte, offset int, v uint64) int {
  1580. data[offset] = uint8(v)
  1581. data[offset+1] = uint8(v >> 8)
  1582. data[offset+2] = uint8(v >> 16)
  1583. data[offset+3] = uint8(v >> 24)
  1584. data[offset+4] = uint8(v >> 32)
  1585. data[offset+5] = uint8(v >> 40)
  1586. data[offset+6] = uint8(v >> 48)
  1587. data[offset+7] = uint8(v >> 56)
  1588. return offset + 8
  1589. }
  1590. func encodeFixed32Rpc(data []byte, offset int, v uint32) int {
  1591. data[offset] = uint8(v)
  1592. data[offset+1] = uint8(v >> 8)
  1593. data[offset+2] = uint8(v >> 16)
  1594. data[offset+3] = uint8(v >> 24)
  1595. return offset + 4
  1596. }
  1597. func encodeVarintRpc(data []byte, offset int, v uint64) int {
  1598. for v >= 1<<7 {
  1599. data[offset] = uint8(v&0x7f | 0x80)
  1600. v >>= 7
  1601. offset++
  1602. }
  1603. data[offset] = uint8(v)
  1604. return offset + 1
  1605. }
  1606. func (m *ResponseHeader) Size() (n int) {
  1607. var l int
  1608. _ = l
  1609. if m.ClusterId != 0 {
  1610. n += 1 + sovRpc(uint64(m.ClusterId))
  1611. }
  1612. if m.MemberId != 0 {
  1613. n += 1 + sovRpc(uint64(m.MemberId))
  1614. }
  1615. if m.Revision != 0 {
  1616. n += 1 + sovRpc(uint64(m.Revision))
  1617. }
  1618. if m.RaftTerm != 0 {
  1619. n += 1 + sovRpc(uint64(m.RaftTerm))
  1620. }
  1621. return n
  1622. }
  1623. func (m *RangeRequest) Size() (n int) {
  1624. var l int
  1625. _ = l
  1626. if m.Key != nil {
  1627. l = len(m.Key)
  1628. if l > 0 {
  1629. n += 1 + l + sovRpc(uint64(l))
  1630. }
  1631. }
  1632. if m.RangeEnd != nil {
  1633. l = len(m.RangeEnd)
  1634. if l > 0 {
  1635. n += 1 + l + sovRpc(uint64(l))
  1636. }
  1637. }
  1638. if m.Limit != 0 {
  1639. n += 1 + sovRpc(uint64(m.Limit))
  1640. }
  1641. if m.Revision != 0 {
  1642. n += 1 + sovRpc(uint64(m.Revision))
  1643. }
  1644. return n
  1645. }
  1646. func (m *RangeResponse) Size() (n int) {
  1647. var l int
  1648. _ = l
  1649. if m.Header != nil {
  1650. l = m.Header.Size()
  1651. n += 1 + l + sovRpc(uint64(l))
  1652. }
  1653. if len(m.Kvs) > 0 {
  1654. for _, e := range m.Kvs {
  1655. l = e.Size()
  1656. n += 1 + l + sovRpc(uint64(l))
  1657. }
  1658. }
  1659. if m.More {
  1660. n += 2
  1661. }
  1662. return n
  1663. }
  1664. func (m *PutRequest) Size() (n int) {
  1665. var l int
  1666. _ = l
  1667. if m.Key != nil {
  1668. l = len(m.Key)
  1669. if l > 0 {
  1670. n += 1 + l + sovRpc(uint64(l))
  1671. }
  1672. }
  1673. if m.Value != nil {
  1674. l = len(m.Value)
  1675. if l > 0 {
  1676. n += 1 + l + sovRpc(uint64(l))
  1677. }
  1678. }
  1679. if m.Lease != 0 {
  1680. n += 1 + sovRpc(uint64(m.Lease))
  1681. }
  1682. return n
  1683. }
  1684. func (m *PutResponse) Size() (n int) {
  1685. var l int
  1686. _ = l
  1687. if m.Header != nil {
  1688. l = m.Header.Size()
  1689. n += 1 + l + sovRpc(uint64(l))
  1690. }
  1691. return n
  1692. }
  1693. func (m *DeleteRangeRequest) Size() (n int) {
  1694. var l int
  1695. _ = l
  1696. if m.Key != nil {
  1697. l = len(m.Key)
  1698. if l > 0 {
  1699. n += 1 + l + sovRpc(uint64(l))
  1700. }
  1701. }
  1702. if m.RangeEnd != nil {
  1703. l = len(m.RangeEnd)
  1704. if l > 0 {
  1705. n += 1 + l + sovRpc(uint64(l))
  1706. }
  1707. }
  1708. return n
  1709. }
  1710. func (m *DeleteRangeResponse) Size() (n int) {
  1711. var l int
  1712. _ = l
  1713. if m.Header != nil {
  1714. l = m.Header.Size()
  1715. n += 1 + l + sovRpc(uint64(l))
  1716. }
  1717. return n
  1718. }
  1719. func (m *RequestUnion) Size() (n int) {
  1720. var l int
  1721. _ = l
  1722. if m.RequestRange != nil {
  1723. l = m.RequestRange.Size()
  1724. n += 1 + l + sovRpc(uint64(l))
  1725. }
  1726. if m.RequestPut != nil {
  1727. l = m.RequestPut.Size()
  1728. n += 1 + l + sovRpc(uint64(l))
  1729. }
  1730. if m.RequestDeleteRange != nil {
  1731. l = m.RequestDeleteRange.Size()
  1732. n += 1 + l + sovRpc(uint64(l))
  1733. }
  1734. return n
  1735. }
  1736. func (m *ResponseUnion) Size() (n int) {
  1737. var l int
  1738. _ = l
  1739. if m.ResponseRange != nil {
  1740. l = m.ResponseRange.Size()
  1741. n += 1 + l + sovRpc(uint64(l))
  1742. }
  1743. if m.ResponsePut != nil {
  1744. l = m.ResponsePut.Size()
  1745. n += 1 + l + sovRpc(uint64(l))
  1746. }
  1747. if m.ResponseDeleteRange != nil {
  1748. l = m.ResponseDeleteRange.Size()
  1749. n += 1 + l + sovRpc(uint64(l))
  1750. }
  1751. return n
  1752. }
  1753. func (m *Compare) Size() (n int) {
  1754. var l int
  1755. _ = l
  1756. if m.Result != 0 {
  1757. n += 1 + sovRpc(uint64(m.Result))
  1758. }
  1759. if m.Target != 0 {
  1760. n += 1 + sovRpc(uint64(m.Target))
  1761. }
  1762. if m.Key != nil {
  1763. l = len(m.Key)
  1764. if l > 0 {
  1765. n += 1 + l + sovRpc(uint64(l))
  1766. }
  1767. }
  1768. if m.Version != 0 {
  1769. n += 1 + sovRpc(uint64(m.Version))
  1770. }
  1771. if m.CreateRevision != 0 {
  1772. n += 1 + sovRpc(uint64(m.CreateRevision))
  1773. }
  1774. if m.ModRevision != 0 {
  1775. n += 1 + sovRpc(uint64(m.ModRevision))
  1776. }
  1777. if m.Value != nil {
  1778. l = len(m.Value)
  1779. if l > 0 {
  1780. n += 1 + l + sovRpc(uint64(l))
  1781. }
  1782. }
  1783. return n
  1784. }
  1785. func (m *TxnRequest) Size() (n int) {
  1786. var l int
  1787. _ = l
  1788. if len(m.Compare) > 0 {
  1789. for _, e := range m.Compare {
  1790. l = e.Size()
  1791. n += 1 + l + sovRpc(uint64(l))
  1792. }
  1793. }
  1794. if len(m.Success) > 0 {
  1795. for _, e := range m.Success {
  1796. l = e.Size()
  1797. n += 1 + l + sovRpc(uint64(l))
  1798. }
  1799. }
  1800. if len(m.Failure) > 0 {
  1801. for _, e := range m.Failure {
  1802. l = e.Size()
  1803. n += 1 + l + sovRpc(uint64(l))
  1804. }
  1805. }
  1806. return n
  1807. }
  1808. func (m *TxnResponse) Size() (n int) {
  1809. var l int
  1810. _ = l
  1811. if m.Header != nil {
  1812. l = m.Header.Size()
  1813. n += 1 + l + sovRpc(uint64(l))
  1814. }
  1815. if m.Succeeded {
  1816. n += 2
  1817. }
  1818. if len(m.Responses) > 0 {
  1819. for _, e := range m.Responses {
  1820. l = e.Size()
  1821. n += 1 + l + sovRpc(uint64(l))
  1822. }
  1823. }
  1824. return n
  1825. }
  1826. func (m *CompactionRequest) Size() (n int) {
  1827. var l int
  1828. _ = l
  1829. if m.Revision != 0 {
  1830. n += 1 + sovRpc(uint64(m.Revision))
  1831. }
  1832. return n
  1833. }
  1834. func (m *CompactionResponse) Size() (n int) {
  1835. var l int
  1836. _ = l
  1837. if m.Header != nil {
  1838. l = m.Header.Size()
  1839. n += 1 + l + sovRpc(uint64(l))
  1840. }
  1841. return n
  1842. }
  1843. func (m *WatchRequest) Size() (n int) {
  1844. var l int
  1845. _ = l
  1846. if m.Key != nil {
  1847. l = len(m.Key)
  1848. if l > 0 {
  1849. n += 1 + l + sovRpc(uint64(l))
  1850. }
  1851. }
  1852. if m.Prefix != nil {
  1853. l = len(m.Prefix)
  1854. if l > 0 {
  1855. n += 1 + l + sovRpc(uint64(l))
  1856. }
  1857. }
  1858. if m.StartRevision != 0 {
  1859. n += 1 + sovRpc(uint64(m.StartRevision))
  1860. }
  1861. return n
  1862. }
  1863. func (m *WatchResponse) Size() (n int) {
  1864. var l int
  1865. _ = l
  1866. if m.Header != nil {
  1867. l = m.Header.Size()
  1868. n += 1 + l + sovRpc(uint64(l))
  1869. }
  1870. if len(m.Events) > 0 {
  1871. for _, e := range m.Events {
  1872. l = e.Size()
  1873. n += 1 + l + sovRpc(uint64(l))
  1874. }
  1875. }
  1876. return n
  1877. }
  1878. func (m *LeaseCreateRequest) Size() (n int) {
  1879. var l int
  1880. _ = l
  1881. if m.Ttl != 0 {
  1882. n += 1 + sovRpc(uint64(m.Ttl))
  1883. }
  1884. return n
  1885. }
  1886. func (m *LeaseCreateResponse) Size() (n int) {
  1887. var l int
  1888. _ = l
  1889. if m.Header != nil {
  1890. l = m.Header.Size()
  1891. n += 1 + l + sovRpc(uint64(l))
  1892. }
  1893. if m.LeaseId != 0 {
  1894. n += 1 + sovRpc(uint64(m.LeaseId))
  1895. }
  1896. if m.Ttl != 0 {
  1897. n += 1 + sovRpc(uint64(m.Ttl))
  1898. }
  1899. l = len(m.Error)
  1900. if l > 0 {
  1901. n += 1 + l + sovRpc(uint64(l))
  1902. }
  1903. return n
  1904. }
  1905. func (m *LeaseRevokeRequest) Size() (n int) {
  1906. var l int
  1907. _ = l
  1908. if m.LeaseId != 0 {
  1909. n += 1 + sovRpc(uint64(m.LeaseId))
  1910. }
  1911. return n
  1912. }
  1913. func (m *LeaseRevokeResponse) Size() (n int) {
  1914. var l int
  1915. _ = l
  1916. if m.Header != nil {
  1917. l = m.Header.Size()
  1918. n += 1 + l + sovRpc(uint64(l))
  1919. }
  1920. return n
  1921. }
  1922. func (m *LeaseKeepAliveRequest) Size() (n int) {
  1923. var l int
  1924. _ = l
  1925. if m.LeaseId != 0 {
  1926. n += 1 + sovRpc(uint64(m.LeaseId))
  1927. }
  1928. return n
  1929. }
  1930. func (m *LeaseKeepAliveResponse) Size() (n int) {
  1931. var l int
  1932. _ = l
  1933. if m.Header != nil {
  1934. l = m.Header.Size()
  1935. n += 1 + l + sovRpc(uint64(l))
  1936. }
  1937. if m.LeaseId != 0 {
  1938. n += 1 + sovRpc(uint64(m.LeaseId))
  1939. }
  1940. if m.Ttl != 0 {
  1941. n += 1 + sovRpc(uint64(m.Ttl))
  1942. }
  1943. return n
  1944. }
  1945. func sovRpc(x uint64) (n int) {
  1946. for {
  1947. n++
  1948. x >>= 7
  1949. if x == 0 {
  1950. break
  1951. }
  1952. }
  1953. return n
  1954. }
  1955. func sozRpc(x uint64) (n int) {
  1956. return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1957. }
  1958. func (m *ResponseHeader) Unmarshal(data []byte) error {
  1959. l := len(data)
  1960. iNdEx := 0
  1961. for iNdEx < l {
  1962. var wire uint64
  1963. for shift := uint(0); ; shift += 7 {
  1964. if iNdEx >= l {
  1965. return io.ErrUnexpectedEOF
  1966. }
  1967. b := data[iNdEx]
  1968. iNdEx++
  1969. wire |= (uint64(b) & 0x7F) << shift
  1970. if b < 0x80 {
  1971. break
  1972. }
  1973. }
  1974. fieldNum := int32(wire >> 3)
  1975. wireType := int(wire & 0x7)
  1976. switch fieldNum {
  1977. case 1:
  1978. if wireType != 0 {
  1979. return fmt.Errorf("proto: wrong wireType = %d for field ClusterId", wireType)
  1980. }
  1981. m.ClusterId = 0
  1982. for shift := uint(0); ; shift += 7 {
  1983. if iNdEx >= l {
  1984. return io.ErrUnexpectedEOF
  1985. }
  1986. b := data[iNdEx]
  1987. iNdEx++
  1988. m.ClusterId |= (uint64(b) & 0x7F) << shift
  1989. if b < 0x80 {
  1990. break
  1991. }
  1992. }
  1993. case 2:
  1994. if wireType != 0 {
  1995. return fmt.Errorf("proto: wrong wireType = %d for field MemberId", wireType)
  1996. }
  1997. m.MemberId = 0
  1998. for shift := uint(0); ; shift += 7 {
  1999. if iNdEx >= l {
  2000. return io.ErrUnexpectedEOF
  2001. }
  2002. b := data[iNdEx]
  2003. iNdEx++
  2004. m.MemberId |= (uint64(b) & 0x7F) << shift
  2005. if b < 0x80 {
  2006. break
  2007. }
  2008. }
  2009. case 3:
  2010. if wireType != 0 {
  2011. return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
  2012. }
  2013. m.Revision = 0
  2014. for shift := uint(0); ; shift += 7 {
  2015. if iNdEx >= l {
  2016. return io.ErrUnexpectedEOF
  2017. }
  2018. b := data[iNdEx]
  2019. iNdEx++
  2020. m.Revision |= (int64(b) & 0x7F) << shift
  2021. if b < 0x80 {
  2022. break
  2023. }
  2024. }
  2025. case 4:
  2026. if wireType != 0 {
  2027. return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType)
  2028. }
  2029. m.RaftTerm = 0
  2030. for shift := uint(0); ; shift += 7 {
  2031. if iNdEx >= l {
  2032. return io.ErrUnexpectedEOF
  2033. }
  2034. b := data[iNdEx]
  2035. iNdEx++
  2036. m.RaftTerm |= (uint64(b) & 0x7F) << shift
  2037. if b < 0x80 {
  2038. break
  2039. }
  2040. }
  2041. default:
  2042. var sizeOfWire int
  2043. for {
  2044. sizeOfWire++
  2045. wire >>= 7
  2046. if wire == 0 {
  2047. break
  2048. }
  2049. }
  2050. iNdEx -= sizeOfWire
  2051. skippy, err := skipRpc(data[iNdEx:])
  2052. if err != nil {
  2053. return err
  2054. }
  2055. if skippy < 0 {
  2056. return ErrInvalidLengthRpc
  2057. }
  2058. if (iNdEx + skippy) > l {
  2059. return io.ErrUnexpectedEOF
  2060. }
  2061. iNdEx += skippy
  2062. }
  2063. }
  2064. return nil
  2065. }
  2066. func (m *RangeRequest) Unmarshal(data []byte) error {
  2067. l := len(data)
  2068. iNdEx := 0
  2069. for iNdEx < l {
  2070. var wire uint64
  2071. for shift := uint(0); ; shift += 7 {
  2072. if iNdEx >= l {
  2073. return io.ErrUnexpectedEOF
  2074. }
  2075. b := data[iNdEx]
  2076. iNdEx++
  2077. wire |= (uint64(b) & 0x7F) << shift
  2078. if b < 0x80 {
  2079. break
  2080. }
  2081. }
  2082. fieldNum := int32(wire >> 3)
  2083. wireType := int(wire & 0x7)
  2084. switch fieldNum {
  2085. case 1:
  2086. if wireType != 2 {
  2087. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  2088. }
  2089. var byteLen int
  2090. for shift := uint(0); ; shift += 7 {
  2091. if iNdEx >= l {
  2092. return io.ErrUnexpectedEOF
  2093. }
  2094. b := data[iNdEx]
  2095. iNdEx++
  2096. byteLen |= (int(b) & 0x7F) << shift
  2097. if b < 0x80 {
  2098. break
  2099. }
  2100. }
  2101. if byteLen < 0 {
  2102. return ErrInvalidLengthRpc
  2103. }
  2104. postIndex := iNdEx + byteLen
  2105. if postIndex > l {
  2106. return io.ErrUnexpectedEOF
  2107. }
  2108. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  2109. iNdEx = postIndex
  2110. case 2:
  2111. if wireType != 2 {
  2112. return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType)
  2113. }
  2114. var byteLen int
  2115. for shift := uint(0); ; shift += 7 {
  2116. if iNdEx >= l {
  2117. return io.ErrUnexpectedEOF
  2118. }
  2119. b := data[iNdEx]
  2120. iNdEx++
  2121. byteLen |= (int(b) & 0x7F) << shift
  2122. if b < 0x80 {
  2123. break
  2124. }
  2125. }
  2126. if byteLen < 0 {
  2127. return ErrInvalidLengthRpc
  2128. }
  2129. postIndex := iNdEx + byteLen
  2130. if postIndex > l {
  2131. return io.ErrUnexpectedEOF
  2132. }
  2133. m.RangeEnd = append([]byte{}, data[iNdEx:postIndex]...)
  2134. iNdEx = postIndex
  2135. case 3:
  2136. if wireType != 0 {
  2137. return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType)
  2138. }
  2139. m.Limit = 0
  2140. for shift := uint(0); ; shift += 7 {
  2141. if iNdEx >= l {
  2142. return io.ErrUnexpectedEOF
  2143. }
  2144. b := data[iNdEx]
  2145. iNdEx++
  2146. m.Limit |= (int64(b) & 0x7F) << shift
  2147. if b < 0x80 {
  2148. break
  2149. }
  2150. }
  2151. case 4:
  2152. if wireType != 0 {
  2153. return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
  2154. }
  2155. m.Revision = 0
  2156. for shift := uint(0); ; shift += 7 {
  2157. if iNdEx >= l {
  2158. return io.ErrUnexpectedEOF
  2159. }
  2160. b := data[iNdEx]
  2161. iNdEx++
  2162. m.Revision |= (int64(b) & 0x7F) << shift
  2163. if b < 0x80 {
  2164. break
  2165. }
  2166. }
  2167. default:
  2168. var sizeOfWire int
  2169. for {
  2170. sizeOfWire++
  2171. wire >>= 7
  2172. if wire == 0 {
  2173. break
  2174. }
  2175. }
  2176. iNdEx -= sizeOfWire
  2177. skippy, err := skipRpc(data[iNdEx:])
  2178. if err != nil {
  2179. return err
  2180. }
  2181. if skippy < 0 {
  2182. return ErrInvalidLengthRpc
  2183. }
  2184. if (iNdEx + skippy) > l {
  2185. return io.ErrUnexpectedEOF
  2186. }
  2187. iNdEx += skippy
  2188. }
  2189. }
  2190. return nil
  2191. }
  2192. func (m *RangeResponse) Unmarshal(data []byte) error {
  2193. l := len(data)
  2194. iNdEx := 0
  2195. for iNdEx < l {
  2196. var wire uint64
  2197. for shift := uint(0); ; shift += 7 {
  2198. if iNdEx >= l {
  2199. return io.ErrUnexpectedEOF
  2200. }
  2201. b := data[iNdEx]
  2202. iNdEx++
  2203. wire |= (uint64(b) & 0x7F) << shift
  2204. if b < 0x80 {
  2205. break
  2206. }
  2207. }
  2208. fieldNum := int32(wire >> 3)
  2209. wireType := int(wire & 0x7)
  2210. switch fieldNum {
  2211. case 1:
  2212. if wireType != 2 {
  2213. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  2214. }
  2215. var msglen int
  2216. for shift := uint(0); ; shift += 7 {
  2217. if iNdEx >= l {
  2218. return io.ErrUnexpectedEOF
  2219. }
  2220. b := data[iNdEx]
  2221. iNdEx++
  2222. msglen |= (int(b) & 0x7F) << shift
  2223. if b < 0x80 {
  2224. break
  2225. }
  2226. }
  2227. if msglen < 0 {
  2228. return ErrInvalidLengthRpc
  2229. }
  2230. postIndex := iNdEx + msglen
  2231. if postIndex > l {
  2232. return io.ErrUnexpectedEOF
  2233. }
  2234. if m.Header == nil {
  2235. m.Header = &ResponseHeader{}
  2236. }
  2237. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2238. return err
  2239. }
  2240. iNdEx = postIndex
  2241. case 2:
  2242. if wireType != 2 {
  2243. return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType)
  2244. }
  2245. var msglen int
  2246. for shift := uint(0); ; shift += 7 {
  2247. if iNdEx >= l {
  2248. return io.ErrUnexpectedEOF
  2249. }
  2250. b := data[iNdEx]
  2251. iNdEx++
  2252. msglen |= (int(b) & 0x7F) << shift
  2253. if b < 0x80 {
  2254. break
  2255. }
  2256. }
  2257. if msglen < 0 {
  2258. return ErrInvalidLengthRpc
  2259. }
  2260. postIndex := iNdEx + msglen
  2261. if postIndex > l {
  2262. return io.ErrUnexpectedEOF
  2263. }
  2264. m.Kvs = append(m.Kvs, &storagepb.KeyValue{})
  2265. if err := m.Kvs[len(m.Kvs)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2266. return err
  2267. }
  2268. iNdEx = postIndex
  2269. case 3:
  2270. if wireType != 0 {
  2271. return fmt.Errorf("proto: wrong wireType = %d for field More", wireType)
  2272. }
  2273. var v int
  2274. for shift := uint(0); ; shift += 7 {
  2275. if iNdEx >= l {
  2276. return io.ErrUnexpectedEOF
  2277. }
  2278. b := data[iNdEx]
  2279. iNdEx++
  2280. v |= (int(b) & 0x7F) << shift
  2281. if b < 0x80 {
  2282. break
  2283. }
  2284. }
  2285. m.More = bool(v != 0)
  2286. default:
  2287. var sizeOfWire int
  2288. for {
  2289. sizeOfWire++
  2290. wire >>= 7
  2291. if wire == 0 {
  2292. break
  2293. }
  2294. }
  2295. iNdEx -= sizeOfWire
  2296. skippy, err := skipRpc(data[iNdEx:])
  2297. if err != nil {
  2298. return err
  2299. }
  2300. if skippy < 0 {
  2301. return ErrInvalidLengthRpc
  2302. }
  2303. if (iNdEx + skippy) > l {
  2304. return io.ErrUnexpectedEOF
  2305. }
  2306. iNdEx += skippy
  2307. }
  2308. }
  2309. return nil
  2310. }
  2311. func (m *PutRequest) Unmarshal(data []byte) error {
  2312. l := len(data)
  2313. iNdEx := 0
  2314. for iNdEx < l {
  2315. var wire uint64
  2316. for shift := uint(0); ; shift += 7 {
  2317. if iNdEx >= l {
  2318. return io.ErrUnexpectedEOF
  2319. }
  2320. b := data[iNdEx]
  2321. iNdEx++
  2322. wire |= (uint64(b) & 0x7F) << shift
  2323. if b < 0x80 {
  2324. break
  2325. }
  2326. }
  2327. fieldNum := int32(wire >> 3)
  2328. wireType := int(wire & 0x7)
  2329. switch fieldNum {
  2330. case 1:
  2331. if wireType != 2 {
  2332. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  2333. }
  2334. var byteLen int
  2335. for shift := uint(0); ; shift += 7 {
  2336. if iNdEx >= l {
  2337. return io.ErrUnexpectedEOF
  2338. }
  2339. b := data[iNdEx]
  2340. iNdEx++
  2341. byteLen |= (int(b) & 0x7F) << shift
  2342. if b < 0x80 {
  2343. break
  2344. }
  2345. }
  2346. if byteLen < 0 {
  2347. return ErrInvalidLengthRpc
  2348. }
  2349. postIndex := iNdEx + byteLen
  2350. if postIndex > l {
  2351. return io.ErrUnexpectedEOF
  2352. }
  2353. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  2354. iNdEx = postIndex
  2355. case 2:
  2356. if wireType != 2 {
  2357. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  2358. }
  2359. var byteLen int
  2360. for shift := uint(0); ; shift += 7 {
  2361. if iNdEx >= l {
  2362. return io.ErrUnexpectedEOF
  2363. }
  2364. b := data[iNdEx]
  2365. iNdEx++
  2366. byteLen |= (int(b) & 0x7F) << shift
  2367. if b < 0x80 {
  2368. break
  2369. }
  2370. }
  2371. if byteLen < 0 {
  2372. return ErrInvalidLengthRpc
  2373. }
  2374. postIndex := iNdEx + byteLen
  2375. if postIndex > l {
  2376. return io.ErrUnexpectedEOF
  2377. }
  2378. m.Value = append([]byte{}, data[iNdEx:postIndex]...)
  2379. iNdEx = postIndex
  2380. case 3:
  2381. if wireType != 0 {
  2382. return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
  2383. }
  2384. m.Lease = 0
  2385. for shift := uint(0); ; shift += 7 {
  2386. if iNdEx >= l {
  2387. return io.ErrUnexpectedEOF
  2388. }
  2389. b := data[iNdEx]
  2390. iNdEx++
  2391. m.Lease |= (int64(b) & 0x7F) << shift
  2392. if b < 0x80 {
  2393. break
  2394. }
  2395. }
  2396. default:
  2397. var sizeOfWire int
  2398. for {
  2399. sizeOfWire++
  2400. wire >>= 7
  2401. if wire == 0 {
  2402. break
  2403. }
  2404. }
  2405. iNdEx -= sizeOfWire
  2406. skippy, err := skipRpc(data[iNdEx:])
  2407. if err != nil {
  2408. return err
  2409. }
  2410. if skippy < 0 {
  2411. return ErrInvalidLengthRpc
  2412. }
  2413. if (iNdEx + skippy) > l {
  2414. return io.ErrUnexpectedEOF
  2415. }
  2416. iNdEx += skippy
  2417. }
  2418. }
  2419. return nil
  2420. }
  2421. func (m *PutResponse) Unmarshal(data []byte) error {
  2422. l := len(data)
  2423. iNdEx := 0
  2424. for iNdEx < l {
  2425. var wire uint64
  2426. for shift := uint(0); ; shift += 7 {
  2427. if iNdEx >= l {
  2428. return io.ErrUnexpectedEOF
  2429. }
  2430. b := data[iNdEx]
  2431. iNdEx++
  2432. wire |= (uint64(b) & 0x7F) << shift
  2433. if b < 0x80 {
  2434. break
  2435. }
  2436. }
  2437. fieldNum := int32(wire >> 3)
  2438. wireType := int(wire & 0x7)
  2439. switch fieldNum {
  2440. case 1:
  2441. if wireType != 2 {
  2442. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  2443. }
  2444. var msglen int
  2445. for shift := uint(0); ; shift += 7 {
  2446. if iNdEx >= l {
  2447. return io.ErrUnexpectedEOF
  2448. }
  2449. b := data[iNdEx]
  2450. iNdEx++
  2451. msglen |= (int(b) & 0x7F) << shift
  2452. if b < 0x80 {
  2453. break
  2454. }
  2455. }
  2456. if msglen < 0 {
  2457. return ErrInvalidLengthRpc
  2458. }
  2459. postIndex := iNdEx + msglen
  2460. if postIndex > l {
  2461. return io.ErrUnexpectedEOF
  2462. }
  2463. if m.Header == nil {
  2464. m.Header = &ResponseHeader{}
  2465. }
  2466. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2467. return err
  2468. }
  2469. iNdEx = postIndex
  2470. default:
  2471. var sizeOfWire int
  2472. for {
  2473. sizeOfWire++
  2474. wire >>= 7
  2475. if wire == 0 {
  2476. break
  2477. }
  2478. }
  2479. iNdEx -= sizeOfWire
  2480. skippy, err := skipRpc(data[iNdEx:])
  2481. if err != nil {
  2482. return err
  2483. }
  2484. if skippy < 0 {
  2485. return ErrInvalidLengthRpc
  2486. }
  2487. if (iNdEx + skippy) > l {
  2488. return io.ErrUnexpectedEOF
  2489. }
  2490. iNdEx += skippy
  2491. }
  2492. }
  2493. return nil
  2494. }
  2495. func (m *DeleteRangeRequest) Unmarshal(data []byte) error {
  2496. l := len(data)
  2497. iNdEx := 0
  2498. for iNdEx < l {
  2499. var wire uint64
  2500. for shift := uint(0); ; shift += 7 {
  2501. if iNdEx >= l {
  2502. return io.ErrUnexpectedEOF
  2503. }
  2504. b := data[iNdEx]
  2505. iNdEx++
  2506. wire |= (uint64(b) & 0x7F) << shift
  2507. if b < 0x80 {
  2508. break
  2509. }
  2510. }
  2511. fieldNum := int32(wire >> 3)
  2512. wireType := int(wire & 0x7)
  2513. switch fieldNum {
  2514. case 1:
  2515. if wireType != 2 {
  2516. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  2517. }
  2518. var byteLen int
  2519. for shift := uint(0); ; shift += 7 {
  2520. if iNdEx >= l {
  2521. return io.ErrUnexpectedEOF
  2522. }
  2523. b := data[iNdEx]
  2524. iNdEx++
  2525. byteLen |= (int(b) & 0x7F) << shift
  2526. if b < 0x80 {
  2527. break
  2528. }
  2529. }
  2530. if byteLen < 0 {
  2531. return ErrInvalidLengthRpc
  2532. }
  2533. postIndex := iNdEx + byteLen
  2534. if postIndex > l {
  2535. return io.ErrUnexpectedEOF
  2536. }
  2537. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  2538. iNdEx = postIndex
  2539. case 2:
  2540. if wireType != 2 {
  2541. return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType)
  2542. }
  2543. var byteLen int
  2544. for shift := uint(0); ; shift += 7 {
  2545. if iNdEx >= l {
  2546. return io.ErrUnexpectedEOF
  2547. }
  2548. b := data[iNdEx]
  2549. iNdEx++
  2550. byteLen |= (int(b) & 0x7F) << shift
  2551. if b < 0x80 {
  2552. break
  2553. }
  2554. }
  2555. if byteLen < 0 {
  2556. return ErrInvalidLengthRpc
  2557. }
  2558. postIndex := iNdEx + byteLen
  2559. if postIndex > l {
  2560. return io.ErrUnexpectedEOF
  2561. }
  2562. m.RangeEnd = append([]byte{}, data[iNdEx:postIndex]...)
  2563. iNdEx = postIndex
  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 *DeleteRangeResponse) 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 *RequestUnion) 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 RequestRange", wireType)
  2685. }
  2686. var msglen int
  2687. for shift := uint(0); ; shift += 7 {
  2688. if iNdEx >= l {
  2689. return io.ErrUnexpectedEOF
  2690. }
  2691. b := data[iNdEx]
  2692. iNdEx++
  2693. msglen |= (int(b) & 0x7F) << shift
  2694. if b < 0x80 {
  2695. break
  2696. }
  2697. }
  2698. if msglen < 0 {
  2699. return ErrInvalidLengthRpc
  2700. }
  2701. postIndex := iNdEx + msglen
  2702. if postIndex > l {
  2703. return io.ErrUnexpectedEOF
  2704. }
  2705. if m.RequestRange == nil {
  2706. m.RequestRange = &RangeRequest{}
  2707. }
  2708. if err := m.RequestRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2709. return err
  2710. }
  2711. iNdEx = postIndex
  2712. case 2:
  2713. if wireType != 2 {
  2714. return fmt.Errorf("proto: wrong wireType = %d for field RequestPut", wireType)
  2715. }
  2716. var msglen int
  2717. for shift := uint(0); ; shift += 7 {
  2718. if iNdEx >= l {
  2719. return io.ErrUnexpectedEOF
  2720. }
  2721. b := data[iNdEx]
  2722. iNdEx++
  2723. msglen |= (int(b) & 0x7F) << shift
  2724. if b < 0x80 {
  2725. break
  2726. }
  2727. }
  2728. if msglen < 0 {
  2729. return ErrInvalidLengthRpc
  2730. }
  2731. postIndex := iNdEx + msglen
  2732. if postIndex > l {
  2733. return io.ErrUnexpectedEOF
  2734. }
  2735. if m.RequestPut == nil {
  2736. m.RequestPut = &PutRequest{}
  2737. }
  2738. if err := m.RequestPut.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2739. return err
  2740. }
  2741. iNdEx = postIndex
  2742. case 3:
  2743. if wireType != 2 {
  2744. return fmt.Errorf("proto: wrong wireType = %d for field RequestDeleteRange", wireType)
  2745. }
  2746. var msglen int
  2747. for shift := uint(0); ; shift += 7 {
  2748. if iNdEx >= l {
  2749. return io.ErrUnexpectedEOF
  2750. }
  2751. b := data[iNdEx]
  2752. iNdEx++
  2753. msglen |= (int(b) & 0x7F) << shift
  2754. if b < 0x80 {
  2755. break
  2756. }
  2757. }
  2758. if msglen < 0 {
  2759. return ErrInvalidLengthRpc
  2760. }
  2761. postIndex := iNdEx + msglen
  2762. if postIndex > l {
  2763. return io.ErrUnexpectedEOF
  2764. }
  2765. if m.RequestDeleteRange == nil {
  2766. m.RequestDeleteRange = &DeleteRangeRequest{}
  2767. }
  2768. if err := m.RequestDeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2769. return err
  2770. }
  2771. iNdEx = postIndex
  2772. default:
  2773. var sizeOfWire int
  2774. for {
  2775. sizeOfWire++
  2776. wire >>= 7
  2777. if wire == 0 {
  2778. break
  2779. }
  2780. }
  2781. iNdEx -= sizeOfWire
  2782. skippy, err := skipRpc(data[iNdEx:])
  2783. if err != nil {
  2784. return err
  2785. }
  2786. if skippy < 0 {
  2787. return ErrInvalidLengthRpc
  2788. }
  2789. if (iNdEx + skippy) > l {
  2790. return io.ErrUnexpectedEOF
  2791. }
  2792. iNdEx += skippy
  2793. }
  2794. }
  2795. return nil
  2796. }
  2797. func (m *ResponseUnion) Unmarshal(data []byte) error {
  2798. l := len(data)
  2799. iNdEx := 0
  2800. for iNdEx < l {
  2801. var wire uint64
  2802. for shift := uint(0); ; shift += 7 {
  2803. if iNdEx >= l {
  2804. return io.ErrUnexpectedEOF
  2805. }
  2806. b := data[iNdEx]
  2807. iNdEx++
  2808. wire |= (uint64(b) & 0x7F) << shift
  2809. if b < 0x80 {
  2810. break
  2811. }
  2812. }
  2813. fieldNum := int32(wire >> 3)
  2814. wireType := int(wire & 0x7)
  2815. switch fieldNum {
  2816. case 1:
  2817. if wireType != 2 {
  2818. return fmt.Errorf("proto: wrong wireType = %d for field ResponseRange", wireType)
  2819. }
  2820. var msglen int
  2821. for shift := uint(0); ; shift += 7 {
  2822. if iNdEx >= l {
  2823. return io.ErrUnexpectedEOF
  2824. }
  2825. b := data[iNdEx]
  2826. iNdEx++
  2827. msglen |= (int(b) & 0x7F) << shift
  2828. if b < 0x80 {
  2829. break
  2830. }
  2831. }
  2832. if msglen < 0 {
  2833. return ErrInvalidLengthRpc
  2834. }
  2835. postIndex := iNdEx + msglen
  2836. if postIndex > l {
  2837. return io.ErrUnexpectedEOF
  2838. }
  2839. if m.ResponseRange == nil {
  2840. m.ResponseRange = &RangeResponse{}
  2841. }
  2842. if err := m.ResponseRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2843. return err
  2844. }
  2845. iNdEx = postIndex
  2846. case 2:
  2847. if wireType != 2 {
  2848. return fmt.Errorf("proto: wrong wireType = %d for field ResponsePut", wireType)
  2849. }
  2850. var msglen int
  2851. for shift := uint(0); ; shift += 7 {
  2852. if iNdEx >= l {
  2853. return io.ErrUnexpectedEOF
  2854. }
  2855. b := data[iNdEx]
  2856. iNdEx++
  2857. msglen |= (int(b) & 0x7F) << shift
  2858. if b < 0x80 {
  2859. break
  2860. }
  2861. }
  2862. if msglen < 0 {
  2863. return ErrInvalidLengthRpc
  2864. }
  2865. postIndex := iNdEx + msglen
  2866. if postIndex > l {
  2867. return io.ErrUnexpectedEOF
  2868. }
  2869. if m.ResponsePut == nil {
  2870. m.ResponsePut = &PutResponse{}
  2871. }
  2872. if err := m.ResponsePut.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2873. return err
  2874. }
  2875. iNdEx = postIndex
  2876. case 3:
  2877. if wireType != 2 {
  2878. return fmt.Errorf("proto: wrong wireType = %d for field ResponseDeleteRange", wireType)
  2879. }
  2880. var msglen int
  2881. for shift := uint(0); ; shift += 7 {
  2882. if iNdEx >= l {
  2883. return io.ErrUnexpectedEOF
  2884. }
  2885. b := data[iNdEx]
  2886. iNdEx++
  2887. msglen |= (int(b) & 0x7F) << shift
  2888. if b < 0x80 {
  2889. break
  2890. }
  2891. }
  2892. if msglen < 0 {
  2893. return ErrInvalidLengthRpc
  2894. }
  2895. postIndex := iNdEx + msglen
  2896. if postIndex > l {
  2897. return io.ErrUnexpectedEOF
  2898. }
  2899. if m.ResponseDeleteRange == nil {
  2900. m.ResponseDeleteRange = &DeleteRangeResponse{}
  2901. }
  2902. if err := m.ResponseDeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2903. return err
  2904. }
  2905. iNdEx = postIndex
  2906. default:
  2907. var sizeOfWire int
  2908. for {
  2909. sizeOfWire++
  2910. wire >>= 7
  2911. if wire == 0 {
  2912. break
  2913. }
  2914. }
  2915. iNdEx -= sizeOfWire
  2916. skippy, err := skipRpc(data[iNdEx:])
  2917. if err != nil {
  2918. return err
  2919. }
  2920. if skippy < 0 {
  2921. return ErrInvalidLengthRpc
  2922. }
  2923. if (iNdEx + skippy) > l {
  2924. return io.ErrUnexpectedEOF
  2925. }
  2926. iNdEx += skippy
  2927. }
  2928. }
  2929. return nil
  2930. }
  2931. func (m *Compare) Unmarshal(data []byte) error {
  2932. l := len(data)
  2933. iNdEx := 0
  2934. for iNdEx < l {
  2935. var wire uint64
  2936. for shift := uint(0); ; shift += 7 {
  2937. if iNdEx >= l {
  2938. return io.ErrUnexpectedEOF
  2939. }
  2940. b := data[iNdEx]
  2941. iNdEx++
  2942. wire |= (uint64(b) & 0x7F) << shift
  2943. if b < 0x80 {
  2944. break
  2945. }
  2946. }
  2947. fieldNum := int32(wire >> 3)
  2948. wireType := int(wire & 0x7)
  2949. switch fieldNum {
  2950. case 1:
  2951. if wireType != 0 {
  2952. return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType)
  2953. }
  2954. m.Result = 0
  2955. for shift := uint(0); ; shift += 7 {
  2956. if iNdEx >= l {
  2957. return io.ErrUnexpectedEOF
  2958. }
  2959. b := data[iNdEx]
  2960. iNdEx++
  2961. m.Result |= (Compare_CompareResult(b) & 0x7F) << shift
  2962. if b < 0x80 {
  2963. break
  2964. }
  2965. }
  2966. case 2:
  2967. if wireType != 0 {
  2968. return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
  2969. }
  2970. m.Target = 0
  2971. for shift := uint(0); ; shift += 7 {
  2972. if iNdEx >= l {
  2973. return io.ErrUnexpectedEOF
  2974. }
  2975. b := data[iNdEx]
  2976. iNdEx++
  2977. m.Target |= (Compare_CompareTarget(b) & 0x7F) << shift
  2978. if b < 0x80 {
  2979. break
  2980. }
  2981. }
  2982. case 3:
  2983. if wireType != 2 {
  2984. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  2985. }
  2986. var byteLen int
  2987. for shift := uint(0); ; shift += 7 {
  2988. if iNdEx >= l {
  2989. return io.ErrUnexpectedEOF
  2990. }
  2991. b := data[iNdEx]
  2992. iNdEx++
  2993. byteLen |= (int(b) & 0x7F) << shift
  2994. if b < 0x80 {
  2995. break
  2996. }
  2997. }
  2998. if byteLen < 0 {
  2999. return ErrInvalidLengthRpc
  3000. }
  3001. postIndex := iNdEx + byteLen
  3002. if postIndex > l {
  3003. return io.ErrUnexpectedEOF
  3004. }
  3005. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  3006. iNdEx = postIndex
  3007. case 4:
  3008. if wireType != 0 {
  3009. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  3010. }
  3011. m.Version = 0
  3012. for shift := uint(0); ; shift += 7 {
  3013. if iNdEx >= l {
  3014. return io.ErrUnexpectedEOF
  3015. }
  3016. b := data[iNdEx]
  3017. iNdEx++
  3018. m.Version |= (int64(b) & 0x7F) << shift
  3019. if b < 0x80 {
  3020. break
  3021. }
  3022. }
  3023. case 5:
  3024. if wireType != 0 {
  3025. return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType)
  3026. }
  3027. m.CreateRevision = 0
  3028. for shift := uint(0); ; shift += 7 {
  3029. if iNdEx >= l {
  3030. return io.ErrUnexpectedEOF
  3031. }
  3032. b := data[iNdEx]
  3033. iNdEx++
  3034. m.CreateRevision |= (int64(b) & 0x7F) << shift
  3035. if b < 0x80 {
  3036. break
  3037. }
  3038. }
  3039. case 6:
  3040. if wireType != 0 {
  3041. return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType)
  3042. }
  3043. m.ModRevision = 0
  3044. for shift := uint(0); ; shift += 7 {
  3045. if iNdEx >= l {
  3046. return io.ErrUnexpectedEOF
  3047. }
  3048. b := data[iNdEx]
  3049. iNdEx++
  3050. m.ModRevision |= (int64(b) & 0x7F) << shift
  3051. if b < 0x80 {
  3052. break
  3053. }
  3054. }
  3055. case 7:
  3056. if wireType != 2 {
  3057. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  3058. }
  3059. var byteLen int
  3060. for shift := uint(0); ; shift += 7 {
  3061. if iNdEx >= l {
  3062. return io.ErrUnexpectedEOF
  3063. }
  3064. b := data[iNdEx]
  3065. iNdEx++
  3066. byteLen |= (int(b) & 0x7F) << shift
  3067. if b < 0x80 {
  3068. break
  3069. }
  3070. }
  3071. if byteLen < 0 {
  3072. return ErrInvalidLengthRpc
  3073. }
  3074. postIndex := iNdEx + byteLen
  3075. if postIndex > l {
  3076. return io.ErrUnexpectedEOF
  3077. }
  3078. m.Value = append([]byte{}, data[iNdEx:postIndex]...)
  3079. iNdEx = postIndex
  3080. default:
  3081. var sizeOfWire int
  3082. for {
  3083. sizeOfWire++
  3084. wire >>= 7
  3085. if wire == 0 {
  3086. break
  3087. }
  3088. }
  3089. iNdEx -= sizeOfWire
  3090. skippy, err := skipRpc(data[iNdEx:])
  3091. if err != nil {
  3092. return err
  3093. }
  3094. if skippy < 0 {
  3095. return ErrInvalidLengthRpc
  3096. }
  3097. if (iNdEx + skippy) > l {
  3098. return io.ErrUnexpectedEOF
  3099. }
  3100. iNdEx += skippy
  3101. }
  3102. }
  3103. return nil
  3104. }
  3105. func (m *TxnRequest) Unmarshal(data []byte) error {
  3106. l := len(data)
  3107. iNdEx := 0
  3108. for iNdEx < l {
  3109. var wire uint64
  3110. for shift := uint(0); ; shift += 7 {
  3111. if iNdEx >= l {
  3112. return io.ErrUnexpectedEOF
  3113. }
  3114. b := data[iNdEx]
  3115. iNdEx++
  3116. wire |= (uint64(b) & 0x7F) << shift
  3117. if b < 0x80 {
  3118. break
  3119. }
  3120. }
  3121. fieldNum := int32(wire >> 3)
  3122. wireType := int(wire & 0x7)
  3123. switch fieldNum {
  3124. case 1:
  3125. if wireType != 2 {
  3126. return fmt.Errorf("proto: wrong wireType = %d for field Compare", wireType)
  3127. }
  3128. var msglen int
  3129. for shift := uint(0); ; shift += 7 {
  3130. if iNdEx >= l {
  3131. return io.ErrUnexpectedEOF
  3132. }
  3133. b := data[iNdEx]
  3134. iNdEx++
  3135. msglen |= (int(b) & 0x7F) << shift
  3136. if b < 0x80 {
  3137. break
  3138. }
  3139. }
  3140. if msglen < 0 {
  3141. return ErrInvalidLengthRpc
  3142. }
  3143. postIndex := iNdEx + msglen
  3144. if postIndex > l {
  3145. return io.ErrUnexpectedEOF
  3146. }
  3147. m.Compare = append(m.Compare, &Compare{})
  3148. if err := m.Compare[len(m.Compare)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  3149. return err
  3150. }
  3151. iNdEx = postIndex
  3152. case 2:
  3153. if wireType != 2 {
  3154. return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType)
  3155. }
  3156. var msglen int
  3157. for shift := uint(0); ; shift += 7 {
  3158. if iNdEx >= l {
  3159. return io.ErrUnexpectedEOF
  3160. }
  3161. b := data[iNdEx]
  3162. iNdEx++
  3163. msglen |= (int(b) & 0x7F) << shift
  3164. if b < 0x80 {
  3165. break
  3166. }
  3167. }
  3168. if msglen < 0 {
  3169. return ErrInvalidLengthRpc
  3170. }
  3171. postIndex := iNdEx + msglen
  3172. if postIndex > l {
  3173. return io.ErrUnexpectedEOF
  3174. }
  3175. m.Success = append(m.Success, &RequestUnion{})
  3176. if err := m.Success[len(m.Success)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  3177. return err
  3178. }
  3179. iNdEx = postIndex
  3180. case 3:
  3181. if wireType != 2 {
  3182. return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType)
  3183. }
  3184. var msglen int
  3185. for shift := uint(0); ; shift += 7 {
  3186. if iNdEx >= l {
  3187. return io.ErrUnexpectedEOF
  3188. }
  3189. b := data[iNdEx]
  3190. iNdEx++
  3191. msglen |= (int(b) & 0x7F) << shift
  3192. if b < 0x80 {
  3193. break
  3194. }
  3195. }
  3196. if msglen < 0 {
  3197. return ErrInvalidLengthRpc
  3198. }
  3199. postIndex := iNdEx + msglen
  3200. if postIndex > l {
  3201. return io.ErrUnexpectedEOF
  3202. }
  3203. m.Failure = append(m.Failure, &RequestUnion{})
  3204. if err := m.Failure[len(m.Failure)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  3205. return err
  3206. }
  3207. iNdEx = postIndex
  3208. default:
  3209. var sizeOfWire int
  3210. for {
  3211. sizeOfWire++
  3212. wire >>= 7
  3213. if wire == 0 {
  3214. break
  3215. }
  3216. }
  3217. iNdEx -= sizeOfWire
  3218. skippy, err := skipRpc(data[iNdEx:])
  3219. if err != nil {
  3220. return err
  3221. }
  3222. if skippy < 0 {
  3223. return ErrInvalidLengthRpc
  3224. }
  3225. if (iNdEx + skippy) > l {
  3226. return io.ErrUnexpectedEOF
  3227. }
  3228. iNdEx += skippy
  3229. }
  3230. }
  3231. return nil
  3232. }
  3233. func (m *TxnResponse) Unmarshal(data []byte) error {
  3234. l := len(data)
  3235. iNdEx := 0
  3236. for iNdEx < l {
  3237. var wire uint64
  3238. for shift := uint(0); ; shift += 7 {
  3239. if iNdEx >= l {
  3240. return io.ErrUnexpectedEOF
  3241. }
  3242. b := data[iNdEx]
  3243. iNdEx++
  3244. wire |= (uint64(b) & 0x7F) << shift
  3245. if b < 0x80 {
  3246. break
  3247. }
  3248. }
  3249. fieldNum := int32(wire >> 3)
  3250. wireType := int(wire & 0x7)
  3251. switch fieldNum {
  3252. case 1:
  3253. if wireType != 2 {
  3254. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  3255. }
  3256. var msglen int
  3257. for shift := uint(0); ; shift += 7 {
  3258. if iNdEx >= l {
  3259. return io.ErrUnexpectedEOF
  3260. }
  3261. b := data[iNdEx]
  3262. iNdEx++
  3263. msglen |= (int(b) & 0x7F) << shift
  3264. if b < 0x80 {
  3265. break
  3266. }
  3267. }
  3268. if msglen < 0 {
  3269. return ErrInvalidLengthRpc
  3270. }
  3271. postIndex := iNdEx + msglen
  3272. if postIndex > l {
  3273. return io.ErrUnexpectedEOF
  3274. }
  3275. if m.Header == nil {
  3276. m.Header = &ResponseHeader{}
  3277. }
  3278. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3279. return err
  3280. }
  3281. iNdEx = postIndex
  3282. case 2:
  3283. if wireType != 0 {
  3284. return fmt.Errorf("proto: wrong wireType = %d for field Succeeded", wireType)
  3285. }
  3286. var v int
  3287. for shift := uint(0); ; shift += 7 {
  3288. if iNdEx >= l {
  3289. return io.ErrUnexpectedEOF
  3290. }
  3291. b := data[iNdEx]
  3292. iNdEx++
  3293. v |= (int(b) & 0x7F) << shift
  3294. if b < 0x80 {
  3295. break
  3296. }
  3297. }
  3298. m.Succeeded = bool(v != 0)
  3299. case 3:
  3300. if wireType != 2 {
  3301. return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType)
  3302. }
  3303. var msglen int
  3304. for shift := uint(0); ; shift += 7 {
  3305. if iNdEx >= l {
  3306. return io.ErrUnexpectedEOF
  3307. }
  3308. b := data[iNdEx]
  3309. iNdEx++
  3310. msglen |= (int(b) & 0x7F) << shift
  3311. if b < 0x80 {
  3312. break
  3313. }
  3314. }
  3315. if msglen < 0 {
  3316. return ErrInvalidLengthRpc
  3317. }
  3318. postIndex := iNdEx + msglen
  3319. if postIndex > l {
  3320. return io.ErrUnexpectedEOF
  3321. }
  3322. m.Responses = append(m.Responses, &ResponseUnion{})
  3323. if err := m.Responses[len(m.Responses)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  3324. return err
  3325. }
  3326. iNdEx = postIndex
  3327. default:
  3328. var sizeOfWire int
  3329. for {
  3330. sizeOfWire++
  3331. wire >>= 7
  3332. if wire == 0 {
  3333. break
  3334. }
  3335. }
  3336. iNdEx -= sizeOfWire
  3337. skippy, err := skipRpc(data[iNdEx:])
  3338. if err != nil {
  3339. return err
  3340. }
  3341. if skippy < 0 {
  3342. return ErrInvalidLengthRpc
  3343. }
  3344. if (iNdEx + skippy) > l {
  3345. return io.ErrUnexpectedEOF
  3346. }
  3347. iNdEx += skippy
  3348. }
  3349. }
  3350. return nil
  3351. }
  3352. func (m *CompactionRequest) Unmarshal(data []byte) error {
  3353. l := len(data)
  3354. iNdEx := 0
  3355. for iNdEx < l {
  3356. var wire uint64
  3357. for shift := uint(0); ; shift += 7 {
  3358. if iNdEx >= l {
  3359. return io.ErrUnexpectedEOF
  3360. }
  3361. b := data[iNdEx]
  3362. iNdEx++
  3363. wire |= (uint64(b) & 0x7F) << shift
  3364. if b < 0x80 {
  3365. break
  3366. }
  3367. }
  3368. fieldNum := int32(wire >> 3)
  3369. wireType := int(wire & 0x7)
  3370. switch fieldNum {
  3371. case 1:
  3372. if wireType != 0 {
  3373. return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
  3374. }
  3375. m.Revision = 0
  3376. for shift := uint(0); ; shift += 7 {
  3377. if iNdEx >= l {
  3378. return io.ErrUnexpectedEOF
  3379. }
  3380. b := data[iNdEx]
  3381. iNdEx++
  3382. m.Revision |= (int64(b) & 0x7F) << shift
  3383. if b < 0x80 {
  3384. break
  3385. }
  3386. }
  3387. default:
  3388. var sizeOfWire int
  3389. for {
  3390. sizeOfWire++
  3391. wire >>= 7
  3392. if wire == 0 {
  3393. break
  3394. }
  3395. }
  3396. iNdEx -= sizeOfWire
  3397. skippy, err := skipRpc(data[iNdEx:])
  3398. if err != nil {
  3399. return err
  3400. }
  3401. if skippy < 0 {
  3402. return ErrInvalidLengthRpc
  3403. }
  3404. if (iNdEx + skippy) > l {
  3405. return io.ErrUnexpectedEOF
  3406. }
  3407. iNdEx += skippy
  3408. }
  3409. }
  3410. return nil
  3411. }
  3412. func (m *CompactionResponse) Unmarshal(data []byte) error {
  3413. l := len(data)
  3414. iNdEx := 0
  3415. for iNdEx < l {
  3416. var wire uint64
  3417. for shift := uint(0); ; shift += 7 {
  3418. if iNdEx >= l {
  3419. return io.ErrUnexpectedEOF
  3420. }
  3421. b := data[iNdEx]
  3422. iNdEx++
  3423. wire |= (uint64(b) & 0x7F) << shift
  3424. if b < 0x80 {
  3425. break
  3426. }
  3427. }
  3428. fieldNum := int32(wire >> 3)
  3429. wireType := int(wire & 0x7)
  3430. switch fieldNum {
  3431. case 1:
  3432. if wireType != 2 {
  3433. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  3434. }
  3435. var msglen int
  3436. for shift := uint(0); ; shift += 7 {
  3437. if iNdEx >= l {
  3438. return io.ErrUnexpectedEOF
  3439. }
  3440. b := data[iNdEx]
  3441. iNdEx++
  3442. msglen |= (int(b) & 0x7F) << shift
  3443. if b < 0x80 {
  3444. break
  3445. }
  3446. }
  3447. if msglen < 0 {
  3448. return ErrInvalidLengthRpc
  3449. }
  3450. postIndex := iNdEx + msglen
  3451. if postIndex > l {
  3452. return io.ErrUnexpectedEOF
  3453. }
  3454. if m.Header == nil {
  3455. m.Header = &ResponseHeader{}
  3456. }
  3457. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3458. return err
  3459. }
  3460. iNdEx = postIndex
  3461. default:
  3462. var sizeOfWire int
  3463. for {
  3464. sizeOfWire++
  3465. wire >>= 7
  3466. if wire == 0 {
  3467. break
  3468. }
  3469. }
  3470. iNdEx -= sizeOfWire
  3471. skippy, err := skipRpc(data[iNdEx:])
  3472. if err != nil {
  3473. return err
  3474. }
  3475. if skippy < 0 {
  3476. return ErrInvalidLengthRpc
  3477. }
  3478. if (iNdEx + skippy) > l {
  3479. return io.ErrUnexpectedEOF
  3480. }
  3481. iNdEx += skippy
  3482. }
  3483. }
  3484. return nil
  3485. }
  3486. func (m *WatchRequest) Unmarshal(data []byte) error {
  3487. l := len(data)
  3488. iNdEx := 0
  3489. for iNdEx < l {
  3490. var wire uint64
  3491. for shift := uint(0); ; shift += 7 {
  3492. if iNdEx >= l {
  3493. return io.ErrUnexpectedEOF
  3494. }
  3495. b := data[iNdEx]
  3496. iNdEx++
  3497. wire |= (uint64(b) & 0x7F) << shift
  3498. if b < 0x80 {
  3499. break
  3500. }
  3501. }
  3502. fieldNum := int32(wire >> 3)
  3503. wireType := int(wire & 0x7)
  3504. switch fieldNum {
  3505. case 1:
  3506. if wireType != 2 {
  3507. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  3508. }
  3509. var byteLen int
  3510. for shift := uint(0); ; shift += 7 {
  3511. if iNdEx >= l {
  3512. return io.ErrUnexpectedEOF
  3513. }
  3514. b := data[iNdEx]
  3515. iNdEx++
  3516. byteLen |= (int(b) & 0x7F) << shift
  3517. if b < 0x80 {
  3518. break
  3519. }
  3520. }
  3521. if byteLen < 0 {
  3522. return ErrInvalidLengthRpc
  3523. }
  3524. postIndex := iNdEx + byteLen
  3525. if postIndex > l {
  3526. return io.ErrUnexpectedEOF
  3527. }
  3528. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  3529. iNdEx = postIndex
  3530. case 2:
  3531. if wireType != 2 {
  3532. return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType)
  3533. }
  3534. var byteLen int
  3535. for shift := uint(0); ; shift += 7 {
  3536. if iNdEx >= l {
  3537. return io.ErrUnexpectedEOF
  3538. }
  3539. b := data[iNdEx]
  3540. iNdEx++
  3541. byteLen |= (int(b) & 0x7F) << shift
  3542. if b < 0x80 {
  3543. break
  3544. }
  3545. }
  3546. if byteLen < 0 {
  3547. return ErrInvalidLengthRpc
  3548. }
  3549. postIndex := iNdEx + byteLen
  3550. if postIndex > l {
  3551. return io.ErrUnexpectedEOF
  3552. }
  3553. m.Prefix = append([]byte{}, data[iNdEx:postIndex]...)
  3554. iNdEx = postIndex
  3555. case 3:
  3556. if wireType != 0 {
  3557. return fmt.Errorf("proto: wrong wireType = %d for field StartRevision", wireType)
  3558. }
  3559. m.StartRevision = 0
  3560. for shift := uint(0); ; shift += 7 {
  3561. if iNdEx >= l {
  3562. return io.ErrUnexpectedEOF
  3563. }
  3564. b := data[iNdEx]
  3565. iNdEx++
  3566. m.StartRevision |= (int64(b) & 0x7F) << shift
  3567. if b < 0x80 {
  3568. break
  3569. }
  3570. }
  3571. default:
  3572. var sizeOfWire int
  3573. for {
  3574. sizeOfWire++
  3575. wire >>= 7
  3576. if wire == 0 {
  3577. break
  3578. }
  3579. }
  3580. iNdEx -= sizeOfWire
  3581. skippy, err := skipRpc(data[iNdEx:])
  3582. if err != nil {
  3583. return err
  3584. }
  3585. if skippy < 0 {
  3586. return ErrInvalidLengthRpc
  3587. }
  3588. if (iNdEx + skippy) > l {
  3589. return io.ErrUnexpectedEOF
  3590. }
  3591. iNdEx += skippy
  3592. }
  3593. }
  3594. return nil
  3595. }
  3596. func (m *WatchResponse) Unmarshal(data []byte) error {
  3597. l := len(data)
  3598. iNdEx := 0
  3599. for iNdEx < l {
  3600. var wire uint64
  3601. for shift := uint(0); ; shift += 7 {
  3602. if iNdEx >= l {
  3603. return io.ErrUnexpectedEOF
  3604. }
  3605. b := data[iNdEx]
  3606. iNdEx++
  3607. wire |= (uint64(b) & 0x7F) << shift
  3608. if b < 0x80 {
  3609. break
  3610. }
  3611. }
  3612. fieldNum := int32(wire >> 3)
  3613. wireType := int(wire & 0x7)
  3614. switch fieldNum {
  3615. case 1:
  3616. if wireType != 2 {
  3617. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  3618. }
  3619. var msglen int
  3620. for shift := uint(0); ; shift += 7 {
  3621. if iNdEx >= l {
  3622. return io.ErrUnexpectedEOF
  3623. }
  3624. b := data[iNdEx]
  3625. iNdEx++
  3626. msglen |= (int(b) & 0x7F) << shift
  3627. if b < 0x80 {
  3628. break
  3629. }
  3630. }
  3631. if msglen < 0 {
  3632. return ErrInvalidLengthRpc
  3633. }
  3634. postIndex := iNdEx + msglen
  3635. if postIndex > l {
  3636. return io.ErrUnexpectedEOF
  3637. }
  3638. if m.Header == nil {
  3639. m.Header = &ResponseHeader{}
  3640. }
  3641. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3642. return err
  3643. }
  3644. iNdEx = postIndex
  3645. case 2:
  3646. if wireType != 2 {
  3647. return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType)
  3648. }
  3649. var msglen int
  3650. for shift := uint(0); ; shift += 7 {
  3651. if iNdEx >= l {
  3652. return io.ErrUnexpectedEOF
  3653. }
  3654. b := data[iNdEx]
  3655. iNdEx++
  3656. msglen |= (int(b) & 0x7F) << shift
  3657. if b < 0x80 {
  3658. break
  3659. }
  3660. }
  3661. if msglen < 0 {
  3662. return ErrInvalidLengthRpc
  3663. }
  3664. postIndex := iNdEx + msglen
  3665. if postIndex > l {
  3666. return io.ErrUnexpectedEOF
  3667. }
  3668. m.Events = append(m.Events, &storagepb.Event{})
  3669. if err := m.Events[len(m.Events)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  3670. return err
  3671. }
  3672. iNdEx = postIndex
  3673. default:
  3674. var sizeOfWire int
  3675. for {
  3676. sizeOfWire++
  3677. wire >>= 7
  3678. if wire == 0 {
  3679. break
  3680. }
  3681. }
  3682. iNdEx -= sizeOfWire
  3683. skippy, err := skipRpc(data[iNdEx:])
  3684. if err != nil {
  3685. return err
  3686. }
  3687. if skippy < 0 {
  3688. return ErrInvalidLengthRpc
  3689. }
  3690. if (iNdEx + skippy) > l {
  3691. return io.ErrUnexpectedEOF
  3692. }
  3693. iNdEx += skippy
  3694. }
  3695. }
  3696. return nil
  3697. }
  3698. func (m *LeaseCreateRequest) Unmarshal(data []byte) error {
  3699. l := len(data)
  3700. iNdEx := 0
  3701. for iNdEx < l {
  3702. var wire uint64
  3703. for shift := uint(0); ; shift += 7 {
  3704. if iNdEx >= l {
  3705. return io.ErrUnexpectedEOF
  3706. }
  3707. b := data[iNdEx]
  3708. iNdEx++
  3709. wire |= (uint64(b) & 0x7F) << shift
  3710. if b < 0x80 {
  3711. break
  3712. }
  3713. }
  3714. fieldNum := int32(wire >> 3)
  3715. wireType := int(wire & 0x7)
  3716. switch fieldNum {
  3717. case 1:
  3718. if wireType != 0 {
  3719. return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType)
  3720. }
  3721. m.Ttl = 0
  3722. for shift := uint(0); ; shift += 7 {
  3723. if iNdEx >= l {
  3724. return io.ErrUnexpectedEOF
  3725. }
  3726. b := data[iNdEx]
  3727. iNdEx++
  3728. m.Ttl |= (int64(b) & 0x7F) << shift
  3729. if b < 0x80 {
  3730. break
  3731. }
  3732. }
  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 *LeaseCreateResponse) 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 Header", wireType)
  3780. }
  3781. var msglen int
  3782. for shift := uint(0); ; shift += 7 {
  3783. if iNdEx >= l {
  3784. return io.ErrUnexpectedEOF
  3785. }
  3786. b := data[iNdEx]
  3787. iNdEx++
  3788. msglen |= (int(b) & 0x7F) << shift
  3789. if b < 0x80 {
  3790. break
  3791. }
  3792. }
  3793. if msglen < 0 {
  3794. return ErrInvalidLengthRpc
  3795. }
  3796. postIndex := iNdEx + msglen
  3797. if postIndex > l {
  3798. return io.ErrUnexpectedEOF
  3799. }
  3800. if m.Header == nil {
  3801. m.Header = &ResponseHeader{}
  3802. }
  3803. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3804. return err
  3805. }
  3806. iNdEx = postIndex
  3807. case 2:
  3808. if wireType != 0 {
  3809. return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
  3810. }
  3811. m.LeaseId = 0
  3812. for shift := uint(0); ; shift += 7 {
  3813. if iNdEx >= l {
  3814. return io.ErrUnexpectedEOF
  3815. }
  3816. b := data[iNdEx]
  3817. iNdEx++
  3818. m.LeaseId |= (int64(b) & 0x7F) << shift
  3819. if b < 0x80 {
  3820. break
  3821. }
  3822. }
  3823. case 3:
  3824. if wireType != 0 {
  3825. return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType)
  3826. }
  3827. m.Ttl = 0
  3828. for shift := uint(0); ; shift += 7 {
  3829. if iNdEx >= l {
  3830. return io.ErrUnexpectedEOF
  3831. }
  3832. b := data[iNdEx]
  3833. iNdEx++
  3834. m.Ttl |= (int64(b) & 0x7F) << shift
  3835. if b < 0x80 {
  3836. break
  3837. }
  3838. }
  3839. case 4:
  3840. if wireType != 2 {
  3841. return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType)
  3842. }
  3843. var stringLen uint64
  3844. for shift := uint(0); ; shift += 7 {
  3845. if iNdEx >= l {
  3846. return io.ErrUnexpectedEOF
  3847. }
  3848. b := data[iNdEx]
  3849. iNdEx++
  3850. stringLen |= (uint64(b) & 0x7F) << shift
  3851. if b < 0x80 {
  3852. break
  3853. }
  3854. }
  3855. intStringLen := int(stringLen)
  3856. if intStringLen < 0 {
  3857. return ErrInvalidLengthRpc
  3858. }
  3859. postIndex := iNdEx + intStringLen
  3860. if postIndex > l {
  3861. return io.ErrUnexpectedEOF
  3862. }
  3863. m.Error = string(data[iNdEx:postIndex])
  3864. iNdEx = postIndex
  3865. default:
  3866. var sizeOfWire int
  3867. for {
  3868. sizeOfWire++
  3869. wire >>= 7
  3870. if wire == 0 {
  3871. break
  3872. }
  3873. }
  3874. iNdEx -= sizeOfWire
  3875. skippy, err := skipRpc(data[iNdEx:])
  3876. if err != nil {
  3877. return err
  3878. }
  3879. if skippy < 0 {
  3880. return ErrInvalidLengthRpc
  3881. }
  3882. if (iNdEx + skippy) > l {
  3883. return io.ErrUnexpectedEOF
  3884. }
  3885. iNdEx += skippy
  3886. }
  3887. }
  3888. return nil
  3889. }
  3890. func (m *LeaseRevokeRequest) Unmarshal(data []byte) error {
  3891. l := len(data)
  3892. iNdEx := 0
  3893. for iNdEx < l {
  3894. var wire uint64
  3895. for shift := uint(0); ; shift += 7 {
  3896. if iNdEx >= l {
  3897. return io.ErrUnexpectedEOF
  3898. }
  3899. b := data[iNdEx]
  3900. iNdEx++
  3901. wire |= (uint64(b) & 0x7F) << shift
  3902. if b < 0x80 {
  3903. break
  3904. }
  3905. }
  3906. fieldNum := int32(wire >> 3)
  3907. wireType := int(wire & 0x7)
  3908. switch fieldNum {
  3909. case 1:
  3910. if wireType != 0 {
  3911. return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
  3912. }
  3913. m.LeaseId = 0
  3914. for shift := uint(0); ; shift += 7 {
  3915. if iNdEx >= l {
  3916. return io.ErrUnexpectedEOF
  3917. }
  3918. b := data[iNdEx]
  3919. iNdEx++
  3920. m.LeaseId |= (int64(b) & 0x7F) << shift
  3921. if b < 0x80 {
  3922. break
  3923. }
  3924. }
  3925. default:
  3926. var sizeOfWire int
  3927. for {
  3928. sizeOfWire++
  3929. wire >>= 7
  3930. if wire == 0 {
  3931. break
  3932. }
  3933. }
  3934. iNdEx -= sizeOfWire
  3935. skippy, err := skipRpc(data[iNdEx:])
  3936. if err != nil {
  3937. return err
  3938. }
  3939. if skippy < 0 {
  3940. return ErrInvalidLengthRpc
  3941. }
  3942. if (iNdEx + skippy) > l {
  3943. return io.ErrUnexpectedEOF
  3944. }
  3945. iNdEx += skippy
  3946. }
  3947. }
  3948. return nil
  3949. }
  3950. func (m *LeaseRevokeResponse) Unmarshal(data []byte) error {
  3951. l := len(data)
  3952. iNdEx := 0
  3953. for iNdEx < l {
  3954. var wire uint64
  3955. for shift := uint(0); ; shift += 7 {
  3956. if iNdEx >= l {
  3957. return io.ErrUnexpectedEOF
  3958. }
  3959. b := data[iNdEx]
  3960. iNdEx++
  3961. wire |= (uint64(b) & 0x7F) << shift
  3962. if b < 0x80 {
  3963. break
  3964. }
  3965. }
  3966. fieldNum := int32(wire >> 3)
  3967. wireType := int(wire & 0x7)
  3968. switch fieldNum {
  3969. case 1:
  3970. if wireType != 2 {
  3971. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  3972. }
  3973. var msglen int
  3974. for shift := uint(0); ; shift += 7 {
  3975. if iNdEx >= l {
  3976. return io.ErrUnexpectedEOF
  3977. }
  3978. b := data[iNdEx]
  3979. iNdEx++
  3980. msglen |= (int(b) & 0x7F) << shift
  3981. if b < 0x80 {
  3982. break
  3983. }
  3984. }
  3985. if msglen < 0 {
  3986. return ErrInvalidLengthRpc
  3987. }
  3988. postIndex := iNdEx + msglen
  3989. if postIndex > l {
  3990. return io.ErrUnexpectedEOF
  3991. }
  3992. if m.Header == nil {
  3993. m.Header = &ResponseHeader{}
  3994. }
  3995. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3996. return err
  3997. }
  3998. iNdEx = postIndex
  3999. default:
  4000. var sizeOfWire int
  4001. for {
  4002. sizeOfWire++
  4003. wire >>= 7
  4004. if wire == 0 {
  4005. break
  4006. }
  4007. }
  4008. iNdEx -= sizeOfWire
  4009. skippy, err := skipRpc(data[iNdEx:])
  4010. if err != nil {
  4011. return err
  4012. }
  4013. if skippy < 0 {
  4014. return ErrInvalidLengthRpc
  4015. }
  4016. if (iNdEx + skippy) > l {
  4017. return io.ErrUnexpectedEOF
  4018. }
  4019. iNdEx += skippy
  4020. }
  4021. }
  4022. return nil
  4023. }
  4024. func (m *LeaseKeepAliveRequest) Unmarshal(data []byte) error {
  4025. l := len(data)
  4026. iNdEx := 0
  4027. for iNdEx < l {
  4028. var wire uint64
  4029. for shift := uint(0); ; shift += 7 {
  4030. if iNdEx >= l {
  4031. return io.ErrUnexpectedEOF
  4032. }
  4033. b := data[iNdEx]
  4034. iNdEx++
  4035. wire |= (uint64(b) & 0x7F) << shift
  4036. if b < 0x80 {
  4037. break
  4038. }
  4039. }
  4040. fieldNum := int32(wire >> 3)
  4041. wireType := int(wire & 0x7)
  4042. switch fieldNum {
  4043. case 1:
  4044. if wireType != 0 {
  4045. return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
  4046. }
  4047. m.LeaseId = 0
  4048. for shift := uint(0); ; shift += 7 {
  4049. if iNdEx >= l {
  4050. return io.ErrUnexpectedEOF
  4051. }
  4052. b := data[iNdEx]
  4053. iNdEx++
  4054. m.LeaseId |= (int64(b) & 0x7F) << shift
  4055. if b < 0x80 {
  4056. break
  4057. }
  4058. }
  4059. default:
  4060. var sizeOfWire int
  4061. for {
  4062. sizeOfWire++
  4063. wire >>= 7
  4064. if wire == 0 {
  4065. break
  4066. }
  4067. }
  4068. iNdEx -= sizeOfWire
  4069. skippy, err := skipRpc(data[iNdEx:])
  4070. if err != nil {
  4071. return err
  4072. }
  4073. if skippy < 0 {
  4074. return ErrInvalidLengthRpc
  4075. }
  4076. if (iNdEx + skippy) > l {
  4077. return io.ErrUnexpectedEOF
  4078. }
  4079. iNdEx += skippy
  4080. }
  4081. }
  4082. return nil
  4083. }
  4084. func (m *LeaseKeepAliveResponse) Unmarshal(data []byte) error {
  4085. l := len(data)
  4086. iNdEx := 0
  4087. for iNdEx < l {
  4088. var wire uint64
  4089. for shift := uint(0); ; shift += 7 {
  4090. if iNdEx >= l {
  4091. return io.ErrUnexpectedEOF
  4092. }
  4093. b := data[iNdEx]
  4094. iNdEx++
  4095. wire |= (uint64(b) & 0x7F) << shift
  4096. if b < 0x80 {
  4097. break
  4098. }
  4099. }
  4100. fieldNum := int32(wire >> 3)
  4101. wireType := int(wire & 0x7)
  4102. switch fieldNum {
  4103. case 1:
  4104. if wireType != 2 {
  4105. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  4106. }
  4107. var msglen int
  4108. for shift := uint(0); ; shift += 7 {
  4109. if iNdEx >= l {
  4110. return io.ErrUnexpectedEOF
  4111. }
  4112. b := data[iNdEx]
  4113. iNdEx++
  4114. msglen |= (int(b) & 0x7F) << shift
  4115. if b < 0x80 {
  4116. break
  4117. }
  4118. }
  4119. if msglen < 0 {
  4120. return ErrInvalidLengthRpc
  4121. }
  4122. postIndex := iNdEx + msglen
  4123. if postIndex > l {
  4124. return io.ErrUnexpectedEOF
  4125. }
  4126. if m.Header == nil {
  4127. m.Header = &ResponseHeader{}
  4128. }
  4129. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  4130. return err
  4131. }
  4132. iNdEx = postIndex
  4133. case 2:
  4134. if wireType != 0 {
  4135. return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
  4136. }
  4137. m.LeaseId = 0
  4138. for shift := uint(0); ; shift += 7 {
  4139. if iNdEx >= l {
  4140. return io.ErrUnexpectedEOF
  4141. }
  4142. b := data[iNdEx]
  4143. iNdEx++
  4144. m.LeaseId |= (int64(b) & 0x7F) << shift
  4145. if b < 0x80 {
  4146. break
  4147. }
  4148. }
  4149. case 3:
  4150. if wireType != 0 {
  4151. return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType)
  4152. }
  4153. m.Ttl = 0
  4154. for shift := uint(0); ; shift += 7 {
  4155. if iNdEx >= l {
  4156. return io.ErrUnexpectedEOF
  4157. }
  4158. b := data[iNdEx]
  4159. iNdEx++
  4160. m.Ttl |= (int64(b) & 0x7F) << shift
  4161. if b < 0x80 {
  4162. break
  4163. }
  4164. }
  4165. default:
  4166. var sizeOfWire int
  4167. for {
  4168. sizeOfWire++
  4169. wire >>= 7
  4170. if wire == 0 {
  4171. break
  4172. }
  4173. }
  4174. iNdEx -= sizeOfWire
  4175. skippy, err := skipRpc(data[iNdEx:])
  4176. if err != nil {
  4177. return err
  4178. }
  4179. if skippy < 0 {
  4180. return ErrInvalidLengthRpc
  4181. }
  4182. if (iNdEx + skippy) > l {
  4183. return io.ErrUnexpectedEOF
  4184. }
  4185. iNdEx += skippy
  4186. }
  4187. }
  4188. return nil
  4189. }
  4190. func skipRpc(data []byte) (n int, err error) {
  4191. l := len(data)
  4192. iNdEx := 0
  4193. for iNdEx < l {
  4194. var wire uint64
  4195. for shift := uint(0); ; shift += 7 {
  4196. if iNdEx >= l {
  4197. return 0, io.ErrUnexpectedEOF
  4198. }
  4199. b := data[iNdEx]
  4200. iNdEx++
  4201. wire |= (uint64(b) & 0x7F) << shift
  4202. if b < 0x80 {
  4203. break
  4204. }
  4205. }
  4206. wireType := int(wire & 0x7)
  4207. switch wireType {
  4208. case 0:
  4209. for {
  4210. if iNdEx >= l {
  4211. return 0, io.ErrUnexpectedEOF
  4212. }
  4213. iNdEx++
  4214. if data[iNdEx-1] < 0x80 {
  4215. break
  4216. }
  4217. }
  4218. return iNdEx, nil
  4219. case 1:
  4220. iNdEx += 8
  4221. return iNdEx, nil
  4222. case 2:
  4223. var length int
  4224. for shift := uint(0); ; shift += 7 {
  4225. if iNdEx >= l {
  4226. return 0, io.ErrUnexpectedEOF
  4227. }
  4228. b := data[iNdEx]
  4229. iNdEx++
  4230. length |= (int(b) & 0x7F) << shift
  4231. if b < 0x80 {
  4232. break
  4233. }
  4234. }
  4235. iNdEx += length
  4236. if length < 0 {
  4237. return 0, ErrInvalidLengthRpc
  4238. }
  4239. return iNdEx, nil
  4240. case 3:
  4241. for {
  4242. var innerWire uint64
  4243. var start int = iNdEx
  4244. for shift := uint(0); ; shift += 7 {
  4245. if iNdEx >= l {
  4246. return 0, io.ErrUnexpectedEOF
  4247. }
  4248. b := data[iNdEx]
  4249. iNdEx++
  4250. innerWire |= (uint64(b) & 0x7F) << shift
  4251. if b < 0x80 {
  4252. break
  4253. }
  4254. }
  4255. innerWireType := int(innerWire & 0x7)
  4256. if innerWireType == 4 {
  4257. break
  4258. }
  4259. next, err := skipRpc(data[start:])
  4260. if err != nil {
  4261. return 0, err
  4262. }
  4263. iNdEx = start + next
  4264. }
  4265. return iNdEx, nil
  4266. case 4:
  4267. return iNdEx, nil
  4268. case 5:
  4269. iNdEx += 4
  4270. return iNdEx, nil
  4271. default:
  4272. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  4273. }
  4274. }
  4275. panic("unreachable")
  4276. }
  4277. var (
  4278. ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling")
  4279. )