rpc.pb.go 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062
  1. // Code generated by protoc-gen-gogo.
  2. // source: rpc.proto
  3. // DO NOT EDIT!
  4. package etcdserverpb
  5. import proto "github.com/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
  6. // discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto"
  7. import storagepb "github.com/coreos/etcd/storage/storagepb"
  8. import (
  9. context "github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
  10. grpc "github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc"
  11. )
  12. import io "io"
  13. import fmt "fmt"
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var _ = proto.Marshal
  16. type Compare_CompareResult int32
  17. const (
  18. Compare_EQUAL Compare_CompareResult = 0
  19. Compare_GREATER Compare_CompareResult = 1
  20. Compare_LESS Compare_CompareResult = 2
  21. )
  22. var Compare_CompareResult_name = map[int32]string{
  23. 0: "EQUAL",
  24. 1: "GREATER",
  25. 2: "LESS",
  26. }
  27. var Compare_CompareResult_value = map[string]int32{
  28. "EQUAL": 0,
  29. "GREATER": 1,
  30. "LESS": 2,
  31. }
  32. func (x Compare_CompareResult) String() string {
  33. return proto.EnumName(Compare_CompareResult_name, int32(x))
  34. }
  35. type Compare_CompareTarget int32
  36. const (
  37. Compare_VERSION Compare_CompareTarget = 0
  38. Compare_CREATE Compare_CompareTarget = 1
  39. Compare_MOD Compare_CompareTarget = 2
  40. Compare_VALUE Compare_CompareTarget = 3
  41. )
  42. var Compare_CompareTarget_name = map[int32]string{
  43. 0: "VERSION",
  44. 1: "CREATE",
  45. 2: "MOD",
  46. 3: "VALUE",
  47. }
  48. var Compare_CompareTarget_value = map[string]int32{
  49. "VERSION": 0,
  50. "CREATE": 1,
  51. "MOD": 2,
  52. "VALUE": 3,
  53. }
  54. func (x Compare_CompareTarget) String() string {
  55. return proto.EnumName(Compare_CompareTarget_name, int32(x))
  56. }
  57. type ResponseHeader struct {
  58. // an error type message?
  59. Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
  60. ClusterId uint64 `protobuf:"varint,2,opt,name=cluster_id,proto3" json:"cluster_id,omitempty"`
  61. MemberId uint64 `protobuf:"varint,3,opt,name=member_id,proto3" json:"member_id,omitempty"`
  62. // revision of the store when the request was applied.
  63. Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"`
  64. // term of raft when the request was applied.
  65. RaftTerm uint64 `protobuf:"varint,5,opt,name=raft_term,proto3" json:"raft_term,omitempty"`
  66. }
  67. func (m *ResponseHeader) Reset() { *m = ResponseHeader{} }
  68. func (m *ResponseHeader) String() string { return proto.CompactTextString(m) }
  69. func (*ResponseHeader) ProtoMessage() {}
  70. type RangeRequest struct {
  71. // if the range_end is not given, the request returns the key.
  72. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  73. // if the range_end is given, it gets the keys in range [key, range_end).
  74. RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
  75. // limit the number of keys returned.
  76. Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
  77. // range over the store at the given revision.
  78. // if revision is less or equal to zero, range over the newest store.
  79. // if the revision has been compacted, ErrCompaction will be returned in
  80. // response.
  81. Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"`
  82. }
  83. func (m *RangeRequest) Reset() { *m = RangeRequest{} }
  84. func (m *RangeRequest) String() string { return proto.CompactTextString(m) }
  85. func (*RangeRequest) ProtoMessage() {}
  86. type RangeResponse struct {
  87. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  88. Kvs []*storagepb.KeyValue `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"`
  89. // more indicates if there are more keys to return in the requested range.
  90. More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"`
  91. }
  92. func (m *RangeResponse) Reset() { *m = RangeResponse{} }
  93. func (m *RangeResponse) String() string { return proto.CompactTextString(m) }
  94. func (*RangeResponse) ProtoMessage() {}
  95. func (m *RangeResponse) GetHeader() *ResponseHeader {
  96. if m != nil {
  97. return m.Header
  98. }
  99. return nil
  100. }
  101. func (m *RangeResponse) GetKvs() []*storagepb.KeyValue {
  102. if m != nil {
  103. return m.Kvs
  104. }
  105. return nil
  106. }
  107. type PutRequest struct {
  108. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  109. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
  110. }
  111. func (m *PutRequest) Reset() { *m = PutRequest{} }
  112. func (m *PutRequest) String() string { return proto.CompactTextString(m) }
  113. func (*PutRequest) ProtoMessage() {}
  114. type PutResponse struct {
  115. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  116. }
  117. func (m *PutResponse) Reset() { *m = PutResponse{} }
  118. func (m *PutResponse) String() string { return proto.CompactTextString(m) }
  119. func (*PutResponse) ProtoMessage() {}
  120. func (m *PutResponse) GetHeader() *ResponseHeader {
  121. if m != nil {
  122. return m.Header
  123. }
  124. return nil
  125. }
  126. type DeleteRangeRequest struct {
  127. // if the range_end is not given, the request deletes the key.
  128. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  129. // if the range_end is given, it deletes the keys in range [key, range_end).
  130. RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
  131. }
  132. func (m *DeleteRangeRequest) Reset() { *m = DeleteRangeRequest{} }
  133. func (m *DeleteRangeRequest) String() string { return proto.CompactTextString(m) }
  134. func (*DeleteRangeRequest) ProtoMessage() {}
  135. type DeleteRangeResponse struct {
  136. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  137. }
  138. func (m *DeleteRangeResponse) Reset() { *m = DeleteRangeResponse{} }
  139. func (m *DeleteRangeResponse) String() string { return proto.CompactTextString(m) }
  140. func (*DeleteRangeResponse) ProtoMessage() {}
  141. func (m *DeleteRangeResponse) GetHeader() *ResponseHeader {
  142. if m != nil {
  143. return m.Header
  144. }
  145. return nil
  146. }
  147. type RequestUnion struct {
  148. RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range" json:"request_range,omitempty"`
  149. RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put" json:"request_put,omitempty"`
  150. RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range" json:"request_delete_range,omitempty"`
  151. }
  152. func (m *RequestUnion) Reset() { *m = RequestUnion{} }
  153. func (m *RequestUnion) String() string { return proto.CompactTextString(m) }
  154. func (*RequestUnion) ProtoMessage() {}
  155. func (m *RequestUnion) GetRequestRange() *RangeRequest {
  156. if m != nil {
  157. return m.RequestRange
  158. }
  159. return nil
  160. }
  161. func (m *RequestUnion) GetRequestPut() *PutRequest {
  162. if m != nil {
  163. return m.RequestPut
  164. }
  165. return nil
  166. }
  167. func (m *RequestUnion) GetRequestDeleteRange() *DeleteRangeRequest {
  168. if m != nil {
  169. return m.RequestDeleteRange
  170. }
  171. return nil
  172. }
  173. type ResponseUnion struct {
  174. ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range" json:"response_range,omitempty"`
  175. ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put" json:"response_put,omitempty"`
  176. ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range" json:"response_delete_range,omitempty"`
  177. }
  178. func (m *ResponseUnion) Reset() { *m = ResponseUnion{} }
  179. func (m *ResponseUnion) String() string { return proto.CompactTextString(m) }
  180. func (*ResponseUnion) ProtoMessage() {}
  181. func (m *ResponseUnion) GetResponseRange() *RangeResponse {
  182. if m != nil {
  183. return m.ResponseRange
  184. }
  185. return nil
  186. }
  187. func (m *ResponseUnion) GetResponsePut() *PutResponse {
  188. if m != nil {
  189. return m.ResponsePut
  190. }
  191. return nil
  192. }
  193. func (m *ResponseUnion) GetResponseDeleteRange() *DeleteRangeResponse {
  194. if m != nil {
  195. return m.ResponseDeleteRange
  196. }
  197. return nil
  198. }
  199. type Compare struct {
  200. Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult" json:"result,omitempty"`
  201. Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget" json:"target,omitempty"`
  202. // key path
  203. Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
  204. // version of the given key
  205. Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
  206. // create revision of the given key
  207. CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,proto3" json:"create_revision,omitempty"`
  208. // last modified revision of the given key
  209. ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,proto3" json:"mod_revision,omitempty"`
  210. // value of the given key
  211. Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"`
  212. }
  213. func (m *Compare) Reset() { *m = Compare{} }
  214. func (m *Compare) String() string { return proto.CompactTextString(m) }
  215. func (*Compare) ProtoMessage() {}
  216. // From google paxosdb paper:
  217. // Our implementation hinges around a powerful primitive which we call MultiOp. All other database
  218. // operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically
  219. // and consists of three components:
  220. // 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check
  221. // for the absence or presence of a value, or compare with a given value. Two different tests in the guard
  222. // may apply to the same or different entries in the database. All tests in the guard are applied and
  223. // MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise
  224. // it executes f op (see item 3 below).
  225. // 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or
  226. // lookup operation, and applies to a single database entry. Two different operations in the list may apply
  227. // to the same or different entries in the database. These operations are executed
  228. // if guard evaluates to
  229. // true.
  230. // 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false.
  231. type TxnRequest struct {
  232. Compare []*Compare `protobuf:"bytes,1,rep,name=compare" json:"compare,omitempty"`
  233. Success []*RequestUnion `protobuf:"bytes,2,rep,name=success" json:"success,omitempty"`
  234. Failure []*RequestUnion `protobuf:"bytes,3,rep,name=failure" json:"failure,omitempty"`
  235. }
  236. func (m *TxnRequest) Reset() { *m = TxnRequest{} }
  237. func (m *TxnRequest) String() string { return proto.CompactTextString(m) }
  238. func (*TxnRequest) ProtoMessage() {}
  239. func (m *TxnRequest) GetCompare() []*Compare {
  240. if m != nil {
  241. return m.Compare
  242. }
  243. return nil
  244. }
  245. func (m *TxnRequest) GetSuccess() []*RequestUnion {
  246. if m != nil {
  247. return m.Success
  248. }
  249. return nil
  250. }
  251. func (m *TxnRequest) GetFailure() []*RequestUnion {
  252. if m != nil {
  253. return m.Failure
  254. }
  255. return nil
  256. }
  257. type TxnResponse struct {
  258. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  259. Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
  260. Responses []*ResponseUnion `protobuf:"bytes,3,rep,name=responses" json:"responses,omitempty"`
  261. }
  262. func (m *TxnResponse) Reset() { *m = TxnResponse{} }
  263. func (m *TxnResponse) String() string { return proto.CompactTextString(m) }
  264. func (*TxnResponse) ProtoMessage() {}
  265. func (m *TxnResponse) GetHeader() *ResponseHeader {
  266. if m != nil {
  267. return m.Header
  268. }
  269. return nil
  270. }
  271. func (m *TxnResponse) GetResponses() []*ResponseUnion {
  272. if m != nil {
  273. return m.Responses
  274. }
  275. return nil
  276. }
  277. // Compaction compacts the kv store upto the given revision (including).
  278. // It removes the old versions of a key. It keeps the newest version of
  279. // the key even if its latest modification revision is smaller than the given
  280. // revision.
  281. type CompactionRequest struct {
  282. Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
  283. }
  284. func (m *CompactionRequest) Reset() { *m = CompactionRequest{} }
  285. func (m *CompactionRequest) String() string { return proto.CompactTextString(m) }
  286. func (*CompactionRequest) ProtoMessage() {}
  287. type CompactionResponse struct {
  288. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  289. }
  290. func (m *CompactionResponse) Reset() { *m = CompactionResponse{} }
  291. func (m *CompactionResponse) String() string { return proto.CompactTextString(m) }
  292. func (*CompactionResponse) ProtoMessage() {}
  293. func (m *CompactionResponse) GetHeader() *ResponseHeader {
  294. if m != nil {
  295. return m.Header
  296. }
  297. return nil
  298. }
  299. func init() {
  300. proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value)
  301. proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value)
  302. }
  303. // Reference imports to suppress errors if they are not otherwise used.
  304. var _ context.Context
  305. var _ grpc.ClientConn
  306. // Client API for Etcd service
  307. type EtcdClient interface {
  308. // Range gets the keys in the range from the store.
  309. Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error)
  310. // Put puts the given key into the store.
  311. // A put request increases the revision of the store,
  312. // and generates one event in the event history.
  313. Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
  314. // Delete deletes the given range from the store.
  315. // A delete request increase the revision of the store,
  316. // and generates one event in the event history.
  317. DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error)
  318. // Txn processes all the requests in one transaction.
  319. // A txn request increases the revision of the store,
  320. // and generates events with the same revision in the event history.
  321. Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error)
  322. // Compact compacts the event history in etcd. User should compact the
  323. // event history periodically, or it will grow infinitely.
  324. Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error)
  325. }
  326. type etcdClient struct {
  327. cc *grpc.ClientConn
  328. }
  329. func NewEtcdClient(cc *grpc.ClientConn) EtcdClient {
  330. return &etcdClient{cc}
  331. }
  332. func (c *etcdClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) {
  333. out := new(RangeResponse)
  334. err := grpc.Invoke(ctx, "/etcdserverpb.etcd/Range", in, out, c.cc, opts...)
  335. if err != nil {
  336. return nil, err
  337. }
  338. return out, nil
  339. }
  340. func (c *etcdClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) {
  341. out := new(PutResponse)
  342. err := grpc.Invoke(ctx, "/etcdserverpb.etcd/Put", in, out, c.cc, opts...)
  343. if err != nil {
  344. return nil, err
  345. }
  346. return out, nil
  347. }
  348. func (c *etcdClient) DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) {
  349. out := new(DeleteRangeResponse)
  350. err := grpc.Invoke(ctx, "/etcdserverpb.etcd/DeleteRange", in, out, c.cc, opts...)
  351. if err != nil {
  352. return nil, err
  353. }
  354. return out, nil
  355. }
  356. func (c *etcdClient) Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) {
  357. out := new(TxnResponse)
  358. err := grpc.Invoke(ctx, "/etcdserverpb.etcd/Txn", in, out, c.cc, opts...)
  359. if err != nil {
  360. return nil, err
  361. }
  362. return out, nil
  363. }
  364. func (c *etcdClient) Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) {
  365. out := new(CompactionResponse)
  366. err := grpc.Invoke(ctx, "/etcdserverpb.etcd/Compact", in, out, c.cc, opts...)
  367. if err != nil {
  368. return nil, err
  369. }
  370. return out, nil
  371. }
  372. // Server API for Etcd service
  373. type EtcdServer interface {
  374. // Range gets the keys in the range from the store.
  375. Range(context.Context, *RangeRequest) (*RangeResponse, error)
  376. // Put puts the given key into the store.
  377. // A put request increases the revision of the store,
  378. // and generates one event in the event history.
  379. Put(context.Context, *PutRequest) (*PutResponse, error)
  380. // Delete deletes the given range from the store.
  381. // A delete request increase the revision of the store,
  382. // and generates one event in the event history.
  383. DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error)
  384. // Txn processes all the requests in one transaction.
  385. // A txn request increases the revision of the store,
  386. // and generates events with the same revision in the event history.
  387. Txn(context.Context, *TxnRequest) (*TxnResponse, error)
  388. // Compact compacts the event history in etcd. User should compact the
  389. // event history periodically, or it will grow infinitely.
  390. Compact(context.Context, *CompactionRequest) (*CompactionResponse, error)
  391. }
  392. func RegisterEtcdServer(s *grpc.Server, srv EtcdServer) {
  393. s.RegisterService(&_Etcd_serviceDesc, srv)
  394. }
  395. func _Etcd_Range_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  396. in := new(RangeRequest)
  397. if err := codec.Unmarshal(buf, in); err != nil {
  398. return nil, err
  399. }
  400. out, err := srv.(EtcdServer).Range(ctx, in)
  401. if err != nil {
  402. return nil, err
  403. }
  404. return out, nil
  405. }
  406. func _Etcd_Put_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  407. in := new(PutRequest)
  408. if err := codec.Unmarshal(buf, in); err != nil {
  409. return nil, err
  410. }
  411. out, err := srv.(EtcdServer).Put(ctx, in)
  412. if err != nil {
  413. return nil, err
  414. }
  415. return out, nil
  416. }
  417. func _Etcd_DeleteRange_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  418. in := new(DeleteRangeRequest)
  419. if err := codec.Unmarshal(buf, in); err != nil {
  420. return nil, err
  421. }
  422. out, err := srv.(EtcdServer).DeleteRange(ctx, in)
  423. if err != nil {
  424. return nil, err
  425. }
  426. return out, nil
  427. }
  428. func _Etcd_Txn_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  429. in := new(TxnRequest)
  430. if err := codec.Unmarshal(buf, in); err != nil {
  431. return nil, err
  432. }
  433. out, err := srv.(EtcdServer).Txn(ctx, in)
  434. if err != nil {
  435. return nil, err
  436. }
  437. return out, nil
  438. }
  439. func _Etcd_Compact_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
  440. in := new(CompactionRequest)
  441. if err := codec.Unmarshal(buf, in); err != nil {
  442. return nil, err
  443. }
  444. out, err := srv.(EtcdServer).Compact(ctx, in)
  445. if err != nil {
  446. return nil, err
  447. }
  448. return out, nil
  449. }
  450. var _Etcd_serviceDesc = grpc.ServiceDesc{
  451. ServiceName: "etcdserverpb.etcd",
  452. HandlerType: (*EtcdServer)(nil),
  453. Methods: []grpc.MethodDesc{
  454. {
  455. MethodName: "Range",
  456. Handler: _Etcd_Range_Handler,
  457. },
  458. {
  459. MethodName: "Put",
  460. Handler: _Etcd_Put_Handler,
  461. },
  462. {
  463. MethodName: "DeleteRange",
  464. Handler: _Etcd_DeleteRange_Handler,
  465. },
  466. {
  467. MethodName: "Txn",
  468. Handler: _Etcd_Txn_Handler,
  469. },
  470. {
  471. MethodName: "Compact",
  472. Handler: _Etcd_Compact_Handler,
  473. },
  474. },
  475. Streams: []grpc.StreamDesc{},
  476. }
  477. func (m *ResponseHeader) Marshal() (data []byte, err error) {
  478. size := m.Size()
  479. data = make([]byte, size)
  480. n, err := m.MarshalTo(data)
  481. if err != nil {
  482. return nil, err
  483. }
  484. return data[:n], nil
  485. }
  486. func (m *ResponseHeader) MarshalTo(data []byte) (int, error) {
  487. var i int
  488. _ = i
  489. var l int
  490. _ = l
  491. if len(m.Error) > 0 {
  492. data[i] = 0xa
  493. i++
  494. i = encodeVarintRpc(data, i, uint64(len(m.Error)))
  495. i += copy(data[i:], m.Error)
  496. }
  497. if m.ClusterId != 0 {
  498. data[i] = 0x10
  499. i++
  500. i = encodeVarintRpc(data, i, uint64(m.ClusterId))
  501. }
  502. if m.MemberId != 0 {
  503. data[i] = 0x18
  504. i++
  505. i = encodeVarintRpc(data, i, uint64(m.MemberId))
  506. }
  507. if m.Revision != 0 {
  508. data[i] = 0x20
  509. i++
  510. i = encodeVarintRpc(data, i, uint64(m.Revision))
  511. }
  512. if m.RaftTerm != 0 {
  513. data[i] = 0x28
  514. i++
  515. i = encodeVarintRpc(data, i, uint64(m.RaftTerm))
  516. }
  517. return i, nil
  518. }
  519. func (m *RangeRequest) Marshal() (data []byte, err error) {
  520. size := m.Size()
  521. data = make([]byte, size)
  522. n, err := m.MarshalTo(data)
  523. if err != nil {
  524. return nil, err
  525. }
  526. return data[:n], nil
  527. }
  528. func (m *RangeRequest) MarshalTo(data []byte) (int, error) {
  529. var i int
  530. _ = i
  531. var l int
  532. _ = l
  533. if m.Key != nil {
  534. if len(m.Key) > 0 {
  535. data[i] = 0xa
  536. i++
  537. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  538. i += copy(data[i:], m.Key)
  539. }
  540. }
  541. if m.RangeEnd != nil {
  542. if len(m.RangeEnd) > 0 {
  543. data[i] = 0x12
  544. i++
  545. i = encodeVarintRpc(data, i, uint64(len(m.RangeEnd)))
  546. i += copy(data[i:], m.RangeEnd)
  547. }
  548. }
  549. if m.Limit != 0 {
  550. data[i] = 0x18
  551. i++
  552. i = encodeVarintRpc(data, i, uint64(m.Limit))
  553. }
  554. if m.Revision != 0 {
  555. data[i] = 0x20
  556. i++
  557. i = encodeVarintRpc(data, i, uint64(m.Revision))
  558. }
  559. return i, nil
  560. }
  561. func (m *RangeResponse) Marshal() (data []byte, err error) {
  562. size := m.Size()
  563. data = make([]byte, size)
  564. n, err := m.MarshalTo(data)
  565. if err != nil {
  566. return nil, err
  567. }
  568. return data[:n], nil
  569. }
  570. func (m *RangeResponse) MarshalTo(data []byte) (int, error) {
  571. var i int
  572. _ = i
  573. var l int
  574. _ = l
  575. if m.Header != nil {
  576. data[i] = 0xa
  577. i++
  578. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  579. n1, err := m.Header.MarshalTo(data[i:])
  580. if err != nil {
  581. return 0, err
  582. }
  583. i += n1
  584. }
  585. if len(m.Kvs) > 0 {
  586. for _, msg := range m.Kvs {
  587. data[i] = 0x12
  588. i++
  589. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  590. n, err := msg.MarshalTo(data[i:])
  591. if err != nil {
  592. return 0, err
  593. }
  594. i += n
  595. }
  596. }
  597. if m.More {
  598. data[i] = 0x18
  599. i++
  600. if m.More {
  601. data[i] = 1
  602. } else {
  603. data[i] = 0
  604. }
  605. i++
  606. }
  607. return i, nil
  608. }
  609. func (m *PutRequest) Marshal() (data []byte, err error) {
  610. size := m.Size()
  611. data = make([]byte, size)
  612. n, err := m.MarshalTo(data)
  613. if err != nil {
  614. return nil, err
  615. }
  616. return data[:n], nil
  617. }
  618. func (m *PutRequest) MarshalTo(data []byte) (int, error) {
  619. var i int
  620. _ = i
  621. var l int
  622. _ = l
  623. if m.Key != nil {
  624. if len(m.Key) > 0 {
  625. data[i] = 0xa
  626. i++
  627. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  628. i += copy(data[i:], m.Key)
  629. }
  630. }
  631. if m.Value != nil {
  632. if len(m.Value) > 0 {
  633. data[i] = 0x12
  634. i++
  635. i = encodeVarintRpc(data, i, uint64(len(m.Value)))
  636. i += copy(data[i:], m.Value)
  637. }
  638. }
  639. return i, nil
  640. }
  641. func (m *PutResponse) Marshal() (data []byte, err error) {
  642. size := m.Size()
  643. data = make([]byte, size)
  644. n, err := m.MarshalTo(data)
  645. if err != nil {
  646. return nil, err
  647. }
  648. return data[:n], nil
  649. }
  650. func (m *PutResponse) MarshalTo(data []byte) (int, error) {
  651. var i int
  652. _ = i
  653. var l int
  654. _ = l
  655. if m.Header != nil {
  656. data[i] = 0xa
  657. i++
  658. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  659. n2, err := m.Header.MarshalTo(data[i:])
  660. if err != nil {
  661. return 0, err
  662. }
  663. i += n2
  664. }
  665. return i, nil
  666. }
  667. func (m *DeleteRangeRequest) Marshal() (data []byte, err error) {
  668. size := m.Size()
  669. data = make([]byte, size)
  670. n, err := m.MarshalTo(data)
  671. if err != nil {
  672. return nil, err
  673. }
  674. return data[:n], nil
  675. }
  676. func (m *DeleteRangeRequest) MarshalTo(data []byte) (int, error) {
  677. var i int
  678. _ = i
  679. var l int
  680. _ = l
  681. if m.Key != nil {
  682. if len(m.Key) > 0 {
  683. data[i] = 0xa
  684. i++
  685. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  686. i += copy(data[i:], m.Key)
  687. }
  688. }
  689. if m.RangeEnd != nil {
  690. if len(m.RangeEnd) > 0 {
  691. data[i] = 0x12
  692. i++
  693. i = encodeVarintRpc(data, i, uint64(len(m.RangeEnd)))
  694. i += copy(data[i:], m.RangeEnd)
  695. }
  696. }
  697. return i, nil
  698. }
  699. func (m *DeleteRangeResponse) Marshal() (data []byte, err error) {
  700. size := m.Size()
  701. data = make([]byte, size)
  702. n, err := m.MarshalTo(data)
  703. if err != nil {
  704. return nil, err
  705. }
  706. return data[:n], nil
  707. }
  708. func (m *DeleteRangeResponse) MarshalTo(data []byte) (int, error) {
  709. var i int
  710. _ = i
  711. var l int
  712. _ = l
  713. if m.Header != nil {
  714. data[i] = 0xa
  715. i++
  716. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  717. n3, err := m.Header.MarshalTo(data[i:])
  718. if err != nil {
  719. return 0, err
  720. }
  721. i += n3
  722. }
  723. return i, nil
  724. }
  725. func (m *RequestUnion) Marshal() (data []byte, err error) {
  726. size := m.Size()
  727. data = make([]byte, size)
  728. n, err := m.MarshalTo(data)
  729. if err != nil {
  730. return nil, err
  731. }
  732. return data[:n], nil
  733. }
  734. func (m *RequestUnion) MarshalTo(data []byte) (int, error) {
  735. var i int
  736. _ = i
  737. var l int
  738. _ = l
  739. if m.RequestRange != nil {
  740. data[i] = 0xa
  741. i++
  742. i = encodeVarintRpc(data, i, uint64(m.RequestRange.Size()))
  743. n4, err := m.RequestRange.MarshalTo(data[i:])
  744. if err != nil {
  745. return 0, err
  746. }
  747. i += n4
  748. }
  749. if m.RequestPut != nil {
  750. data[i] = 0x12
  751. i++
  752. i = encodeVarintRpc(data, i, uint64(m.RequestPut.Size()))
  753. n5, err := m.RequestPut.MarshalTo(data[i:])
  754. if err != nil {
  755. return 0, err
  756. }
  757. i += n5
  758. }
  759. if m.RequestDeleteRange != nil {
  760. data[i] = 0x1a
  761. i++
  762. i = encodeVarintRpc(data, i, uint64(m.RequestDeleteRange.Size()))
  763. n6, err := m.RequestDeleteRange.MarshalTo(data[i:])
  764. if err != nil {
  765. return 0, err
  766. }
  767. i += n6
  768. }
  769. return i, nil
  770. }
  771. func (m *ResponseUnion) Marshal() (data []byte, err error) {
  772. size := m.Size()
  773. data = make([]byte, size)
  774. n, err := m.MarshalTo(data)
  775. if err != nil {
  776. return nil, err
  777. }
  778. return data[:n], nil
  779. }
  780. func (m *ResponseUnion) MarshalTo(data []byte) (int, error) {
  781. var i int
  782. _ = i
  783. var l int
  784. _ = l
  785. if m.ResponseRange != nil {
  786. data[i] = 0xa
  787. i++
  788. i = encodeVarintRpc(data, i, uint64(m.ResponseRange.Size()))
  789. n7, err := m.ResponseRange.MarshalTo(data[i:])
  790. if err != nil {
  791. return 0, err
  792. }
  793. i += n7
  794. }
  795. if m.ResponsePut != nil {
  796. data[i] = 0x12
  797. i++
  798. i = encodeVarintRpc(data, i, uint64(m.ResponsePut.Size()))
  799. n8, err := m.ResponsePut.MarshalTo(data[i:])
  800. if err != nil {
  801. return 0, err
  802. }
  803. i += n8
  804. }
  805. if m.ResponseDeleteRange != nil {
  806. data[i] = 0x1a
  807. i++
  808. i = encodeVarintRpc(data, i, uint64(m.ResponseDeleteRange.Size()))
  809. n9, err := m.ResponseDeleteRange.MarshalTo(data[i:])
  810. if err != nil {
  811. return 0, err
  812. }
  813. i += n9
  814. }
  815. return i, nil
  816. }
  817. func (m *Compare) Marshal() (data []byte, err error) {
  818. size := m.Size()
  819. data = make([]byte, size)
  820. n, err := m.MarshalTo(data)
  821. if err != nil {
  822. return nil, err
  823. }
  824. return data[:n], nil
  825. }
  826. func (m *Compare) MarshalTo(data []byte) (int, error) {
  827. var i int
  828. _ = i
  829. var l int
  830. _ = l
  831. if m.Result != 0 {
  832. data[i] = 0x8
  833. i++
  834. i = encodeVarintRpc(data, i, uint64(m.Result))
  835. }
  836. if m.Target != 0 {
  837. data[i] = 0x10
  838. i++
  839. i = encodeVarintRpc(data, i, uint64(m.Target))
  840. }
  841. if m.Key != nil {
  842. if len(m.Key) > 0 {
  843. data[i] = 0x1a
  844. i++
  845. i = encodeVarintRpc(data, i, uint64(len(m.Key)))
  846. i += copy(data[i:], m.Key)
  847. }
  848. }
  849. if m.Version != 0 {
  850. data[i] = 0x20
  851. i++
  852. i = encodeVarintRpc(data, i, uint64(m.Version))
  853. }
  854. if m.CreateRevision != 0 {
  855. data[i] = 0x28
  856. i++
  857. i = encodeVarintRpc(data, i, uint64(m.CreateRevision))
  858. }
  859. if m.ModRevision != 0 {
  860. data[i] = 0x30
  861. i++
  862. i = encodeVarintRpc(data, i, uint64(m.ModRevision))
  863. }
  864. if m.Value != nil {
  865. if len(m.Value) > 0 {
  866. data[i] = 0x3a
  867. i++
  868. i = encodeVarintRpc(data, i, uint64(len(m.Value)))
  869. i += copy(data[i:], m.Value)
  870. }
  871. }
  872. return i, nil
  873. }
  874. func (m *TxnRequest) Marshal() (data []byte, err error) {
  875. size := m.Size()
  876. data = make([]byte, size)
  877. n, err := m.MarshalTo(data)
  878. if err != nil {
  879. return nil, err
  880. }
  881. return data[:n], nil
  882. }
  883. func (m *TxnRequest) MarshalTo(data []byte) (int, error) {
  884. var i int
  885. _ = i
  886. var l int
  887. _ = l
  888. if len(m.Compare) > 0 {
  889. for _, msg := range m.Compare {
  890. data[i] = 0xa
  891. i++
  892. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  893. n, err := msg.MarshalTo(data[i:])
  894. if err != nil {
  895. return 0, err
  896. }
  897. i += n
  898. }
  899. }
  900. if len(m.Success) > 0 {
  901. for _, msg := range m.Success {
  902. data[i] = 0x12
  903. i++
  904. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  905. n, err := msg.MarshalTo(data[i:])
  906. if err != nil {
  907. return 0, err
  908. }
  909. i += n
  910. }
  911. }
  912. if len(m.Failure) > 0 {
  913. for _, msg := range m.Failure {
  914. data[i] = 0x1a
  915. i++
  916. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  917. n, err := msg.MarshalTo(data[i:])
  918. if err != nil {
  919. return 0, err
  920. }
  921. i += n
  922. }
  923. }
  924. return i, nil
  925. }
  926. func (m *TxnResponse) Marshal() (data []byte, err error) {
  927. size := m.Size()
  928. data = make([]byte, size)
  929. n, err := m.MarshalTo(data)
  930. if err != nil {
  931. return nil, err
  932. }
  933. return data[:n], nil
  934. }
  935. func (m *TxnResponse) MarshalTo(data []byte) (int, error) {
  936. var i int
  937. _ = i
  938. var l int
  939. _ = l
  940. if m.Header != nil {
  941. data[i] = 0xa
  942. i++
  943. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  944. n10, err := m.Header.MarshalTo(data[i:])
  945. if err != nil {
  946. return 0, err
  947. }
  948. i += n10
  949. }
  950. if m.Succeeded {
  951. data[i] = 0x10
  952. i++
  953. if m.Succeeded {
  954. data[i] = 1
  955. } else {
  956. data[i] = 0
  957. }
  958. i++
  959. }
  960. if len(m.Responses) > 0 {
  961. for _, msg := range m.Responses {
  962. data[i] = 0x1a
  963. i++
  964. i = encodeVarintRpc(data, i, uint64(msg.Size()))
  965. n, err := msg.MarshalTo(data[i:])
  966. if err != nil {
  967. return 0, err
  968. }
  969. i += n
  970. }
  971. }
  972. return i, nil
  973. }
  974. func (m *CompactionRequest) Marshal() (data []byte, err error) {
  975. size := m.Size()
  976. data = make([]byte, size)
  977. n, err := m.MarshalTo(data)
  978. if err != nil {
  979. return nil, err
  980. }
  981. return data[:n], nil
  982. }
  983. func (m *CompactionRequest) MarshalTo(data []byte) (int, error) {
  984. var i int
  985. _ = i
  986. var l int
  987. _ = l
  988. if m.Revision != 0 {
  989. data[i] = 0x8
  990. i++
  991. i = encodeVarintRpc(data, i, uint64(m.Revision))
  992. }
  993. return i, nil
  994. }
  995. func (m *CompactionResponse) Marshal() (data []byte, err error) {
  996. size := m.Size()
  997. data = make([]byte, size)
  998. n, err := m.MarshalTo(data)
  999. if err != nil {
  1000. return nil, err
  1001. }
  1002. return data[:n], nil
  1003. }
  1004. func (m *CompactionResponse) MarshalTo(data []byte) (int, error) {
  1005. var i int
  1006. _ = i
  1007. var l int
  1008. _ = l
  1009. if m.Header != nil {
  1010. data[i] = 0xa
  1011. i++
  1012. i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
  1013. n11, err := m.Header.MarshalTo(data[i:])
  1014. if err != nil {
  1015. return 0, err
  1016. }
  1017. i += n11
  1018. }
  1019. return i, nil
  1020. }
  1021. func encodeFixed64Rpc(data []byte, offset int, v uint64) int {
  1022. data[offset] = uint8(v)
  1023. data[offset+1] = uint8(v >> 8)
  1024. data[offset+2] = uint8(v >> 16)
  1025. data[offset+3] = uint8(v >> 24)
  1026. data[offset+4] = uint8(v >> 32)
  1027. data[offset+5] = uint8(v >> 40)
  1028. data[offset+6] = uint8(v >> 48)
  1029. data[offset+7] = uint8(v >> 56)
  1030. return offset + 8
  1031. }
  1032. func encodeFixed32Rpc(data []byte, offset int, v uint32) int {
  1033. data[offset] = uint8(v)
  1034. data[offset+1] = uint8(v >> 8)
  1035. data[offset+2] = uint8(v >> 16)
  1036. data[offset+3] = uint8(v >> 24)
  1037. return offset + 4
  1038. }
  1039. func encodeVarintRpc(data []byte, offset int, v uint64) int {
  1040. for v >= 1<<7 {
  1041. data[offset] = uint8(v&0x7f | 0x80)
  1042. v >>= 7
  1043. offset++
  1044. }
  1045. data[offset] = uint8(v)
  1046. return offset + 1
  1047. }
  1048. func (m *ResponseHeader) Size() (n int) {
  1049. var l int
  1050. _ = l
  1051. l = len(m.Error)
  1052. if l > 0 {
  1053. n += 1 + l + sovRpc(uint64(l))
  1054. }
  1055. if m.ClusterId != 0 {
  1056. n += 1 + sovRpc(uint64(m.ClusterId))
  1057. }
  1058. if m.MemberId != 0 {
  1059. n += 1 + sovRpc(uint64(m.MemberId))
  1060. }
  1061. if m.Revision != 0 {
  1062. n += 1 + sovRpc(uint64(m.Revision))
  1063. }
  1064. if m.RaftTerm != 0 {
  1065. n += 1 + sovRpc(uint64(m.RaftTerm))
  1066. }
  1067. return n
  1068. }
  1069. func (m *RangeRequest) Size() (n int) {
  1070. var l int
  1071. _ = l
  1072. if m.Key != nil {
  1073. l = len(m.Key)
  1074. if l > 0 {
  1075. n += 1 + l + sovRpc(uint64(l))
  1076. }
  1077. }
  1078. if m.RangeEnd != nil {
  1079. l = len(m.RangeEnd)
  1080. if l > 0 {
  1081. n += 1 + l + sovRpc(uint64(l))
  1082. }
  1083. }
  1084. if m.Limit != 0 {
  1085. n += 1 + sovRpc(uint64(m.Limit))
  1086. }
  1087. if m.Revision != 0 {
  1088. n += 1 + sovRpc(uint64(m.Revision))
  1089. }
  1090. return n
  1091. }
  1092. func (m *RangeResponse) Size() (n int) {
  1093. var l int
  1094. _ = l
  1095. if m.Header != nil {
  1096. l = m.Header.Size()
  1097. n += 1 + l + sovRpc(uint64(l))
  1098. }
  1099. if len(m.Kvs) > 0 {
  1100. for _, e := range m.Kvs {
  1101. l = e.Size()
  1102. n += 1 + l + sovRpc(uint64(l))
  1103. }
  1104. }
  1105. if m.More {
  1106. n += 2
  1107. }
  1108. return n
  1109. }
  1110. func (m *PutRequest) Size() (n int) {
  1111. var l int
  1112. _ = l
  1113. if m.Key != nil {
  1114. l = len(m.Key)
  1115. if l > 0 {
  1116. n += 1 + l + sovRpc(uint64(l))
  1117. }
  1118. }
  1119. if m.Value != nil {
  1120. l = len(m.Value)
  1121. if l > 0 {
  1122. n += 1 + l + sovRpc(uint64(l))
  1123. }
  1124. }
  1125. return n
  1126. }
  1127. func (m *PutResponse) Size() (n int) {
  1128. var l int
  1129. _ = l
  1130. if m.Header != nil {
  1131. l = m.Header.Size()
  1132. n += 1 + l + sovRpc(uint64(l))
  1133. }
  1134. return n
  1135. }
  1136. func (m *DeleteRangeRequest) Size() (n int) {
  1137. var l int
  1138. _ = l
  1139. if m.Key != nil {
  1140. l = len(m.Key)
  1141. if l > 0 {
  1142. n += 1 + l + sovRpc(uint64(l))
  1143. }
  1144. }
  1145. if m.RangeEnd != nil {
  1146. l = len(m.RangeEnd)
  1147. if l > 0 {
  1148. n += 1 + l + sovRpc(uint64(l))
  1149. }
  1150. }
  1151. return n
  1152. }
  1153. func (m *DeleteRangeResponse) Size() (n int) {
  1154. var l int
  1155. _ = l
  1156. if m.Header != nil {
  1157. l = m.Header.Size()
  1158. n += 1 + l + sovRpc(uint64(l))
  1159. }
  1160. return n
  1161. }
  1162. func (m *RequestUnion) Size() (n int) {
  1163. var l int
  1164. _ = l
  1165. if m.RequestRange != nil {
  1166. l = m.RequestRange.Size()
  1167. n += 1 + l + sovRpc(uint64(l))
  1168. }
  1169. if m.RequestPut != nil {
  1170. l = m.RequestPut.Size()
  1171. n += 1 + l + sovRpc(uint64(l))
  1172. }
  1173. if m.RequestDeleteRange != nil {
  1174. l = m.RequestDeleteRange.Size()
  1175. n += 1 + l + sovRpc(uint64(l))
  1176. }
  1177. return n
  1178. }
  1179. func (m *ResponseUnion) Size() (n int) {
  1180. var l int
  1181. _ = l
  1182. if m.ResponseRange != nil {
  1183. l = m.ResponseRange.Size()
  1184. n += 1 + l + sovRpc(uint64(l))
  1185. }
  1186. if m.ResponsePut != nil {
  1187. l = m.ResponsePut.Size()
  1188. n += 1 + l + sovRpc(uint64(l))
  1189. }
  1190. if m.ResponseDeleteRange != nil {
  1191. l = m.ResponseDeleteRange.Size()
  1192. n += 1 + l + sovRpc(uint64(l))
  1193. }
  1194. return n
  1195. }
  1196. func (m *Compare) Size() (n int) {
  1197. var l int
  1198. _ = l
  1199. if m.Result != 0 {
  1200. n += 1 + sovRpc(uint64(m.Result))
  1201. }
  1202. if m.Target != 0 {
  1203. n += 1 + sovRpc(uint64(m.Target))
  1204. }
  1205. if m.Key != nil {
  1206. l = len(m.Key)
  1207. if l > 0 {
  1208. n += 1 + l + sovRpc(uint64(l))
  1209. }
  1210. }
  1211. if m.Version != 0 {
  1212. n += 1 + sovRpc(uint64(m.Version))
  1213. }
  1214. if m.CreateRevision != 0 {
  1215. n += 1 + sovRpc(uint64(m.CreateRevision))
  1216. }
  1217. if m.ModRevision != 0 {
  1218. n += 1 + sovRpc(uint64(m.ModRevision))
  1219. }
  1220. if m.Value != nil {
  1221. l = len(m.Value)
  1222. if l > 0 {
  1223. n += 1 + l + sovRpc(uint64(l))
  1224. }
  1225. }
  1226. return n
  1227. }
  1228. func (m *TxnRequest) Size() (n int) {
  1229. var l int
  1230. _ = l
  1231. if len(m.Compare) > 0 {
  1232. for _, e := range m.Compare {
  1233. l = e.Size()
  1234. n += 1 + l + sovRpc(uint64(l))
  1235. }
  1236. }
  1237. if len(m.Success) > 0 {
  1238. for _, e := range m.Success {
  1239. l = e.Size()
  1240. n += 1 + l + sovRpc(uint64(l))
  1241. }
  1242. }
  1243. if len(m.Failure) > 0 {
  1244. for _, e := range m.Failure {
  1245. l = e.Size()
  1246. n += 1 + l + sovRpc(uint64(l))
  1247. }
  1248. }
  1249. return n
  1250. }
  1251. func (m *TxnResponse) Size() (n int) {
  1252. var l int
  1253. _ = l
  1254. if m.Header != nil {
  1255. l = m.Header.Size()
  1256. n += 1 + l + sovRpc(uint64(l))
  1257. }
  1258. if m.Succeeded {
  1259. n += 2
  1260. }
  1261. if len(m.Responses) > 0 {
  1262. for _, e := range m.Responses {
  1263. l = e.Size()
  1264. n += 1 + l + sovRpc(uint64(l))
  1265. }
  1266. }
  1267. return n
  1268. }
  1269. func (m *CompactionRequest) Size() (n int) {
  1270. var l int
  1271. _ = l
  1272. if m.Revision != 0 {
  1273. n += 1 + sovRpc(uint64(m.Revision))
  1274. }
  1275. return n
  1276. }
  1277. func (m *CompactionResponse) Size() (n int) {
  1278. var l int
  1279. _ = l
  1280. if m.Header != nil {
  1281. l = m.Header.Size()
  1282. n += 1 + l + sovRpc(uint64(l))
  1283. }
  1284. return n
  1285. }
  1286. func sovRpc(x uint64) (n int) {
  1287. for {
  1288. n++
  1289. x >>= 7
  1290. if x == 0 {
  1291. break
  1292. }
  1293. }
  1294. return n
  1295. }
  1296. func sozRpc(x uint64) (n int) {
  1297. return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1298. }
  1299. func (m *ResponseHeader) Unmarshal(data []byte) error {
  1300. l := len(data)
  1301. iNdEx := 0
  1302. for iNdEx < l {
  1303. var wire uint64
  1304. for shift := uint(0); ; shift += 7 {
  1305. if iNdEx >= l {
  1306. return io.ErrUnexpectedEOF
  1307. }
  1308. b := data[iNdEx]
  1309. iNdEx++
  1310. wire |= (uint64(b) & 0x7F) << shift
  1311. if b < 0x80 {
  1312. break
  1313. }
  1314. }
  1315. fieldNum := int32(wire >> 3)
  1316. wireType := int(wire & 0x7)
  1317. switch fieldNum {
  1318. case 1:
  1319. if wireType != 2 {
  1320. return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType)
  1321. }
  1322. var stringLen uint64
  1323. for shift := uint(0); ; shift += 7 {
  1324. if iNdEx >= l {
  1325. return io.ErrUnexpectedEOF
  1326. }
  1327. b := data[iNdEx]
  1328. iNdEx++
  1329. stringLen |= (uint64(b) & 0x7F) << shift
  1330. if b < 0x80 {
  1331. break
  1332. }
  1333. }
  1334. intStringLen := int(stringLen)
  1335. if intStringLen < 0 {
  1336. return ErrInvalidLengthRpc
  1337. }
  1338. postIndex := iNdEx + intStringLen
  1339. if postIndex > l {
  1340. return io.ErrUnexpectedEOF
  1341. }
  1342. m.Error = string(data[iNdEx:postIndex])
  1343. iNdEx = postIndex
  1344. case 2:
  1345. if wireType != 0 {
  1346. return fmt.Errorf("proto: wrong wireType = %d for field ClusterId", wireType)
  1347. }
  1348. m.ClusterId = 0
  1349. for shift := uint(0); ; shift += 7 {
  1350. if iNdEx >= l {
  1351. return io.ErrUnexpectedEOF
  1352. }
  1353. b := data[iNdEx]
  1354. iNdEx++
  1355. m.ClusterId |= (uint64(b) & 0x7F) << shift
  1356. if b < 0x80 {
  1357. break
  1358. }
  1359. }
  1360. case 3:
  1361. if wireType != 0 {
  1362. return fmt.Errorf("proto: wrong wireType = %d for field MemberId", wireType)
  1363. }
  1364. m.MemberId = 0
  1365. for shift := uint(0); ; shift += 7 {
  1366. if iNdEx >= l {
  1367. return io.ErrUnexpectedEOF
  1368. }
  1369. b := data[iNdEx]
  1370. iNdEx++
  1371. m.MemberId |= (uint64(b) & 0x7F) << shift
  1372. if b < 0x80 {
  1373. break
  1374. }
  1375. }
  1376. case 4:
  1377. if wireType != 0 {
  1378. return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
  1379. }
  1380. m.Revision = 0
  1381. for shift := uint(0); ; shift += 7 {
  1382. if iNdEx >= l {
  1383. return io.ErrUnexpectedEOF
  1384. }
  1385. b := data[iNdEx]
  1386. iNdEx++
  1387. m.Revision |= (int64(b) & 0x7F) << shift
  1388. if b < 0x80 {
  1389. break
  1390. }
  1391. }
  1392. case 5:
  1393. if wireType != 0 {
  1394. return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType)
  1395. }
  1396. m.RaftTerm = 0
  1397. for shift := uint(0); ; shift += 7 {
  1398. if iNdEx >= l {
  1399. return io.ErrUnexpectedEOF
  1400. }
  1401. b := data[iNdEx]
  1402. iNdEx++
  1403. m.RaftTerm |= (uint64(b) & 0x7F) << shift
  1404. if b < 0x80 {
  1405. break
  1406. }
  1407. }
  1408. default:
  1409. var sizeOfWire int
  1410. for {
  1411. sizeOfWire++
  1412. wire >>= 7
  1413. if wire == 0 {
  1414. break
  1415. }
  1416. }
  1417. iNdEx -= sizeOfWire
  1418. skippy, err := skipRpc(data[iNdEx:])
  1419. if err != nil {
  1420. return err
  1421. }
  1422. if skippy < 0 {
  1423. return ErrInvalidLengthRpc
  1424. }
  1425. if (iNdEx + skippy) > l {
  1426. return io.ErrUnexpectedEOF
  1427. }
  1428. iNdEx += skippy
  1429. }
  1430. }
  1431. return nil
  1432. }
  1433. func (m *RangeRequest) Unmarshal(data []byte) error {
  1434. l := len(data)
  1435. iNdEx := 0
  1436. for iNdEx < l {
  1437. var wire uint64
  1438. for shift := uint(0); ; shift += 7 {
  1439. if iNdEx >= l {
  1440. return io.ErrUnexpectedEOF
  1441. }
  1442. b := data[iNdEx]
  1443. iNdEx++
  1444. wire |= (uint64(b) & 0x7F) << shift
  1445. if b < 0x80 {
  1446. break
  1447. }
  1448. }
  1449. fieldNum := int32(wire >> 3)
  1450. wireType := int(wire & 0x7)
  1451. switch fieldNum {
  1452. case 1:
  1453. if wireType != 2 {
  1454. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  1455. }
  1456. var byteLen int
  1457. for shift := uint(0); ; shift += 7 {
  1458. if iNdEx >= l {
  1459. return io.ErrUnexpectedEOF
  1460. }
  1461. b := data[iNdEx]
  1462. iNdEx++
  1463. byteLen |= (int(b) & 0x7F) << shift
  1464. if b < 0x80 {
  1465. break
  1466. }
  1467. }
  1468. if byteLen < 0 {
  1469. return ErrInvalidLengthRpc
  1470. }
  1471. postIndex := iNdEx + byteLen
  1472. if postIndex > l {
  1473. return io.ErrUnexpectedEOF
  1474. }
  1475. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  1476. iNdEx = postIndex
  1477. case 2:
  1478. if wireType != 2 {
  1479. return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType)
  1480. }
  1481. var byteLen int
  1482. for shift := uint(0); ; shift += 7 {
  1483. if iNdEx >= l {
  1484. return io.ErrUnexpectedEOF
  1485. }
  1486. b := data[iNdEx]
  1487. iNdEx++
  1488. byteLen |= (int(b) & 0x7F) << shift
  1489. if b < 0x80 {
  1490. break
  1491. }
  1492. }
  1493. if byteLen < 0 {
  1494. return ErrInvalidLengthRpc
  1495. }
  1496. postIndex := iNdEx + byteLen
  1497. if postIndex > l {
  1498. return io.ErrUnexpectedEOF
  1499. }
  1500. m.RangeEnd = append([]byte{}, data[iNdEx:postIndex]...)
  1501. iNdEx = postIndex
  1502. case 3:
  1503. if wireType != 0 {
  1504. return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType)
  1505. }
  1506. m.Limit = 0
  1507. for shift := uint(0); ; shift += 7 {
  1508. if iNdEx >= l {
  1509. return io.ErrUnexpectedEOF
  1510. }
  1511. b := data[iNdEx]
  1512. iNdEx++
  1513. m.Limit |= (int64(b) & 0x7F) << shift
  1514. if b < 0x80 {
  1515. break
  1516. }
  1517. }
  1518. case 4:
  1519. if wireType != 0 {
  1520. return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
  1521. }
  1522. m.Revision = 0
  1523. for shift := uint(0); ; shift += 7 {
  1524. if iNdEx >= l {
  1525. return io.ErrUnexpectedEOF
  1526. }
  1527. b := data[iNdEx]
  1528. iNdEx++
  1529. m.Revision |= (int64(b) & 0x7F) << shift
  1530. if b < 0x80 {
  1531. break
  1532. }
  1533. }
  1534. default:
  1535. var sizeOfWire int
  1536. for {
  1537. sizeOfWire++
  1538. wire >>= 7
  1539. if wire == 0 {
  1540. break
  1541. }
  1542. }
  1543. iNdEx -= sizeOfWire
  1544. skippy, err := skipRpc(data[iNdEx:])
  1545. if err != nil {
  1546. return err
  1547. }
  1548. if skippy < 0 {
  1549. return ErrInvalidLengthRpc
  1550. }
  1551. if (iNdEx + skippy) > l {
  1552. return io.ErrUnexpectedEOF
  1553. }
  1554. iNdEx += skippy
  1555. }
  1556. }
  1557. return nil
  1558. }
  1559. func (m *RangeResponse) Unmarshal(data []byte) error {
  1560. l := len(data)
  1561. iNdEx := 0
  1562. for iNdEx < l {
  1563. var wire uint64
  1564. for shift := uint(0); ; shift += 7 {
  1565. if iNdEx >= l {
  1566. return io.ErrUnexpectedEOF
  1567. }
  1568. b := data[iNdEx]
  1569. iNdEx++
  1570. wire |= (uint64(b) & 0x7F) << shift
  1571. if b < 0x80 {
  1572. break
  1573. }
  1574. }
  1575. fieldNum := int32(wire >> 3)
  1576. wireType := int(wire & 0x7)
  1577. switch fieldNum {
  1578. case 1:
  1579. if wireType != 2 {
  1580. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  1581. }
  1582. var msglen int
  1583. for shift := uint(0); ; shift += 7 {
  1584. if iNdEx >= l {
  1585. return io.ErrUnexpectedEOF
  1586. }
  1587. b := data[iNdEx]
  1588. iNdEx++
  1589. msglen |= (int(b) & 0x7F) << shift
  1590. if b < 0x80 {
  1591. break
  1592. }
  1593. }
  1594. if msglen < 0 {
  1595. return ErrInvalidLengthRpc
  1596. }
  1597. postIndex := iNdEx + msglen
  1598. if postIndex > l {
  1599. return io.ErrUnexpectedEOF
  1600. }
  1601. if m.Header == nil {
  1602. m.Header = &ResponseHeader{}
  1603. }
  1604. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  1605. return err
  1606. }
  1607. iNdEx = postIndex
  1608. case 2:
  1609. if wireType != 2 {
  1610. return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType)
  1611. }
  1612. var msglen int
  1613. for shift := uint(0); ; shift += 7 {
  1614. if iNdEx >= l {
  1615. return io.ErrUnexpectedEOF
  1616. }
  1617. b := data[iNdEx]
  1618. iNdEx++
  1619. msglen |= (int(b) & 0x7F) << shift
  1620. if b < 0x80 {
  1621. break
  1622. }
  1623. }
  1624. if msglen < 0 {
  1625. return ErrInvalidLengthRpc
  1626. }
  1627. postIndex := iNdEx + msglen
  1628. if postIndex > l {
  1629. return io.ErrUnexpectedEOF
  1630. }
  1631. m.Kvs = append(m.Kvs, &storagepb.KeyValue{})
  1632. if err := m.Kvs[len(m.Kvs)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  1633. return err
  1634. }
  1635. iNdEx = postIndex
  1636. case 3:
  1637. if wireType != 0 {
  1638. return fmt.Errorf("proto: wrong wireType = %d for field More", wireType)
  1639. }
  1640. var v int
  1641. for shift := uint(0); ; shift += 7 {
  1642. if iNdEx >= l {
  1643. return io.ErrUnexpectedEOF
  1644. }
  1645. b := data[iNdEx]
  1646. iNdEx++
  1647. v |= (int(b) & 0x7F) << shift
  1648. if b < 0x80 {
  1649. break
  1650. }
  1651. }
  1652. m.More = bool(v != 0)
  1653. default:
  1654. var sizeOfWire int
  1655. for {
  1656. sizeOfWire++
  1657. wire >>= 7
  1658. if wire == 0 {
  1659. break
  1660. }
  1661. }
  1662. iNdEx -= sizeOfWire
  1663. skippy, err := skipRpc(data[iNdEx:])
  1664. if err != nil {
  1665. return err
  1666. }
  1667. if skippy < 0 {
  1668. return ErrInvalidLengthRpc
  1669. }
  1670. if (iNdEx + skippy) > l {
  1671. return io.ErrUnexpectedEOF
  1672. }
  1673. iNdEx += skippy
  1674. }
  1675. }
  1676. return nil
  1677. }
  1678. func (m *PutRequest) Unmarshal(data []byte) error {
  1679. l := len(data)
  1680. iNdEx := 0
  1681. for iNdEx < l {
  1682. var wire uint64
  1683. for shift := uint(0); ; shift += 7 {
  1684. if iNdEx >= l {
  1685. return io.ErrUnexpectedEOF
  1686. }
  1687. b := data[iNdEx]
  1688. iNdEx++
  1689. wire |= (uint64(b) & 0x7F) << shift
  1690. if b < 0x80 {
  1691. break
  1692. }
  1693. }
  1694. fieldNum := int32(wire >> 3)
  1695. wireType := int(wire & 0x7)
  1696. switch fieldNum {
  1697. case 1:
  1698. if wireType != 2 {
  1699. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  1700. }
  1701. var byteLen int
  1702. for shift := uint(0); ; shift += 7 {
  1703. if iNdEx >= l {
  1704. return io.ErrUnexpectedEOF
  1705. }
  1706. b := data[iNdEx]
  1707. iNdEx++
  1708. byteLen |= (int(b) & 0x7F) << shift
  1709. if b < 0x80 {
  1710. break
  1711. }
  1712. }
  1713. if byteLen < 0 {
  1714. return ErrInvalidLengthRpc
  1715. }
  1716. postIndex := iNdEx + byteLen
  1717. if postIndex > l {
  1718. return io.ErrUnexpectedEOF
  1719. }
  1720. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  1721. iNdEx = postIndex
  1722. case 2:
  1723. if wireType != 2 {
  1724. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  1725. }
  1726. var byteLen int
  1727. for shift := uint(0); ; shift += 7 {
  1728. if iNdEx >= l {
  1729. return io.ErrUnexpectedEOF
  1730. }
  1731. b := data[iNdEx]
  1732. iNdEx++
  1733. byteLen |= (int(b) & 0x7F) << shift
  1734. if b < 0x80 {
  1735. break
  1736. }
  1737. }
  1738. if byteLen < 0 {
  1739. return ErrInvalidLengthRpc
  1740. }
  1741. postIndex := iNdEx + byteLen
  1742. if postIndex > l {
  1743. return io.ErrUnexpectedEOF
  1744. }
  1745. m.Value = append([]byte{}, data[iNdEx:postIndex]...)
  1746. iNdEx = postIndex
  1747. default:
  1748. var sizeOfWire int
  1749. for {
  1750. sizeOfWire++
  1751. wire >>= 7
  1752. if wire == 0 {
  1753. break
  1754. }
  1755. }
  1756. iNdEx -= sizeOfWire
  1757. skippy, err := skipRpc(data[iNdEx:])
  1758. if err != nil {
  1759. return err
  1760. }
  1761. if skippy < 0 {
  1762. return ErrInvalidLengthRpc
  1763. }
  1764. if (iNdEx + skippy) > l {
  1765. return io.ErrUnexpectedEOF
  1766. }
  1767. iNdEx += skippy
  1768. }
  1769. }
  1770. return nil
  1771. }
  1772. func (m *PutResponse) Unmarshal(data []byte) error {
  1773. l := len(data)
  1774. iNdEx := 0
  1775. for iNdEx < l {
  1776. var wire uint64
  1777. for shift := uint(0); ; shift += 7 {
  1778. if iNdEx >= l {
  1779. return io.ErrUnexpectedEOF
  1780. }
  1781. b := data[iNdEx]
  1782. iNdEx++
  1783. wire |= (uint64(b) & 0x7F) << shift
  1784. if b < 0x80 {
  1785. break
  1786. }
  1787. }
  1788. fieldNum := int32(wire >> 3)
  1789. wireType := int(wire & 0x7)
  1790. switch fieldNum {
  1791. case 1:
  1792. if wireType != 2 {
  1793. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  1794. }
  1795. var msglen int
  1796. for shift := uint(0); ; shift += 7 {
  1797. if iNdEx >= l {
  1798. return io.ErrUnexpectedEOF
  1799. }
  1800. b := data[iNdEx]
  1801. iNdEx++
  1802. msglen |= (int(b) & 0x7F) << shift
  1803. if b < 0x80 {
  1804. break
  1805. }
  1806. }
  1807. if msglen < 0 {
  1808. return ErrInvalidLengthRpc
  1809. }
  1810. postIndex := iNdEx + msglen
  1811. if postIndex > l {
  1812. return io.ErrUnexpectedEOF
  1813. }
  1814. if m.Header == nil {
  1815. m.Header = &ResponseHeader{}
  1816. }
  1817. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  1818. return err
  1819. }
  1820. iNdEx = postIndex
  1821. default:
  1822. var sizeOfWire int
  1823. for {
  1824. sizeOfWire++
  1825. wire >>= 7
  1826. if wire == 0 {
  1827. break
  1828. }
  1829. }
  1830. iNdEx -= sizeOfWire
  1831. skippy, err := skipRpc(data[iNdEx:])
  1832. if err != nil {
  1833. return err
  1834. }
  1835. if skippy < 0 {
  1836. return ErrInvalidLengthRpc
  1837. }
  1838. if (iNdEx + skippy) > l {
  1839. return io.ErrUnexpectedEOF
  1840. }
  1841. iNdEx += skippy
  1842. }
  1843. }
  1844. return nil
  1845. }
  1846. func (m *DeleteRangeRequest) Unmarshal(data []byte) error {
  1847. l := len(data)
  1848. iNdEx := 0
  1849. for iNdEx < l {
  1850. var wire uint64
  1851. for shift := uint(0); ; shift += 7 {
  1852. if iNdEx >= l {
  1853. return io.ErrUnexpectedEOF
  1854. }
  1855. b := data[iNdEx]
  1856. iNdEx++
  1857. wire |= (uint64(b) & 0x7F) << shift
  1858. if b < 0x80 {
  1859. break
  1860. }
  1861. }
  1862. fieldNum := int32(wire >> 3)
  1863. wireType := int(wire & 0x7)
  1864. switch fieldNum {
  1865. case 1:
  1866. if wireType != 2 {
  1867. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  1868. }
  1869. var byteLen int
  1870. for shift := uint(0); ; shift += 7 {
  1871. if iNdEx >= l {
  1872. return io.ErrUnexpectedEOF
  1873. }
  1874. b := data[iNdEx]
  1875. iNdEx++
  1876. byteLen |= (int(b) & 0x7F) << shift
  1877. if b < 0x80 {
  1878. break
  1879. }
  1880. }
  1881. if byteLen < 0 {
  1882. return ErrInvalidLengthRpc
  1883. }
  1884. postIndex := iNdEx + byteLen
  1885. if postIndex > l {
  1886. return io.ErrUnexpectedEOF
  1887. }
  1888. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  1889. iNdEx = postIndex
  1890. case 2:
  1891. if wireType != 2 {
  1892. return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType)
  1893. }
  1894. var byteLen int
  1895. for shift := uint(0); ; shift += 7 {
  1896. if iNdEx >= l {
  1897. return io.ErrUnexpectedEOF
  1898. }
  1899. b := data[iNdEx]
  1900. iNdEx++
  1901. byteLen |= (int(b) & 0x7F) << shift
  1902. if b < 0x80 {
  1903. break
  1904. }
  1905. }
  1906. if byteLen < 0 {
  1907. return ErrInvalidLengthRpc
  1908. }
  1909. postIndex := iNdEx + byteLen
  1910. if postIndex > l {
  1911. return io.ErrUnexpectedEOF
  1912. }
  1913. m.RangeEnd = append([]byte{}, data[iNdEx:postIndex]...)
  1914. iNdEx = postIndex
  1915. default:
  1916. var sizeOfWire int
  1917. for {
  1918. sizeOfWire++
  1919. wire >>= 7
  1920. if wire == 0 {
  1921. break
  1922. }
  1923. }
  1924. iNdEx -= sizeOfWire
  1925. skippy, err := skipRpc(data[iNdEx:])
  1926. if err != nil {
  1927. return err
  1928. }
  1929. if skippy < 0 {
  1930. return ErrInvalidLengthRpc
  1931. }
  1932. if (iNdEx + skippy) > l {
  1933. return io.ErrUnexpectedEOF
  1934. }
  1935. iNdEx += skippy
  1936. }
  1937. }
  1938. return nil
  1939. }
  1940. func (m *DeleteRangeResponse) Unmarshal(data []byte) error {
  1941. l := len(data)
  1942. iNdEx := 0
  1943. for iNdEx < l {
  1944. var wire uint64
  1945. for shift := uint(0); ; shift += 7 {
  1946. if iNdEx >= l {
  1947. return io.ErrUnexpectedEOF
  1948. }
  1949. b := data[iNdEx]
  1950. iNdEx++
  1951. wire |= (uint64(b) & 0x7F) << shift
  1952. if b < 0x80 {
  1953. break
  1954. }
  1955. }
  1956. fieldNum := int32(wire >> 3)
  1957. wireType := int(wire & 0x7)
  1958. switch fieldNum {
  1959. case 1:
  1960. if wireType != 2 {
  1961. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  1962. }
  1963. var msglen int
  1964. for shift := uint(0); ; shift += 7 {
  1965. if iNdEx >= l {
  1966. return io.ErrUnexpectedEOF
  1967. }
  1968. b := data[iNdEx]
  1969. iNdEx++
  1970. msglen |= (int(b) & 0x7F) << shift
  1971. if b < 0x80 {
  1972. break
  1973. }
  1974. }
  1975. if msglen < 0 {
  1976. return ErrInvalidLengthRpc
  1977. }
  1978. postIndex := iNdEx + msglen
  1979. if postIndex > l {
  1980. return io.ErrUnexpectedEOF
  1981. }
  1982. if m.Header == nil {
  1983. m.Header = &ResponseHeader{}
  1984. }
  1985. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  1986. return err
  1987. }
  1988. iNdEx = postIndex
  1989. default:
  1990. var sizeOfWire int
  1991. for {
  1992. sizeOfWire++
  1993. wire >>= 7
  1994. if wire == 0 {
  1995. break
  1996. }
  1997. }
  1998. iNdEx -= sizeOfWire
  1999. skippy, err := skipRpc(data[iNdEx:])
  2000. if err != nil {
  2001. return err
  2002. }
  2003. if skippy < 0 {
  2004. return ErrInvalidLengthRpc
  2005. }
  2006. if (iNdEx + skippy) > l {
  2007. return io.ErrUnexpectedEOF
  2008. }
  2009. iNdEx += skippy
  2010. }
  2011. }
  2012. return nil
  2013. }
  2014. func (m *RequestUnion) Unmarshal(data []byte) error {
  2015. l := len(data)
  2016. iNdEx := 0
  2017. for iNdEx < l {
  2018. var wire uint64
  2019. for shift := uint(0); ; shift += 7 {
  2020. if iNdEx >= l {
  2021. return io.ErrUnexpectedEOF
  2022. }
  2023. b := data[iNdEx]
  2024. iNdEx++
  2025. wire |= (uint64(b) & 0x7F) << shift
  2026. if b < 0x80 {
  2027. break
  2028. }
  2029. }
  2030. fieldNum := int32(wire >> 3)
  2031. wireType := int(wire & 0x7)
  2032. switch fieldNum {
  2033. case 1:
  2034. if wireType != 2 {
  2035. return fmt.Errorf("proto: wrong wireType = %d for field RequestRange", wireType)
  2036. }
  2037. var msglen int
  2038. for shift := uint(0); ; shift += 7 {
  2039. if iNdEx >= l {
  2040. return io.ErrUnexpectedEOF
  2041. }
  2042. b := data[iNdEx]
  2043. iNdEx++
  2044. msglen |= (int(b) & 0x7F) << shift
  2045. if b < 0x80 {
  2046. break
  2047. }
  2048. }
  2049. if msglen < 0 {
  2050. return ErrInvalidLengthRpc
  2051. }
  2052. postIndex := iNdEx + msglen
  2053. if postIndex > l {
  2054. return io.ErrUnexpectedEOF
  2055. }
  2056. if m.RequestRange == nil {
  2057. m.RequestRange = &RangeRequest{}
  2058. }
  2059. if err := m.RequestRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2060. return err
  2061. }
  2062. iNdEx = postIndex
  2063. case 2:
  2064. if wireType != 2 {
  2065. return fmt.Errorf("proto: wrong wireType = %d for field RequestPut", wireType)
  2066. }
  2067. var msglen int
  2068. for shift := uint(0); ; shift += 7 {
  2069. if iNdEx >= l {
  2070. return io.ErrUnexpectedEOF
  2071. }
  2072. b := data[iNdEx]
  2073. iNdEx++
  2074. msglen |= (int(b) & 0x7F) << shift
  2075. if b < 0x80 {
  2076. break
  2077. }
  2078. }
  2079. if msglen < 0 {
  2080. return ErrInvalidLengthRpc
  2081. }
  2082. postIndex := iNdEx + msglen
  2083. if postIndex > l {
  2084. return io.ErrUnexpectedEOF
  2085. }
  2086. if m.RequestPut == nil {
  2087. m.RequestPut = &PutRequest{}
  2088. }
  2089. if err := m.RequestPut.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2090. return err
  2091. }
  2092. iNdEx = postIndex
  2093. case 3:
  2094. if wireType != 2 {
  2095. return fmt.Errorf("proto: wrong wireType = %d for field RequestDeleteRange", wireType)
  2096. }
  2097. var msglen int
  2098. for shift := uint(0); ; shift += 7 {
  2099. if iNdEx >= l {
  2100. return io.ErrUnexpectedEOF
  2101. }
  2102. b := data[iNdEx]
  2103. iNdEx++
  2104. msglen |= (int(b) & 0x7F) << shift
  2105. if b < 0x80 {
  2106. break
  2107. }
  2108. }
  2109. if msglen < 0 {
  2110. return ErrInvalidLengthRpc
  2111. }
  2112. postIndex := iNdEx + msglen
  2113. if postIndex > l {
  2114. return io.ErrUnexpectedEOF
  2115. }
  2116. if m.RequestDeleteRange == nil {
  2117. m.RequestDeleteRange = &DeleteRangeRequest{}
  2118. }
  2119. if err := m.RequestDeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2120. return err
  2121. }
  2122. iNdEx = postIndex
  2123. default:
  2124. var sizeOfWire int
  2125. for {
  2126. sizeOfWire++
  2127. wire >>= 7
  2128. if wire == 0 {
  2129. break
  2130. }
  2131. }
  2132. iNdEx -= sizeOfWire
  2133. skippy, err := skipRpc(data[iNdEx:])
  2134. if err != nil {
  2135. return err
  2136. }
  2137. if skippy < 0 {
  2138. return ErrInvalidLengthRpc
  2139. }
  2140. if (iNdEx + skippy) > l {
  2141. return io.ErrUnexpectedEOF
  2142. }
  2143. iNdEx += skippy
  2144. }
  2145. }
  2146. return nil
  2147. }
  2148. func (m *ResponseUnion) Unmarshal(data []byte) error {
  2149. l := len(data)
  2150. iNdEx := 0
  2151. for iNdEx < l {
  2152. var wire uint64
  2153. for shift := uint(0); ; shift += 7 {
  2154. if iNdEx >= l {
  2155. return io.ErrUnexpectedEOF
  2156. }
  2157. b := data[iNdEx]
  2158. iNdEx++
  2159. wire |= (uint64(b) & 0x7F) << shift
  2160. if b < 0x80 {
  2161. break
  2162. }
  2163. }
  2164. fieldNum := int32(wire >> 3)
  2165. wireType := int(wire & 0x7)
  2166. switch fieldNum {
  2167. case 1:
  2168. if wireType != 2 {
  2169. return fmt.Errorf("proto: wrong wireType = %d for field ResponseRange", wireType)
  2170. }
  2171. var msglen int
  2172. for shift := uint(0); ; shift += 7 {
  2173. if iNdEx >= l {
  2174. return io.ErrUnexpectedEOF
  2175. }
  2176. b := data[iNdEx]
  2177. iNdEx++
  2178. msglen |= (int(b) & 0x7F) << shift
  2179. if b < 0x80 {
  2180. break
  2181. }
  2182. }
  2183. if msglen < 0 {
  2184. return ErrInvalidLengthRpc
  2185. }
  2186. postIndex := iNdEx + msglen
  2187. if postIndex > l {
  2188. return io.ErrUnexpectedEOF
  2189. }
  2190. if m.ResponseRange == nil {
  2191. m.ResponseRange = &RangeResponse{}
  2192. }
  2193. if err := m.ResponseRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2194. return err
  2195. }
  2196. iNdEx = postIndex
  2197. case 2:
  2198. if wireType != 2 {
  2199. return fmt.Errorf("proto: wrong wireType = %d for field ResponsePut", wireType)
  2200. }
  2201. var msglen int
  2202. for shift := uint(0); ; shift += 7 {
  2203. if iNdEx >= l {
  2204. return io.ErrUnexpectedEOF
  2205. }
  2206. b := data[iNdEx]
  2207. iNdEx++
  2208. msglen |= (int(b) & 0x7F) << shift
  2209. if b < 0x80 {
  2210. break
  2211. }
  2212. }
  2213. if msglen < 0 {
  2214. return ErrInvalidLengthRpc
  2215. }
  2216. postIndex := iNdEx + msglen
  2217. if postIndex > l {
  2218. return io.ErrUnexpectedEOF
  2219. }
  2220. if m.ResponsePut == nil {
  2221. m.ResponsePut = &PutResponse{}
  2222. }
  2223. if err := m.ResponsePut.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2224. return err
  2225. }
  2226. iNdEx = postIndex
  2227. case 3:
  2228. if wireType != 2 {
  2229. return fmt.Errorf("proto: wrong wireType = %d for field ResponseDeleteRange", wireType)
  2230. }
  2231. var msglen int
  2232. for shift := uint(0); ; shift += 7 {
  2233. if iNdEx >= l {
  2234. return io.ErrUnexpectedEOF
  2235. }
  2236. b := data[iNdEx]
  2237. iNdEx++
  2238. msglen |= (int(b) & 0x7F) << shift
  2239. if b < 0x80 {
  2240. break
  2241. }
  2242. }
  2243. if msglen < 0 {
  2244. return ErrInvalidLengthRpc
  2245. }
  2246. postIndex := iNdEx + msglen
  2247. if postIndex > l {
  2248. return io.ErrUnexpectedEOF
  2249. }
  2250. if m.ResponseDeleteRange == nil {
  2251. m.ResponseDeleteRange = &DeleteRangeResponse{}
  2252. }
  2253. if err := m.ResponseDeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2254. return err
  2255. }
  2256. iNdEx = postIndex
  2257. default:
  2258. var sizeOfWire int
  2259. for {
  2260. sizeOfWire++
  2261. wire >>= 7
  2262. if wire == 0 {
  2263. break
  2264. }
  2265. }
  2266. iNdEx -= sizeOfWire
  2267. skippy, err := skipRpc(data[iNdEx:])
  2268. if err != nil {
  2269. return err
  2270. }
  2271. if skippy < 0 {
  2272. return ErrInvalidLengthRpc
  2273. }
  2274. if (iNdEx + skippy) > l {
  2275. return io.ErrUnexpectedEOF
  2276. }
  2277. iNdEx += skippy
  2278. }
  2279. }
  2280. return nil
  2281. }
  2282. func (m *Compare) Unmarshal(data []byte) error {
  2283. l := len(data)
  2284. iNdEx := 0
  2285. for iNdEx < l {
  2286. var wire uint64
  2287. for shift := uint(0); ; shift += 7 {
  2288. if iNdEx >= l {
  2289. return io.ErrUnexpectedEOF
  2290. }
  2291. b := data[iNdEx]
  2292. iNdEx++
  2293. wire |= (uint64(b) & 0x7F) << shift
  2294. if b < 0x80 {
  2295. break
  2296. }
  2297. }
  2298. fieldNum := int32(wire >> 3)
  2299. wireType := int(wire & 0x7)
  2300. switch fieldNum {
  2301. case 1:
  2302. if wireType != 0 {
  2303. return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType)
  2304. }
  2305. m.Result = 0
  2306. for shift := uint(0); ; shift += 7 {
  2307. if iNdEx >= l {
  2308. return io.ErrUnexpectedEOF
  2309. }
  2310. b := data[iNdEx]
  2311. iNdEx++
  2312. m.Result |= (Compare_CompareResult(b) & 0x7F) << shift
  2313. if b < 0x80 {
  2314. break
  2315. }
  2316. }
  2317. case 2:
  2318. if wireType != 0 {
  2319. return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
  2320. }
  2321. m.Target = 0
  2322. for shift := uint(0); ; shift += 7 {
  2323. if iNdEx >= l {
  2324. return io.ErrUnexpectedEOF
  2325. }
  2326. b := data[iNdEx]
  2327. iNdEx++
  2328. m.Target |= (Compare_CompareTarget(b) & 0x7F) << shift
  2329. if b < 0x80 {
  2330. break
  2331. }
  2332. }
  2333. case 3:
  2334. if wireType != 2 {
  2335. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  2336. }
  2337. var byteLen int
  2338. for shift := uint(0); ; shift += 7 {
  2339. if iNdEx >= l {
  2340. return io.ErrUnexpectedEOF
  2341. }
  2342. b := data[iNdEx]
  2343. iNdEx++
  2344. byteLen |= (int(b) & 0x7F) << shift
  2345. if b < 0x80 {
  2346. break
  2347. }
  2348. }
  2349. if byteLen < 0 {
  2350. return ErrInvalidLengthRpc
  2351. }
  2352. postIndex := iNdEx + byteLen
  2353. if postIndex > l {
  2354. return io.ErrUnexpectedEOF
  2355. }
  2356. m.Key = append([]byte{}, data[iNdEx:postIndex]...)
  2357. iNdEx = postIndex
  2358. case 4:
  2359. if wireType != 0 {
  2360. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  2361. }
  2362. m.Version = 0
  2363. for shift := uint(0); ; shift += 7 {
  2364. if iNdEx >= l {
  2365. return io.ErrUnexpectedEOF
  2366. }
  2367. b := data[iNdEx]
  2368. iNdEx++
  2369. m.Version |= (int64(b) & 0x7F) << shift
  2370. if b < 0x80 {
  2371. break
  2372. }
  2373. }
  2374. case 5:
  2375. if wireType != 0 {
  2376. return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType)
  2377. }
  2378. m.CreateRevision = 0
  2379. for shift := uint(0); ; shift += 7 {
  2380. if iNdEx >= l {
  2381. return io.ErrUnexpectedEOF
  2382. }
  2383. b := data[iNdEx]
  2384. iNdEx++
  2385. m.CreateRevision |= (int64(b) & 0x7F) << shift
  2386. if b < 0x80 {
  2387. break
  2388. }
  2389. }
  2390. case 6:
  2391. if wireType != 0 {
  2392. return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType)
  2393. }
  2394. m.ModRevision = 0
  2395. for shift := uint(0); ; shift += 7 {
  2396. if iNdEx >= l {
  2397. return io.ErrUnexpectedEOF
  2398. }
  2399. b := data[iNdEx]
  2400. iNdEx++
  2401. m.ModRevision |= (int64(b) & 0x7F) << shift
  2402. if b < 0x80 {
  2403. break
  2404. }
  2405. }
  2406. case 7:
  2407. if wireType != 2 {
  2408. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  2409. }
  2410. var byteLen int
  2411. for shift := uint(0); ; shift += 7 {
  2412. if iNdEx >= l {
  2413. return io.ErrUnexpectedEOF
  2414. }
  2415. b := data[iNdEx]
  2416. iNdEx++
  2417. byteLen |= (int(b) & 0x7F) << shift
  2418. if b < 0x80 {
  2419. break
  2420. }
  2421. }
  2422. if byteLen < 0 {
  2423. return ErrInvalidLengthRpc
  2424. }
  2425. postIndex := iNdEx + byteLen
  2426. if postIndex > l {
  2427. return io.ErrUnexpectedEOF
  2428. }
  2429. m.Value = append([]byte{}, data[iNdEx:postIndex]...)
  2430. iNdEx = postIndex
  2431. default:
  2432. var sizeOfWire int
  2433. for {
  2434. sizeOfWire++
  2435. wire >>= 7
  2436. if wire == 0 {
  2437. break
  2438. }
  2439. }
  2440. iNdEx -= sizeOfWire
  2441. skippy, err := skipRpc(data[iNdEx:])
  2442. if err != nil {
  2443. return err
  2444. }
  2445. if skippy < 0 {
  2446. return ErrInvalidLengthRpc
  2447. }
  2448. if (iNdEx + skippy) > l {
  2449. return io.ErrUnexpectedEOF
  2450. }
  2451. iNdEx += skippy
  2452. }
  2453. }
  2454. return nil
  2455. }
  2456. func (m *TxnRequest) Unmarshal(data []byte) error {
  2457. l := len(data)
  2458. iNdEx := 0
  2459. for iNdEx < l {
  2460. var wire uint64
  2461. for shift := uint(0); ; shift += 7 {
  2462. if iNdEx >= l {
  2463. return io.ErrUnexpectedEOF
  2464. }
  2465. b := data[iNdEx]
  2466. iNdEx++
  2467. wire |= (uint64(b) & 0x7F) << shift
  2468. if b < 0x80 {
  2469. break
  2470. }
  2471. }
  2472. fieldNum := int32(wire >> 3)
  2473. wireType := int(wire & 0x7)
  2474. switch fieldNum {
  2475. case 1:
  2476. if wireType != 2 {
  2477. return fmt.Errorf("proto: wrong wireType = %d for field Compare", wireType)
  2478. }
  2479. var msglen int
  2480. for shift := uint(0); ; shift += 7 {
  2481. if iNdEx >= l {
  2482. return io.ErrUnexpectedEOF
  2483. }
  2484. b := data[iNdEx]
  2485. iNdEx++
  2486. msglen |= (int(b) & 0x7F) << shift
  2487. if b < 0x80 {
  2488. break
  2489. }
  2490. }
  2491. if msglen < 0 {
  2492. return ErrInvalidLengthRpc
  2493. }
  2494. postIndex := iNdEx + msglen
  2495. if postIndex > l {
  2496. return io.ErrUnexpectedEOF
  2497. }
  2498. m.Compare = append(m.Compare, &Compare{})
  2499. if err := m.Compare[len(m.Compare)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2500. return err
  2501. }
  2502. iNdEx = postIndex
  2503. case 2:
  2504. if wireType != 2 {
  2505. return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType)
  2506. }
  2507. var msglen int
  2508. for shift := uint(0); ; shift += 7 {
  2509. if iNdEx >= l {
  2510. return io.ErrUnexpectedEOF
  2511. }
  2512. b := data[iNdEx]
  2513. iNdEx++
  2514. msglen |= (int(b) & 0x7F) << shift
  2515. if b < 0x80 {
  2516. break
  2517. }
  2518. }
  2519. if msglen < 0 {
  2520. return ErrInvalidLengthRpc
  2521. }
  2522. postIndex := iNdEx + msglen
  2523. if postIndex > l {
  2524. return io.ErrUnexpectedEOF
  2525. }
  2526. m.Success = append(m.Success, &RequestUnion{})
  2527. if err := m.Success[len(m.Success)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2528. return err
  2529. }
  2530. iNdEx = postIndex
  2531. case 3:
  2532. if wireType != 2 {
  2533. return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType)
  2534. }
  2535. var msglen int
  2536. for shift := uint(0); ; shift += 7 {
  2537. if iNdEx >= l {
  2538. return io.ErrUnexpectedEOF
  2539. }
  2540. b := data[iNdEx]
  2541. iNdEx++
  2542. msglen |= (int(b) & 0x7F) << shift
  2543. if b < 0x80 {
  2544. break
  2545. }
  2546. }
  2547. if msglen < 0 {
  2548. return ErrInvalidLengthRpc
  2549. }
  2550. postIndex := iNdEx + msglen
  2551. if postIndex > l {
  2552. return io.ErrUnexpectedEOF
  2553. }
  2554. m.Failure = append(m.Failure, &RequestUnion{})
  2555. if err := m.Failure[len(m.Failure)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2556. return err
  2557. }
  2558. iNdEx = postIndex
  2559. default:
  2560. var sizeOfWire int
  2561. for {
  2562. sizeOfWire++
  2563. wire >>= 7
  2564. if wire == 0 {
  2565. break
  2566. }
  2567. }
  2568. iNdEx -= sizeOfWire
  2569. skippy, err := skipRpc(data[iNdEx:])
  2570. if err != nil {
  2571. return err
  2572. }
  2573. if skippy < 0 {
  2574. return ErrInvalidLengthRpc
  2575. }
  2576. if (iNdEx + skippy) > l {
  2577. return io.ErrUnexpectedEOF
  2578. }
  2579. iNdEx += skippy
  2580. }
  2581. }
  2582. return nil
  2583. }
  2584. func (m *TxnResponse) Unmarshal(data []byte) error {
  2585. l := len(data)
  2586. iNdEx := 0
  2587. for iNdEx < l {
  2588. var wire uint64
  2589. for shift := uint(0); ; shift += 7 {
  2590. if iNdEx >= l {
  2591. return io.ErrUnexpectedEOF
  2592. }
  2593. b := data[iNdEx]
  2594. iNdEx++
  2595. wire |= (uint64(b) & 0x7F) << shift
  2596. if b < 0x80 {
  2597. break
  2598. }
  2599. }
  2600. fieldNum := int32(wire >> 3)
  2601. wireType := int(wire & 0x7)
  2602. switch fieldNum {
  2603. case 1:
  2604. if wireType != 2 {
  2605. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  2606. }
  2607. var msglen int
  2608. for shift := uint(0); ; shift += 7 {
  2609. if iNdEx >= l {
  2610. return io.ErrUnexpectedEOF
  2611. }
  2612. b := data[iNdEx]
  2613. iNdEx++
  2614. msglen |= (int(b) & 0x7F) << shift
  2615. if b < 0x80 {
  2616. break
  2617. }
  2618. }
  2619. if msglen < 0 {
  2620. return ErrInvalidLengthRpc
  2621. }
  2622. postIndex := iNdEx + msglen
  2623. if postIndex > l {
  2624. return io.ErrUnexpectedEOF
  2625. }
  2626. if m.Header == nil {
  2627. m.Header = &ResponseHeader{}
  2628. }
  2629. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2630. return err
  2631. }
  2632. iNdEx = postIndex
  2633. case 2:
  2634. if wireType != 0 {
  2635. return fmt.Errorf("proto: wrong wireType = %d for field Succeeded", wireType)
  2636. }
  2637. var v int
  2638. for shift := uint(0); ; shift += 7 {
  2639. if iNdEx >= l {
  2640. return io.ErrUnexpectedEOF
  2641. }
  2642. b := data[iNdEx]
  2643. iNdEx++
  2644. v |= (int(b) & 0x7F) << shift
  2645. if b < 0x80 {
  2646. break
  2647. }
  2648. }
  2649. m.Succeeded = bool(v != 0)
  2650. case 3:
  2651. if wireType != 2 {
  2652. return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType)
  2653. }
  2654. var msglen int
  2655. for shift := uint(0); ; shift += 7 {
  2656. if iNdEx >= l {
  2657. return io.ErrUnexpectedEOF
  2658. }
  2659. b := data[iNdEx]
  2660. iNdEx++
  2661. msglen |= (int(b) & 0x7F) << shift
  2662. if b < 0x80 {
  2663. break
  2664. }
  2665. }
  2666. if msglen < 0 {
  2667. return ErrInvalidLengthRpc
  2668. }
  2669. postIndex := iNdEx + msglen
  2670. if postIndex > l {
  2671. return io.ErrUnexpectedEOF
  2672. }
  2673. m.Responses = append(m.Responses, &ResponseUnion{})
  2674. if err := m.Responses[len(m.Responses)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2675. return err
  2676. }
  2677. iNdEx = postIndex
  2678. default:
  2679. var sizeOfWire int
  2680. for {
  2681. sizeOfWire++
  2682. wire >>= 7
  2683. if wire == 0 {
  2684. break
  2685. }
  2686. }
  2687. iNdEx -= sizeOfWire
  2688. skippy, err := skipRpc(data[iNdEx:])
  2689. if err != nil {
  2690. return err
  2691. }
  2692. if skippy < 0 {
  2693. return ErrInvalidLengthRpc
  2694. }
  2695. if (iNdEx + skippy) > l {
  2696. return io.ErrUnexpectedEOF
  2697. }
  2698. iNdEx += skippy
  2699. }
  2700. }
  2701. return nil
  2702. }
  2703. func (m *CompactionRequest) Unmarshal(data []byte) error {
  2704. l := len(data)
  2705. iNdEx := 0
  2706. for iNdEx < l {
  2707. var wire uint64
  2708. for shift := uint(0); ; shift += 7 {
  2709. if iNdEx >= l {
  2710. return io.ErrUnexpectedEOF
  2711. }
  2712. b := data[iNdEx]
  2713. iNdEx++
  2714. wire |= (uint64(b) & 0x7F) << shift
  2715. if b < 0x80 {
  2716. break
  2717. }
  2718. }
  2719. fieldNum := int32(wire >> 3)
  2720. wireType := int(wire & 0x7)
  2721. switch fieldNum {
  2722. case 1:
  2723. if wireType != 0 {
  2724. return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
  2725. }
  2726. m.Revision = 0
  2727. for shift := uint(0); ; shift += 7 {
  2728. if iNdEx >= l {
  2729. return io.ErrUnexpectedEOF
  2730. }
  2731. b := data[iNdEx]
  2732. iNdEx++
  2733. m.Revision |= (int64(b) & 0x7F) << shift
  2734. if b < 0x80 {
  2735. break
  2736. }
  2737. }
  2738. default:
  2739. var sizeOfWire int
  2740. for {
  2741. sizeOfWire++
  2742. wire >>= 7
  2743. if wire == 0 {
  2744. break
  2745. }
  2746. }
  2747. iNdEx -= sizeOfWire
  2748. skippy, err := skipRpc(data[iNdEx:])
  2749. if err != nil {
  2750. return err
  2751. }
  2752. if skippy < 0 {
  2753. return ErrInvalidLengthRpc
  2754. }
  2755. if (iNdEx + skippy) > l {
  2756. return io.ErrUnexpectedEOF
  2757. }
  2758. iNdEx += skippy
  2759. }
  2760. }
  2761. return nil
  2762. }
  2763. func (m *CompactionResponse) Unmarshal(data []byte) error {
  2764. l := len(data)
  2765. iNdEx := 0
  2766. for iNdEx < l {
  2767. var wire uint64
  2768. for shift := uint(0); ; shift += 7 {
  2769. if iNdEx >= l {
  2770. return io.ErrUnexpectedEOF
  2771. }
  2772. b := data[iNdEx]
  2773. iNdEx++
  2774. wire |= (uint64(b) & 0x7F) << shift
  2775. if b < 0x80 {
  2776. break
  2777. }
  2778. }
  2779. fieldNum := int32(wire >> 3)
  2780. wireType := int(wire & 0x7)
  2781. switch fieldNum {
  2782. case 1:
  2783. if wireType != 2 {
  2784. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  2785. }
  2786. var msglen int
  2787. for shift := uint(0); ; shift += 7 {
  2788. if iNdEx >= l {
  2789. return io.ErrUnexpectedEOF
  2790. }
  2791. b := data[iNdEx]
  2792. iNdEx++
  2793. msglen |= (int(b) & 0x7F) << shift
  2794. if b < 0x80 {
  2795. break
  2796. }
  2797. }
  2798. if msglen < 0 {
  2799. return ErrInvalidLengthRpc
  2800. }
  2801. postIndex := iNdEx + msglen
  2802. if postIndex > l {
  2803. return io.ErrUnexpectedEOF
  2804. }
  2805. if m.Header == nil {
  2806. m.Header = &ResponseHeader{}
  2807. }
  2808. if err := m.Header.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2809. return err
  2810. }
  2811. iNdEx = postIndex
  2812. default:
  2813. var sizeOfWire int
  2814. for {
  2815. sizeOfWire++
  2816. wire >>= 7
  2817. if wire == 0 {
  2818. break
  2819. }
  2820. }
  2821. iNdEx -= sizeOfWire
  2822. skippy, err := skipRpc(data[iNdEx:])
  2823. if err != nil {
  2824. return err
  2825. }
  2826. if skippy < 0 {
  2827. return ErrInvalidLengthRpc
  2828. }
  2829. if (iNdEx + skippy) > l {
  2830. return io.ErrUnexpectedEOF
  2831. }
  2832. iNdEx += skippy
  2833. }
  2834. }
  2835. return nil
  2836. }
  2837. func skipRpc(data []byte) (n int, err error) {
  2838. l := len(data)
  2839. iNdEx := 0
  2840. for iNdEx < l {
  2841. var wire uint64
  2842. for shift := uint(0); ; shift += 7 {
  2843. if iNdEx >= l {
  2844. return 0, io.ErrUnexpectedEOF
  2845. }
  2846. b := data[iNdEx]
  2847. iNdEx++
  2848. wire |= (uint64(b) & 0x7F) << shift
  2849. if b < 0x80 {
  2850. break
  2851. }
  2852. }
  2853. wireType := int(wire & 0x7)
  2854. switch wireType {
  2855. case 0:
  2856. for {
  2857. if iNdEx >= l {
  2858. return 0, io.ErrUnexpectedEOF
  2859. }
  2860. iNdEx++
  2861. if data[iNdEx-1] < 0x80 {
  2862. break
  2863. }
  2864. }
  2865. return iNdEx, nil
  2866. case 1:
  2867. iNdEx += 8
  2868. return iNdEx, nil
  2869. case 2:
  2870. var length int
  2871. for shift := uint(0); ; shift += 7 {
  2872. if iNdEx >= l {
  2873. return 0, io.ErrUnexpectedEOF
  2874. }
  2875. b := data[iNdEx]
  2876. iNdEx++
  2877. length |= (int(b) & 0x7F) << shift
  2878. if b < 0x80 {
  2879. break
  2880. }
  2881. }
  2882. iNdEx += length
  2883. if length < 0 {
  2884. return 0, ErrInvalidLengthRpc
  2885. }
  2886. return iNdEx, nil
  2887. case 3:
  2888. for {
  2889. var innerWire uint64
  2890. var start int = iNdEx
  2891. for shift := uint(0); ; shift += 7 {
  2892. if iNdEx >= l {
  2893. return 0, io.ErrUnexpectedEOF
  2894. }
  2895. b := data[iNdEx]
  2896. iNdEx++
  2897. innerWire |= (uint64(b) & 0x7F) << shift
  2898. if b < 0x80 {
  2899. break
  2900. }
  2901. }
  2902. innerWireType := int(innerWire & 0x7)
  2903. if innerWireType == 4 {
  2904. break
  2905. }
  2906. next, err := skipRpc(data[start:])
  2907. if err != nil {
  2908. return 0, err
  2909. }
  2910. iNdEx = start + next
  2911. }
  2912. return iNdEx, nil
  2913. case 4:
  2914. return iNdEx, nil
  2915. case 5:
  2916. iNdEx += 4
  2917. return iNdEx, nil
  2918. default:
  2919. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  2920. }
  2921. }
  2922. panic("unreachable")
  2923. }
  2924. var (
  2925. ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling")
  2926. )