| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507 |
- // Code generated by protoc-gen-gogo.
- // source: rpc.proto
- // DO NOT EDIT!
- package etcdserverpb
- import proto "github.com/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
- // discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto"
- import storagepb "github.com/coreos/etcd/storage/storagepb"
- import (
- context "github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
- grpc "github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc"
- )
- import io "io"
- import fmt "fmt"
- // Reference imports to suppress errors if they are not otherwise used.
- var _ = proto.Marshal
- type Compare_CompareResult int32
- const (
- Compare_EQUAL Compare_CompareResult = 0
- Compare_GREATER Compare_CompareResult = 1
- Compare_LESS Compare_CompareResult = 2
- )
- var Compare_CompareResult_name = map[int32]string{
- 0: "EQUAL",
- 1: "GREATER",
- 2: "LESS",
- }
- var Compare_CompareResult_value = map[string]int32{
- "EQUAL": 0,
- "GREATER": 1,
- "LESS": 2,
- }
- func (x Compare_CompareResult) String() string {
- return proto.EnumName(Compare_CompareResult_name, int32(x))
- }
- type Compare_CompareTarget int32
- const (
- Compare_VERSION Compare_CompareTarget = 0
- Compare_CREATE Compare_CompareTarget = 1
- Compare_MOD Compare_CompareTarget = 2
- Compare_VALUE Compare_CompareTarget = 3
- )
- var Compare_CompareTarget_name = map[int32]string{
- 0: "VERSION",
- 1: "CREATE",
- 2: "MOD",
- 3: "VALUE",
- }
- var Compare_CompareTarget_value = map[string]int32{
- "VERSION": 0,
- "CREATE": 1,
- "MOD": 2,
- "VALUE": 3,
- }
- func (x Compare_CompareTarget) String() string {
- return proto.EnumName(Compare_CompareTarget_name, int32(x))
- }
- type ResponseHeader struct {
- ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,proto3" json:"cluster_id,omitempty"`
- MemberId uint64 `protobuf:"varint,2,opt,name=member_id,proto3" json:"member_id,omitempty"`
- // revision of the store when the request was applied.
- Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"`
- // term of raft when the request was applied.
- RaftTerm uint64 `protobuf:"varint,4,opt,name=raft_term,proto3" json:"raft_term,omitempty"`
- }
- func (m *ResponseHeader) Reset() { *m = ResponseHeader{} }
- func (m *ResponseHeader) String() string { return proto.CompactTextString(m) }
- func (*ResponseHeader) ProtoMessage() {}
- type RangeRequest struct {
- // if the range_end is not given, the request returns the key.
- Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
- // if the range_end is given, it gets the keys in range [key, range_end).
- RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
- // limit the number of keys returned.
- Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
- // range over the store at the given revision.
- // if revision is less or equal to zero, range over the newest store.
- // if the revision has been compacted, ErrCompaction will be returned in
- // response.
- Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"`
- }
- func (m *RangeRequest) Reset() { *m = RangeRequest{} }
- func (m *RangeRequest) String() string { return proto.CompactTextString(m) }
- func (*RangeRequest) ProtoMessage() {}
- type RangeResponse struct {
- Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
- Kvs []*storagepb.KeyValue `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"`
- // more indicates if there are more keys to return in the requested range.
- More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"`
- }
- func (m *RangeResponse) Reset() { *m = RangeResponse{} }
- func (m *RangeResponse) String() string { return proto.CompactTextString(m) }
- func (*RangeResponse) ProtoMessage() {}
- func (m *RangeResponse) GetHeader() *ResponseHeader {
- if m != nil {
- return m.Header
- }
- return nil
- }
- func (m *RangeResponse) GetKvs() []*storagepb.KeyValue {
- if m != nil {
- return m.Kvs
- }
- return nil
- }
- type PutRequest struct {
- Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
- Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- Lease int64 `protobuf:"varint,3,opt,name=lease,proto3" json:"lease,omitempty"`
- }
- func (m *PutRequest) Reset() { *m = PutRequest{} }
- func (m *PutRequest) String() string { return proto.CompactTextString(m) }
- func (*PutRequest) ProtoMessage() {}
- type PutResponse struct {
- Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
- }
- func (m *PutResponse) Reset() { *m = PutResponse{} }
- func (m *PutResponse) String() string { return proto.CompactTextString(m) }
- func (*PutResponse) ProtoMessage() {}
- func (m *PutResponse) GetHeader() *ResponseHeader {
- if m != nil {
- return m.Header
- }
- return nil
- }
- type DeleteRangeRequest struct {
- // if the range_end is not given, the request deletes the key.
- Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
- // if the range_end is given, it deletes the keys in range [key, range_end).
- RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
- }
- func (m *DeleteRangeRequest) Reset() { *m = DeleteRangeRequest{} }
- func (m *DeleteRangeRequest) String() string { return proto.CompactTextString(m) }
- func (*DeleteRangeRequest) ProtoMessage() {}
- type DeleteRangeResponse struct {
- Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
- }
- func (m *DeleteRangeResponse) Reset() { *m = DeleteRangeResponse{} }
- func (m *DeleteRangeResponse) String() string { return proto.CompactTextString(m) }
- func (*DeleteRangeResponse) ProtoMessage() {}
- func (m *DeleteRangeResponse) GetHeader() *ResponseHeader {
- if m != nil {
- return m.Header
- }
- return nil
- }
- type RequestUnion struct {
- RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range" json:"request_range,omitempty"`
- RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put" json:"request_put,omitempty"`
- RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range" json:"request_delete_range,omitempty"`
- }
- func (m *RequestUnion) Reset() { *m = RequestUnion{} }
- func (m *RequestUnion) String() string { return proto.CompactTextString(m) }
- func (*RequestUnion) ProtoMessage() {}
- func (m *RequestUnion) GetRequestRange() *RangeRequest {
- if m != nil {
- return m.RequestRange
- }
- return nil
- }
- func (m *RequestUnion) GetRequestPut() *PutRequest {
- if m != nil {
- return m.RequestPut
- }
- return nil
- }
- func (m *RequestUnion) GetRequestDeleteRange() *DeleteRangeRequest {
- if m != nil {
- return m.RequestDeleteRange
- }
- return nil
- }
- type ResponseUnion struct {
- ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range" json:"response_range,omitempty"`
- ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put" json:"response_put,omitempty"`
- ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range" json:"response_delete_range,omitempty"`
- }
- func (m *ResponseUnion) Reset() { *m = ResponseUnion{} }
- func (m *ResponseUnion) String() string { return proto.CompactTextString(m) }
- func (*ResponseUnion) ProtoMessage() {}
- func (m *ResponseUnion) GetResponseRange() *RangeResponse {
- if m != nil {
- return m.ResponseRange
- }
- return nil
- }
- func (m *ResponseUnion) GetResponsePut() *PutResponse {
- if m != nil {
- return m.ResponsePut
- }
- return nil
- }
- func (m *ResponseUnion) GetResponseDeleteRange() *DeleteRangeResponse {
- if m != nil {
- return m.ResponseDeleteRange
- }
- return nil
- }
- type Compare struct {
- Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult" json:"result,omitempty"`
- Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget" json:"target,omitempty"`
- // key path
- Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
- // version of the given key
- Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
- // create revision of the given key
- CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,proto3" json:"create_revision,omitempty"`
- // last modified revision of the given key
- ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,proto3" json:"mod_revision,omitempty"`
- // value of the given key
- Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"`
- }
- func (m *Compare) Reset() { *m = Compare{} }
- func (m *Compare) String() string { return proto.CompactTextString(m) }
- func (*Compare) ProtoMessage() {}
- // From google paxosdb paper:
- // Our implementation hinges around a powerful primitive which we call MultiOp. All other database
- // operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically
- // and consists of three components:
- // 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check
- // for the absence or presence of a value, or compare with a given value. Two different tests in the guard
- // may apply to the same or different entries in the database. All tests in the guard are applied and
- // MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise
- // it executes f op (see item 3 below).
- // 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or
- // lookup operation, and applies to a single database entry. Two different operations in the list may apply
- // to the same or different entries in the database. These operations are executed
- // if guard evaluates to
- // true.
- // 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false.
- type TxnRequest struct {
- Compare []*Compare `protobuf:"bytes,1,rep,name=compare" json:"compare,omitempty"`
- Success []*RequestUnion `protobuf:"bytes,2,rep,name=success" json:"success,omitempty"`
- Failure []*RequestUnion `protobuf:"bytes,3,rep,name=failure" json:"failure,omitempty"`
- }
- func (m *TxnRequest) Reset() { *m = TxnRequest{} }
- func (m *TxnRequest) String() string { return proto.CompactTextString(m) }
- func (*TxnRequest) ProtoMessage() {}
- func (m *TxnRequest) GetCompare() []*Compare {
- if m != nil {
- return m.Compare
- }
- return nil
- }
- func (m *TxnRequest) GetSuccess() []*RequestUnion {
- if m != nil {
- return m.Success
- }
- return nil
- }
- func (m *TxnRequest) GetFailure() []*RequestUnion {
- if m != nil {
- return m.Failure
- }
- return nil
- }
- type TxnResponse struct {
- Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
- Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
- Responses []*ResponseUnion `protobuf:"bytes,3,rep,name=responses" json:"responses,omitempty"`
- }
- func (m *TxnResponse) Reset() { *m = TxnResponse{} }
- func (m *TxnResponse) String() string { return proto.CompactTextString(m) }
- func (*TxnResponse) ProtoMessage() {}
- func (m *TxnResponse) GetHeader() *ResponseHeader {
- if m != nil {
- return m.Header
- }
- return nil
- }
- func (m *TxnResponse) GetResponses() []*ResponseUnion {
- if m != nil {
- return m.Responses
- }
- return nil
- }
- // Compaction compacts the kv store upto the given revision (including).
- // It removes the old versions of a key. It keeps the newest version of
- // the key even if its latest modification revision is smaller than the given
- // revision.
- type CompactionRequest struct {
- Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
- }
- func (m *CompactionRequest) Reset() { *m = CompactionRequest{} }
- func (m *CompactionRequest) String() string { return proto.CompactTextString(m) }
- func (*CompactionRequest) ProtoMessage() {}
- type CompactionResponse struct {
- Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
- }
- func (m *CompactionResponse) Reset() { *m = CompactionResponse{} }
- func (m *CompactionResponse) String() string { return proto.CompactTextString(m) }
- func (*CompactionResponse) ProtoMessage() {}
- func (m *CompactionResponse) GetHeader() *ResponseHeader {
- if m != nil {
- return m.Header
- }
- return nil
- }
- type WatchRequest struct {
- // the key to be watched
- Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
- // the prefix to be watched.
- Prefix []byte `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
- // start_revision is an optional revision (including) to watch from. No start_revision is "now".
- StartRevision int64 `protobuf:"varint,3,opt,name=start_revision,proto3" json:"start_revision,omitempty"`
- }
- func (m *WatchRequest) Reset() { *m = WatchRequest{} }
- func (m *WatchRequest) String() string { return proto.CompactTextString(m) }
- func (*WatchRequest) ProtoMessage() {}
- type WatchResponse struct {
- Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
- // TODO: support batched events response?
- Event *storagepb.Event `protobuf:"bytes,2,opt,name=event" json:"event,omitempty"`
- }
- func (m *WatchResponse) Reset() { *m = WatchResponse{} }
- func (m *WatchResponse) String() string { return proto.CompactTextString(m) }
- func (*WatchResponse) ProtoMessage() {}
- func (m *WatchResponse) GetHeader() *ResponseHeader {
- if m != nil {
- return m.Header
- }
- return nil
- }
- func (m *WatchResponse) GetEvent() *storagepb.Event {
- if m != nil {
- return m.Event
- }
- return nil
- }
- type LeaseCreateRequest struct {
- // advisory ttl in seconds
- Ttl int64 `protobuf:"varint,1,opt,name=ttl,proto3" json:"ttl,omitempty"`
- }
- func (m *LeaseCreateRequest) Reset() { *m = LeaseCreateRequest{} }
- func (m *LeaseCreateRequest) String() string { return proto.CompactTextString(m) }
- func (*LeaseCreateRequest) ProtoMessage() {}
- type LeaseCreateResponse struct {
- Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
- LeaseId int64 `protobuf:"varint,2,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
- // server decided ttl in second
- Ttl int64 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
- Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
- }
- func (m *LeaseCreateResponse) Reset() { *m = LeaseCreateResponse{} }
- func (m *LeaseCreateResponse) String() string { return proto.CompactTextString(m) }
- func (*LeaseCreateResponse) ProtoMessage() {}
- func (m *LeaseCreateResponse) GetHeader() *ResponseHeader {
- if m != nil {
- return m.Header
- }
- return nil
- }
- type LeaseRevokeRequest struct {
- LeaseId int64 `protobuf:"varint,1,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
- }
- func (m *LeaseRevokeRequest) Reset() { *m = LeaseRevokeRequest{} }
- func (m *LeaseRevokeRequest) String() string { return proto.CompactTextString(m) }
- func (*LeaseRevokeRequest) ProtoMessage() {}
- type LeaseRevokeResponse struct {
- Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
- }
- func (m *LeaseRevokeResponse) Reset() { *m = LeaseRevokeResponse{} }
- func (m *LeaseRevokeResponse) String() string { return proto.CompactTextString(m) }
- func (*LeaseRevokeResponse) ProtoMessage() {}
- func (m *LeaseRevokeResponse) GetHeader() *ResponseHeader {
- if m != nil {
- return m.Header
- }
- return nil
- }
- type LeaseKeepAliveRequest struct {
- LeaseId int64 `protobuf:"varint,1,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
- }
- func (m *LeaseKeepAliveRequest) Reset() { *m = LeaseKeepAliveRequest{} }
- func (m *LeaseKeepAliveRequest) String() string { return proto.CompactTextString(m) }
- func (*LeaseKeepAliveRequest) ProtoMessage() {}
- type LeaseKeepAliveResponse struct {
- Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
- LeaseId int64 `protobuf:"varint,2,opt,name=lease_id,proto3" json:"lease_id,omitempty"`
- Ttl int64 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
- }
- func (m *LeaseKeepAliveResponse) Reset() { *m = LeaseKeepAliveResponse{} }
- func (m *LeaseKeepAliveResponse) String() string { return proto.CompactTextString(m) }
- func (*LeaseKeepAliveResponse) ProtoMessage() {}
- func (m *LeaseKeepAliveResponse) GetHeader() *ResponseHeader {
- if m != nil {
- return m.Header
- }
- return nil
- }
- func init() {
- proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value)
- proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value)
- }
- // Reference imports to suppress errors if they are not otherwise used.
- var _ context.Context
- var _ grpc.ClientConn
- // Client API for KV service
- type KVClient interface {
- // Range gets the keys in the range from the store.
- Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error)
- // Put puts the given key into the store.
- // A put request increases the revision of the store,
- // and generates one event in the event history.
- Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
- // Delete deletes the given range from the store.
- // A delete request increase the revision of the store,
- // and generates one event in the event history.
- DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error)
- // Txn processes all the requests in one transaction.
- // A txn request increases the revision of the store,
- // and generates events with the same revision in the event history.
- // It is not allowed to modify the same key several times within one txn.
- Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error)
- // Compact compacts the event history in etcd. User should compact the
- // event history periodically, or it will grow infinitely.
- Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error)
- }
- type kVClient struct {
- cc *grpc.ClientConn
- }
- func NewKVClient(cc *grpc.ClientConn) KVClient {
- return &kVClient{cc}
- }
- func (c *kVClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) {
- out := new(RangeResponse)
- err := grpc.Invoke(ctx, "/etcdserverpb.KV/Range", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *kVClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) {
- out := new(PutResponse)
- err := grpc.Invoke(ctx, "/etcdserverpb.KV/Put", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *kVClient) DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) {
- out := new(DeleteRangeResponse)
- err := grpc.Invoke(ctx, "/etcdserverpb.KV/DeleteRange", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *kVClient) Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) {
- out := new(TxnResponse)
- err := grpc.Invoke(ctx, "/etcdserverpb.KV/Txn", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *kVClient) Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) {
- out := new(CompactionResponse)
- err := grpc.Invoke(ctx, "/etcdserverpb.KV/Compact", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- // Server API for KV service
- type KVServer interface {
- // Range gets the keys in the range from the store.
- Range(context.Context, *RangeRequest) (*RangeResponse, error)
- // Put puts the given key into the store.
- // A put request increases the revision of the store,
- // and generates one event in the event history.
- Put(context.Context, *PutRequest) (*PutResponse, error)
- // Delete deletes the given range from the store.
- // A delete request increase the revision of the store,
- // and generates one event in the event history.
- DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error)
- // Txn processes all the requests in one transaction.
- // A txn request increases the revision of the store,
- // and generates events with the same revision in the event history.
- // It is not allowed to modify the same key several times within one txn.
- Txn(context.Context, *TxnRequest) (*TxnResponse, error)
- // Compact compacts the event history in etcd. User should compact the
- // event history periodically, or it will grow infinitely.
- Compact(context.Context, *CompactionRequest) (*CompactionResponse, error)
- }
- func RegisterKVServer(s *grpc.Server, srv KVServer) {
- s.RegisterService(&_KV_serviceDesc, srv)
- }
- func _KV_Range_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
- in := new(RangeRequest)
- if err := codec.Unmarshal(buf, in); err != nil {
- return nil, err
- }
- out, err := srv.(KVServer).Range(ctx, in)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func _KV_Put_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
- in := new(PutRequest)
- if err := codec.Unmarshal(buf, in); err != nil {
- return nil, err
- }
- out, err := srv.(KVServer).Put(ctx, in)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func _KV_DeleteRange_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
- in := new(DeleteRangeRequest)
- if err := codec.Unmarshal(buf, in); err != nil {
- return nil, err
- }
- out, err := srv.(KVServer).DeleteRange(ctx, in)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func _KV_Txn_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
- in := new(TxnRequest)
- if err := codec.Unmarshal(buf, in); err != nil {
- return nil, err
- }
- out, err := srv.(KVServer).Txn(ctx, in)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func _KV_Compact_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
- in := new(CompactionRequest)
- if err := codec.Unmarshal(buf, in); err != nil {
- return nil, err
- }
- out, err := srv.(KVServer).Compact(ctx, in)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- var _KV_serviceDesc = grpc.ServiceDesc{
- ServiceName: "etcdserverpb.KV",
- HandlerType: (*KVServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Range",
- Handler: _KV_Range_Handler,
- },
- {
- MethodName: "Put",
- Handler: _KV_Put_Handler,
- },
- {
- MethodName: "DeleteRange",
- Handler: _KV_DeleteRange_Handler,
- },
- {
- MethodName: "Txn",
- Handler: _KV_Txn_Handler,
- },
- {
- MethodName: "Compact",
- Handler: _KV_Compact_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- }
- // Client API for Watch service
- type WatchClient interface {
- // Watch watches the events happening or happened. Both input and output
- // are stream. One watch rpc can watch for multiple keys or prefixs and
- // get a stream of events. The whole events history can be watched unless
- // compacted.
- Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error)
- }
- type watchClient struct {
- cc *grpc.ClientConn
- }
- func NewWatchClient(cc *grpc.ClientConn) WatchClient {
- return &watchClient{cc}
- }
- func (c *watchClient) Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) {
- stream, err := grpc.NewClientStream(ctx, &_Watch_serviceDesc.Streams[0], c.cc, "/etcdserverpb.watch/Watch", opts...)
- if err != nil {
- return nil, err
- }
- x := &watchWatchClient{stream}
- return x, nil
- }
- type Watch_WatchClient interface {
- Send(*WatchRequest) error
- Recv() (*WatchResponse, error)
- grpc.ClientStream
- }
- type watchWatchClient struct {
- grpc.ClientStream
- }
- func (x *watchWatchClient) Send(m *WatchRequest) error {
- return x.ClientStream.SendMsg(m)
- }
- func (x *watchWatchClient) Recv() (*WatchResponse, error) {
- m := new(WatchResponse)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
- }
- // Server API for Watch service
- type WatchServer interface {
- // Watch watches the events happening or happened. Both input and output
- // are stream. One watch rpc can watch for multiple keys or prefixs and
- // get a stream of events. The whole events history can be watched unless
- // compacted.
- Watch(Watch_WatchServer) error
- }
- func RegisterWatchServer(s *grpc.Server, srv WatchServer) {
- s.RegisterService(&_Watch_serviceDesc, srv)
- }
- func _Watch_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(WatchServer).Watch(&watchWatchServer{stream})
- }
- type Watch_WatchServer interface {
- Send(*WatchResponse) error
- Recv() (*WatchRequest, error)
- grpc.ServerStream
- }
- type watchWatchServer struct {
- grpc.ServerStream
- }
- func (x *watchWatchServer) Send(m *WatchResponse) error {
- return x.ServerStream.SendMsg(m)
- }
- func (x *watchWatchServer) Recv() (*WatchRequest, error) {
- m := new(WatchRequest)
- if err := x.ServerStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
- }
- var _Watch_serviceDesc = grpc.ServiceDesc{
- ServiceName: "etcdserverpb.watch",
- HandlerType: (*WatchServer)(nil),
- Methods: []grpc.MethodDesc{},
- Streams: []grpc.StreamDesc{
- {
- StreamName: "Watch",
- Handler: _Watch_Watch_Handler,
- ServerStreams: true,
- ClientStreams: true,
- },
- },
- }
- // Client API for Lease service
- type LeaseClient interface {
- // LeaseCreate creates a lease. A lease has a TTL. The lease will expire if the
- // server does not receive a keepAlive within TTL from the lease holder.
- // All keys attached to the lease will be expired and deleted if the lease expires.
- // The key expiration generates an event in event history.
- LeaseCreate(ctx context.Context, in *LeaseCreateRequest, opts ...grpc.CallOption) (*LeaseCreateResponse, error)
- // LeaseRevoke revokes a lease. All the key attached to the lease will be expired and deleted.
- LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error)
- // KeepAlive keeps the lease alive.
- LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error)
- }
- type leaseClient struct {
- cc *grpc.ClientConn
- }
- func NewLeaseClient(cc *grpc.ClientConn) LeaseClient {
- return &leaseClient{cc}
- }
- func (c *leaseClient) LeaseCreate(ctx context.Context, in *LeaseCreateRequest, opts ...grpc.CallOption) (*LeaseCreateResponse, error) {
- out := new(LeaseCreateResponse)
- err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseCreate", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *leaseClient) LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error) {
- out := new(LeaseRevokeResponse)
- err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseRevoke", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *leaseClient) LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error) {
- stream, err := grpc.NewClientStream(ctx, &_Lease_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Lease/LeaseKeepAlive", opts...)
- if err != nil {
- return nil, err
- }
- x := &leaseLeaseKeepAliveClient{stream}
- return x, nil
- }
- type Lease_LeaseKeepAliveClient interface {
- Send(*LeaseKeepAliveRequest) error
- Recv() (*LeaseKeepAliveResponse, error)
- grpc.ClientStream
- }
- type leaseLeaseKeepAliveClient struct {
- grpc.ClientStream
- }
- func (x *leaseLeaseKeepAliveClient) Send(m *LeaseKeepAliveRequest) error {
- return x.ClientStream.SendMsg(m)
- }
- func (x *leaseLeaseKeepAliveClient) Recv() (*LeaseKeepAliveResponse, error) {
- m := new(LeaseKeepAliveResponse)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
- }
- // Server API for Lease service
- type LeaseServer interface {
- // LeaseCreate creates a lease. A lease has a TTL. The lease will expire if the
- // server does not receive a keepAlive within TTL from the lease holder.
- // All keys attached to the lease will be expired and deleted if the lease expires.
- // The key expiration generates an event in event history.
- LeaseCreate(context.Context, *LeaseCreateRequest) (*LeaseCreateResponse, error)
- // LeaseRevoke revokes a lease. All the key attached to the lease will be expired and deleted.
- LeaseRevoke(context.Context, *LeaseRevokeRequest) (*LeaseRevokeResponse, error)
- // KeepAlive keeps the lease alive.
- LeaseKeepAlive(Lease_LeaseKeepAliveServer) error
- }
- func RegisterLeaseServer(s *grpc.Server, srv LeaseServer) {
- s.RegisterService(&_Lease_serviceDesc, srv)
- }
- func _Lease_LeaseCreate_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
- in := new(LeaseCreateRequest)
- if err := codec.Unmarshal(buf, in); err != nil {
- return nil, err
- }
- out, err := srv.(LeaseServer).LeaseCreate(ctx, in)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func _Lease_LeaseRevoke_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
- in := new(LeaseRevokeRequest)
- if err := codec.Unmarshal(buf, in); err != nil {
- return nil, err
- }
- out, err := srv.(LeaseServer).LeaseRevoke(ctx, in)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func _Lease_LeaseKeepAlive_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(LeaseServer).LeaseKeepAlive(&leaseLeaseKeepAliveServer{stream})
- }
- type Lease_LeaseKeepAliveServer interface {
- Send(*LeaseKeepAliveResponse) error
- Recv() (*LeaseKeepAliveRequest, error)
- grpc.ServerStream
- }
- type leaseLeaseKeepAliveServer struct {
- grpc.ServerStream
- }
- func (x *leaseLeaseKeepAliveServer) Send(m *LeaseKeepAliveResponse) error {
- return x.ServerStream.SendMsg(m)
- }
- func (x *leaseLeaseKeepAliveServer) Recv() (*LeaseKeepAliveRequest, error) {
- m := new(LeaseKeepAliveRequest)
- if err := x.ServerStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
- }
- var _Lease_serviceDesc = grpc.ServiceDesc{
- ServiceName: "etcdserverpb.Lease",
- HandlerType: (*LeaseServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "LeaseCreate",
- Handler: _Lease_LeaseCreate_Handler,
- },
- {
- MethodName: "LeaseRevoke",
- Handler: _Lease_LeaseRevoke_Handler,
- },
- },
- Streams: []grpc.StreamDesc{
- {
- StreamName: "LeaseKeepAlive",
- Handler: _Lease_LeaseKeepAlive_Handler,
- ServerStreams: true,
- ClientStreams: true,
- },
- },
- }
- func (m *ResponseHeader) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *ResponseHeader) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.ClusterId != 0 {
- data[i] = 0x8
- i++
- i = encodeVarintRpc(data, i, uint64(m.ClusterId))
- }
- if m.MemberId != 0 {
- data[i] = 0x10
- i++
- i = encodeVarintRpc(data, i, uint64(m.MemberId))
- }
- if m.Revision != 0 {
- data[i] = 0x18
- i++
- i = encodeVarintRpc(data, i, uint64(m.Revision))
- }
- if m.RaftTerm != 0 {
- data[i] = 0x20
- i++
- i = encodeVarintRpc(data, i, uint64(m.RaftTerm))
- }
- return i, nil
- }
- func (m *RangeRequest) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *RangeRequest) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Key != nil {
- if len(m.Key) > 0 {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(len(m.Key)))
- i += copy(data[i:], m.Key)
- }
- }
- if m.RangeEnd != nil {
- if len(m.RangeEnd) > 0 {
- data[i] = 0x12
- i++
- i = encodeVarintRpc(data, i, uint64(len(m.RangeEnd)))
- i += copy(data[i:], m.RangeEnd)
- }
- }
- if m.Limit != 0 {
- data[i] = 0x18
- i++
- i = encodeVarintRpc(data, i, uint64(m.Limit))
- }
- if m.Revision != 0 {
- data[i] = 0x20
- i++
- i = encodeVarintRpc(data, i, uint64(m.Revision))
- }
- return i, nil
- }
- func (m *RangeResponse) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *RangeResponse) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Header != nil {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
- n1, err := m.Header.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n1
- }
- if len(m.Kvs) > 0 {
- for _, msg := range m.Kvs {
- data[i] = 0x12
- i++
- i = encodeVarintRpc(data, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if m.More {
- data[i] = 0x18
- i++
- if m.More {
- data[i] = 1
- } else {
- data[i] = 0
- }
- i++
- }
- return i, nil
- }
- func (m *PutRequest) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *PutRequest) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Key != nil {
- if len(m.Key) > 0 {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(len(m.Key)))
- i += copy(data[i:], m.Key)
- }
- }
- if m.Value != nil {
- if len(m.Value) > 0 {
- data[i] = 0x12
- i++
- i = encodeVarintRpc(data, i, uint64(len(m.Value)))
- i += copy(data[i:], m.Value)
- }
- }
- if m.Lease != 0 {
- data[i] = 0x18
- i++
- i = encodeVarintRpc(data, i, uint64(m.Lease))
- }
- return i, nil
- }
- func (m *PutResponse) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *PutResponse) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Header != nil {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
- n2, err := m.Header.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n2
- }
- return i, nil
- }
- func (m *DeleteRangeRequest) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *DeleteRangeRequest) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Key != nil {
- if len(m.Key) > 0 {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(len(m.Key)))
- i += copy(data[i:], m.Key)
- }
- }
- if m.RangeEnd != nil {
- if len(m.RangeEnd) > 0 {
- data[i] = 0x12
- i++
- i = encodeVarintRpc(data, i, uint64(len(m.RangeEnd)))
- i += copy(data[i:], m.RangeEnd)
- }
- }
- return i, nil
- }
- func (m *DeleteRangeResponse) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *DeleteRangeResponse) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Header != nil {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
- n3, err := m.Header.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n3
- }
- return i, nil
- }
- func (m *RequestUnion) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *RequestUnion) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.RequestRange != nil {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(m.RequestRange.Size()))
- n4, err := m.RequestRange.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n4
- }
- if m.RequestPut != nil {
- data[i] = 0x12
- i++
- i = encodeVarintRpc(data, i, uint64(m.RequestPut.Size()))
- n5, err := m.RequestPut.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n5
- }
- if m.RequestDeleteRange != nil {
- data[i] = 0x1a
- i++
- i = encodeVarintRpc(data, i, uint64(m.RequestDeleteRange.Size()))
- n6, err := m.RequestDeleteRange.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n6
- }
- return i, nil
- }
- func (m *ResponseUnion) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *ResponseUnion) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.ResponseRange != nil {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(m.ResponseRange.Size()))
- n7, err := m.ResponseRange.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n7
- }
- if m.ResponsePut != nil {
- data[i] = 0x12
- i++
- i = encodeVarintRpc(data, i, uint64(m.ResponsePut.Size()))
- n8, err := m.ResponsePut.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n8
- }
- if m.ResponseDeleteRange != nil {
- data[i] = 0x1a
- i++
- i = encodeVarintRpc(data, i, uint64(m.ResponseDeleteRange.Size()))
- n9, err := m.ResponseDeleteRange.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n9
- }
- return i, nil
- }
- func (m *Compare) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *Compare) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Result != 0 {
- data[i] = 0x8
- i++
- i = encodeVarintRpc(data, i, uint64(m.Result))
- }
- if m.Target != 0 {
- data[i] = 0x10
- i++
- i = encodeVarintRpc(data, i, uint64(m.Target))
- }
- if m.Key != nil {
- if len(m.Key) > 0 {
- data[i] = 0x1a
- i++
- i = encodeVarintRpc(data, i, uint64(len(m.Key)))
- i += copy(data[i:], m.Key)
- }
- }
- if m.Version != 0 {
- data[i] = 0x20
- i++
- i = encodeVarintRpc(data, i, uint64(m.Version))
- }
- if m.CreateRevision != 0 {
- data[i] = 0x28
- i++
- i = encodeVarintRpc(data, i, uint64(m.CreateRevision))
- }
- if m.ModRevision != 0 {
- data[i] = 0x30
- i++
- i = encodeVarintRpc(data, i, uint64(m.ModRevision))
- }
- if m.Value != nil {
- if len(m.Value) > 0 {
- data[i] = 0x3a
- i++
- i = encodeVarintRpc(data, i, uint64(len(m.Value)))
- i += copy(data[i:], m.Value)
- }
- }
- return i, nil
- }
- func (m *TxnRequest) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *TxnRequest) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Compare) > 0 {
- for _, msg := range m.Compare {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if len(m.Success) > 0 {
- for _, msg := range m.Success {
- data[i] = 0x12
- i++
- i = encodeVarintRpc(data, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if len(m.Failure) > 0 {
- for _, msg := range m.Failure {
- data[i] = 0x1a
- i++
- i = encodeVarintRpc(data, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- return i, nil
- }
- func (m *TxnResponse) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *TxnResponse) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Header != nil {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
- n10, err := m.Header.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n10
- }
- if m.Succeeded {
- data[i] = 0x10
- i++
- if m.Succeeded {
- data[i] = 1
- } else {
- data[i] = 0
- }
- i++
- }
- if len(m.Responses) > 0 {
- for _, msg := range m.Responses {
- data[i] = 0x1a
- i++
- i = encodeVarintRpc(data, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- return i, nil
- }
- func (m *CompactionRequest) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *CompactionRequest) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Revision != 0 {
- data[i] = 0x8
- i++
- i = encodeVarintRpc(data, i, uint64(m.Revision))
- }
- return i, nil
- }
- func (m *CompactionResponse) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *CompactionResponse) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Header != nil {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
- n11, err := m.Header.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n11
- }
- return i, nil
- }
- func (m *WatchRequest) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *WatchRequest) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Key != nil {
- if len(m.Key) > 0 {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(len(m.Key)))
- i += copy(data[i:], m.Key)
- }
- }
- if m.Prefix != nil {
- if len(m.Prefix) > 0 {
- data[i] = 0x12
- i++
- i = encodeVarintRpc(data, i, uint64(len(m.Prefix)))
- i += copy(data[i:], m.Prefix)
- }
- }
- if m.StartRevision != 0 {
- data[i] = 0x18
- i++
- i = encodeVarintRpc(data, i, uint64(m.StartRevision))
- }
- return i, nil
- }
- func (m *WatchResponse) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *WatchResponse) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Header != nil {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
- n12, err := m.Header.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n12
- }
- if m.Event != nil {
- data[i] = 0x12
- i++
- i = encodeVarintRpc(data, i, uint64(m.Event.Size()))
- n13, err := m.Event.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n13
- }
- return i, nil
- }
- func (m *LeaseCreateRequest) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *LeaseCreateRequest) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Ttl != 0 {
- data[i] = 0x8
- i++
- i = encodeVarintRpc(data, i, uint64(m.Ttl))
- }
- return i, nil
- }
- func (m *LeaseCreateResponse) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *LeaseCreateResponse) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Header != nil {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
- n14, err := m.Header.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n14
- }
- if m.LeaseId != 0 {
- data[i] = 0x10
- i++
- i = encodeVarintRpc(data, i, uint64(m.LeaseId))
- }
- if m.Ttl != 0 {
- data[i] = 0x18
- i++
- i = encodeVarintRpc(data, i, uint64(m.Ttl))
- }
- if len(m.Error) > 0 {
- data[i] = 0x22
- i++
- i = encodeVarintRpc(data, i, uint64(len(m.Error)))
- i += copy(data[i:], m.Error)
- }
- return i, nil
- }
- func (m *LeaseRevokeRequest) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *LeaseRevokeRequest) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.LeaseId != 0 {
- data[i] = 0x8
- i++
- i = encodeVarintRpc(data, i, uint64(m.LeaseId))
- }
- return i, nil
- }
- func (m *LeaseRevokeResponse) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *LeaseRevokeResponse) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Header != nil {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
- n15, err := m.Header.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n15
- }
- return i, nil
- }
- func (m *LeaseKeepAliveRequest) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *LeaseKeepAliveRequest) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.LeaseId != 0 {
- data[i] = 0x8
- i++
- i = encodeVarintRpc(data, i, uint64(m.LeaseId))
- }
- return i, nil
- }
- func (m *LeaseKeepAliveResponse) Marshal() (data []byte, err error) {
- size := m.Size()
- data = make([]byte, size)
- n, err := m.MarshalTo(data)
- if err != nil {
- return nil, err
- }
- return data[:n], nil
- }
- func (m *LeaseKeepAliveResponse) MarshalTo(data []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Header != nil {
- data[i] = 0xa
- i++
- i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
- n16, err := m.Header.MarshalTo(data[i:])
- if err != nil {
- return 0, err
- }
- i += n16
- }
- if m.LeaseId != 0 {
- data[i] = 0x10
- i++
- i = encodeVarintRpc(data, i, uint64(m.LeaseId))
- }
- if m.Ttl != 0 {
- data[i] = 0x18
- i++
- i = encodeVarintRpc(data, i, uint64(m.Ttl))
- }
- return i, nil
- }
- func encodeFixed64Rpc(data []byte, offset int, v uint64) int {
- data[offset] = uint8(v)
- data[offset+1] = uint8(v >> 8)
- data[offset+2] = uint8(v >> 16)
- data[offset+3] = uint8(v >> 24)
- data[offset+4] = uint8(v >> 32)
- data[offset+5] = uint8(v >> 40)
- data[offset+6] = uint8(v >> 48)
- data[offset+7] = uint8(v >> 56)
- return offset + 8
- }
- func encodeFixed32Rpc(data []byte, offset int, v uint32) int {
- data[offset] = uint8(v)
- data[offset+1] = uint8(v >> 8)
- data[offset+2] = uint8(v >> 16)
- data[offset+3] = uint8(v >> 24)
- return offset + 4
- }
- func encodeVarintRpc(data []byte, offset int, v uint64) int {
- for v >= 1<<7 {
- data[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- data[offset] = uint8(v)
- return offset + 1
- }
- func (m *ResponseHeader) Size() (n int) {
- var l int
- _ = l
- if m.ClusterId != 0 {
- n += 1 + sovRpc(uint64(m.ClusterId))
- }
- if m.MemberId != 0 {
- n += 1 + sovRpc(uint64(m.MemberId))
- }
- if m.Revision != 0 {
- n += 1 + sovRpc(uint64(m.Revision))
- }
- if m.RaftTerm != 0 {
- n += 1 + sovRpc(uint64(m.RaftTerm))
- }
- return n
- }
- func (m *RangeRequest) Size() (n int) {
- var l int
- _ = l
- if m.Key != nil {
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- if m.RangeEnd != nil {
- l = len(m.RangeEnd)
- if l > 0 {
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- if m.Limit != 0 {
- n += 1 + sovRpc(uint64(m.Limit))
- }
- if m.Revision != 0 {
- n += 1 + sovRpc(uint64(m.Revision))
- }
- return n
- }
- func (m *RangeResponse) Size() (n int) {
- var l int
- _ = l
- if m.Header != nil {
- l = m.Header.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- if len(m.Kvs) > 0 {
- for _, e := range m.Kvs {
- l = e.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- if m.More {
- n += 2
- }
- return n
- }
- func (m *PutRequest) Size() (n int) {
- var l int
- _ = l
- if m.Key != nil {
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- if m.Value != nil {
- l = len(m.Value)
- if l > 0 {
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- if m.Lease != 0 {
- n += 1 + sovRpc(uint64(m.Lease))
- }
- return n
- }
- func (m *PutResponse) Size() (n int) {
- var l int
- _ = l
- if m.Header != nil {
- l = m.Header.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- return n
- }
- func (m *DeleteRangeRequest) Size() (n int) {
- var l int
- _ = l
- if m.Key != nil {
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- if m.RangeEnd != nil {
- l = len(m.RangeEnd)
- if l > 0 {
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- return n
- }
- func (m *DeleteRangeResponse) Size() (n int) {
- var l int
- _ = l
- if m.Header != nil {
- l = m.Header.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- return n
- }
- func (m *RequestUnion) Size() (n int) {
- var l int
- _ = l
- if m.RequestRange != nil {
- l = m.RequestRange.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- if m.RequestPut != nil {
- l = m.RequestPut.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- if m.RequestDeleteRange != nil {
- l = m.RequestDeleteRange.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- return n
- }
- func (m *ResponseUnion) Size() (n int) {
- var l int
- _ = l
- if m.ResponseRange != nil {
- l = m.ResponseRange.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- if m.ResponsePut != nil {
- l = m.ResponsePut.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- if m.ResponseDeleteRange != nil {
- l = m.ResponseDeleteRange.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- return n
- }
- func (m *Compare) Size() (n int) {
- var l int
- _ = l
- if m.Result != 0 {
- n += 1 + sovRpc(uint64(m.Result))
- }
- if m.Target != 0 {
- n += 1 + sovRpc(uint64(m.Target))
- }
- if m.Key != nil {
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- if m.Version != 0 {
- n += 1 + sovRpc(uint64(m.Version))
- }
- if m.CreateRevision != 0 {
- n += 1 + sovRpc(uint64(m.CreateRevision))
- }
- if m.ModRevision != 0 {
- n += 1 + sovRpc(uint64(m.ModRevision))
- }
- if m.Value != nil {
- l = len(m.Value)
- if l > 0 {
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- return n
- }
- func (m *TxnRequest) Size() (n int) {
- var l int
- _ = l
- if len(m.Compare) > 0 {
- for _, e := range m.Compare {
- l = e.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- if len(m.Success) > 0 {
- for _, e := range m.Success {
- l = e.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- if len(m.Failure) > 0 {
- for _, e := range m.Failure {
- l = e.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- return n
- }
- func (m *TxnResponse) Size() (n int) {
- var l int
- _ = l
- if m.Header != nil {
- l = m.Header.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- if m.Succeeded {
- n += 2
- }
- if len(m.Responses) > 0 {
- for _, e := range m.Responses {
- l = e.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- return n
- }
- func (m *CompactionRequest) Size() (n int) {
- var l int
- _ = l
- if m.Revision != 0 {
- n += 1 + sovRpc(uint64(m.Revision))
- }
- return n
- }
- func (m *CompactionResponse) Size() (n int) {
- var l int
- _ = l
- if m.Header != nil {
- l = m.Header.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- return n
- }
- func (m *WatchRequest) Size() (n int) {
- var l int
- _ = l
- if m.Key != nil {
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- if m.Prefix != nil {
- l = len(m.Prefix)
- if l > 0 {
- n += 1 + l + sovRpc(uint64(l))
- }
- }
- if m.StartRevision != 0 {
- n += 1 + sovRpc(uint64(m.StartRevision))
- }
- return n
- }
- func (m *WatchResponse) Size() (n int) {
- var l int
- _ = l
- if m.Header != nil {
- l = m.Header.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- if m.Event != nil {
- l = m.Event.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- return n
- }
- func (m *LeaseCreateRequest) Size() (n int) {
- var l int
- _ = l
- if m.Ttl != 0 {
- n += 1 + sovRpc(uint64(m.Ttl))
- }
- return n
- }
- func (m *LeaseCreateResponse) Size() (n int) {
- var l int
- _ = l
- if m.Header != nil {
- l = m.Header.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- if m.LeaseId != 0 {
- n += 1 + sovRpc(uint64(m.LeaseId))
- }
- if m.Ttl != 0 {
- n += 1 + sovRpc(uint64(m.Ttl))
- }
- l = len(m.Error)
- if l > 0 {
- n += 1 + l + sovRpc(uint64(l))
- }
- return n
- }
- func (m *LeaseRevokeRequest) Size() (n int) {
- var l int
- _ = l
- if m.LeaseId != 0 {
- n += 1 + sovRpc(uint64(m.LeaseId))
- }
- return n
- }
- func (m *LeaseRevokeResponse) Size() (n int) {
- var l int
- _ = l
- if m.Header != nil {
- l = m.Header.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- return n
- }
- func (m *LeaseKeepAliveRequest) Size() (n int) {
- var l int
- _ = l
- if m.LeaseId != 0 {
- n += 1 + sovRpc(uint64(m.LeaseId))
- }
- return n
- }
- func (m *LeaseKeepAliveResponse) Size() (n int) {
- var l int
- _ = l
- if m.Header != nil {
- l = m.Header.Size()
- n += 1 + l + sovRpc(uint64(l))
- }
- if m.LeaseId != 0 {
- n += 1 + sovRpc(uint64(m.LeaseId))
- }
- if m.Ttl != 0 {
- n += 1 + sovRpc(uint64(m.Ttl))
- }
- return n
- }
- func sovRpc(x uint64) (n int) {
- for {
- n++
- x >>= 7
- if x == 0 {
- break
- }
- }
- return n
- }
- func sozRpc(x uint64) (n int) {
- return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63))))
- }
- func (m *ResponseHeader) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ClusterId", wireType)
- }
- m.ClusterId = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.ClusterId |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field MemberId", wireType)
- }
- m.MemberId = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.MemberId |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
- }
- m.Revision = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.Revision |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType)
- }
- m.RaftTerm = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.RaftTerm |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *RangeRequest) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- byteLen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + byteLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = append([]byte{}, data[iNdEx:postIndex]...)
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- byteLen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + byteLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.RangeEnd = append([]byte{}, data[iNdEx:postIndex]...)
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType)
- }
- m.Limit = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.Limit |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
- }
- m.Revision = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.Revision |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *RangeResponse) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Header == nil {
- m.Header = &ResponseHeader{}
- }
- if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Kvs = append(m.Kvs, &storagepb.KeyValue{})
- if err := m.Kvs[len(m.Kvs)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field More", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- v |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.More = bool(v != 0)
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *PutRequest) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- byteLen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + byteLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = append([]byte{}, data[iNdEx:postIndex]...)
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- byteLen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + byteLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Value = append([]byte{}, data[iNdEx:postIndex]...)
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
- }
- m.Lease = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.Lease |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *PutResponse) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Header == nil {
- m.Header = &ResponseHeader{}
- }
- if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *DeleteRangeRequest) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- byteLen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + byteLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = append([]byte{}, data[iNdEx:postIndex]...)
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- byteLen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + byteLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.RangeEnd = append([]byte{}, data[iNdEx:postIndex]...)
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *DeleteRangeResponse) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Header == nil {
- m.Header = &ResponseHeader{}
- }
- if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *RequestUnion) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field RequestRange", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.RequestRange == nil {
- m.RequestRange = &RangeRequest{}
- }
- if err := m.RequestRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field RequestPut", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.RequestPut == nil {
- m.RequestPut = &PutRequest{}
- }
- if err := m.RequestPut.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field RequestDeleteRange", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.RequestDeleteRange == nil {
- m.RequestDeleteRange = &DeleteRangeRequest{}
- }
- if err := m.RequestDeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *ResponseUnion) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResponseRange", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.ResponseRange == nil {
- m.ResponseRange = &RangeResponse{}
- }
- if err := m.ResponseRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResponsePut", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.ResponsePut == nil {
- m.ResponsePut = &PutResponse{}
- }
- if err := m.ResponsePut.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResponseDeleteRange", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.ResponseDeleteRange == nil {
- m.ResponseDeleteRange = &DeleteRangeResponse{}
- }
- if err := m.ResponseDeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *Compare) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType)
- }
- m.Result = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.Result |= (Compare_CompareResult(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
- }
- m.Target = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.Target |= (Compare_CompareTarget(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- byteLen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + byteLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = append([]byte{}, data[iNdEx:postIndex]...)
- iNdEx = postIndex
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
- }
- m.Version = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.Version |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType)
- }
- m.CreateRevision = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.CreateRevision |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 6:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType)
- }
- m.ModRevision = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.ModRevision |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- byteLen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + byteLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Value = append([]byte{}, data[iNdEx:postIndex]...)
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *TxnRequest) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Compare", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Compare = append(m.Compare, &Compare{})
- if err := m.Compare[len(m.Compare)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Success = append(m.Success, &RequestUnion{})
- if err := m.Success[len(m.Success)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Failure = append(m.Failure, &RequestUnion{})
- if err := m.Failure[len(m.Failure)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *TxnResponse) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Header == nil {
- m.Header = &ResponseHeader{}
- }
- if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Succeeded", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- v |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Succeeded = bool(v != 0)
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Responses = append(m.Responses, &ResponseUnion{})
- if err := m.Responses[len(m.Responses)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *CompactionRequest) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
- }
- m.Revision = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.Revision |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *CompactionResponse) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Header == nil {
- m.Header = &ResponseHeader{}
- }
- if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *WatchRequest) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- byteLen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + byteLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = append([]byte{}, data[iNdEx:postIndex]...)
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- byteLen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + byteLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Prefix = append([]byte{}, data[iNdEx:postIndex]...)
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field StartRevision", wireType)
- }
- m.StartRevision = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.StartRevision |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *WatchResponse) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Header == nil {
- m.Header = &ResponseHeader{}
- }
- if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Event == nil {
- m.Event = &storagepb.Event{}
- }
- if err := m.Event.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *LeaseCreateRequest) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType)
- }
- m.Ttl = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.Ttl |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *LeaseCreateResponse) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Header == nil {
- m.Header = &ResponseHeader{}
- }
- if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
- }
- m.LeaseId = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.LeaseId |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType)
- }
- m.Ttl = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.Ttl |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Error = string(data[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *LeaseRevokeRequest) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
- }
- m.LeaseId = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.LeaseId |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *LeaseRevokeResponse) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Header == nil {
- m.Header = &ResponseHeader{}
- }
- if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *LeaseKeepAliveRequest) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
- }
- m.LeaseId = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.LeaseId |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func (m *LeaseKeepAliveResponse) Unmarshal(data []byte) error {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRpc
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Header == nil {
- m.Header = &ResponseHeader{}
- }
- if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field LeaseId", wireType)
- }
- m.LeaseId = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.LeaseId |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType)
- }
- m.Ttl = 0
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- m.Ttl |= (int64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- var sizeOfWire int
- for {
- sizeOfWire++
- wire >>= 7
- if wire == 0 {
- break
- }
- }
- iNdEx -= sizeOfWire
- skippy, err := skipRpc(data[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRpc
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- return nil
- }
- func skipRpc(data []byte) (n int, err error) {
- l := len(data)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for {
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if data[iNdEx-1] < 0x80 {
- break
- }
- }
- return iNdEx, nil
- case 1:
- iNdEx += 8
- return iNdEx, nil
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- iNdEx += length
- if length < 0 {
- return 0, ErrInvalidLengthRpc
- }
- return iNdEx, nil
- case 3:
- for {
- var innerWire uint64
- var start int = iNdEx
- for shift := uint(0); ; shift += 7 {
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := data[iNdEx]
- iNdEx++
- innerWire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- innerWireType := int(innerWire & 0x7)
- if innerWireType == 4 {
- break
- }
- next, err := skipRpc(data[start:])
- if err != nil {
- return 0, err
- }
- iNdEx = start + next
- }
- return iNdEx, nil
- case 4:
- return iNdEx, nil
- case 5:
- iNdEx += 4
- return iNdEx, nil
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- }
- panic("unreachable")
- }
- var (
- ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling")
- )
|