rpc.pb.go 98 KB

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