bep.pb.go 96 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058
  1. // Code generated by protoc-gen-gogo.
  2. // source: bep.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package protocol is a generated protocol buffer package.
  6. It is generated from these files:
  7. bep.proto
  8. It has these top-level messages:
  9. Hello
  10. Header
  11. ClusterConfig
  12. Folder
  13. Device
  14. Index
  15. IndexUpdate
  16. FileInfo
  17. BlockInfo
  18. Vector
  19. Counter
  20. Request
  21. Response
  22. DownloadProgress
  23. FileDownloadProgressUpdate
  24. Ping
  25. Close
  26. */
  27. package protocol
  28. import proto "github.com/gogo/protobuf/proto"
  29. import fmt "fmt"
  30. import math "math"
  31. import _ "github.com/gogo/protobuf/gogoproto"
  32. import io "io"
  33. // Reference imports to suppress errors if they are not otherwise used.
  34. var _ = proto.Marshal
  35. var _ = fmt.Errorf
  36. var _ = math.Inf
  37. // This is a compile-time assertion to ensure that this generated file
  38. // is compatible with the proto package it is being compiled against.
  39. const _ = proto.GoGoProtoPackageIsVersion1
  40. type MessageType int32
  41. const (
  42. messageTypeClusterConfig MessageType = 0
  43. messageTypeIndex MessageType = 1
  44. messageTypeIndexUpdate MessageType = 2
  45. messageTypeRequest MessageType = 3
  46. messageTypeResponse MessageType = 4
  47. messageTypeDownloadProgress MessageType = 5
  48. messageTypePing MessageType = 6
  49. messageTypeClose MessageType = 7
  50. )
  51. var MessageType_name = map[int32]string{
  52. 0: "CLUSTER_CONFIG",
  53. 1: "INDEX",
  54. 2: "INDEX_UPDATE",
  55. 3: "REQUEST",
  56. 4: "RESPONSE",
  57. 5: "DOWNLOAD_PROGRESS",
  58. 6: "PING",
  59. 7: "CLOSE",
  60. }
  61. var MessageType_value = map[string]int32{
  62. "CLUSTER_CONFIG": 0,
  63. "INDEX": 1,
  64. "INDEX_UPDATE": 2,
  65. "REQUEST": 3,
  66. "RESPONSE": 4,
  67. "DOWNLOAD_PROGRESS": 5,
  68. "PING": 6,
  69. "CLOSE": 7,
  70. }
  71. func (x MessageType) String() string {
  72. return proto.EnumName(MessageType_name, int32(x))
  73. }
  74. func (MessageType) EnumDescriptor() ([]byte, []int) { return fileDescriptorBep, []int{0} }
  75. type MessageCompression int32
  76. const (
  77. MessageCompressionNone MessageCompression = 0
  78. MessageCompressionLZ4 MessageCompression = 1
  79. )
  80. var MessageCompression_name = map[int32]string{
  81. 0: "NONE",
  82. 1: "LZ4",
  83. }
  84. var MessageCompression_value = map[string]int32{
  85. "NONE": 0,
  86. "LZ4": 1,
  87. }
  88. func (x MessageCompression) String() string {
  89. return proto.EnumName(MessageCompression_name, int32(x))
  90. }
  91. func (MessageCompression) EnumDescriptor() ([]byte, []int) { return fileDescriptorBep, []int{1} }
  92. type Compression int32
  93. const (
  94. CompressMetadata Compression = 0
  95. CompressNever Compression = 1
  96. CompressAlways Compression = 2
  97. )
  98. var Compression_name = map[int32]string{
  99. 0: "METADATA",
  100. 1: "NEVER",
  101. 2: "ALWAYS",
  102. }
  103. var Compression_value = map[string]int32{
  104. "METADATA": 0,
  105. "NEVER": 1,
  106. "ALWAYS": 2,
  107. }
  108. func (x Compression) String() string {
  109. return proto.EnumName(Compression_name, int32(x))
  110. }
  111. func (Compression) EnumDescriptor() ([]byte, []int) { return fileDescriptorBep, []int{2} }
  112. type FileInfoType int32
  113. const (
  114. FileInfoTypeFile FileInfoType = 0
  115. FileInfoTypeDirectory FileInfoType = 1
  116. FileInfoTypeSymlinkFile FileInfoType = 2
  117. FileInfoTypeSymlinkDirectory FileInfoType = 3
  118. FileInfoTypeSymlinkUnknown FileInfoType = 4
  119. )
  120. var FileInfoType_name = map[int32]string{
  121. 0: "FILE",
  122. 1: "DIRECTORY",
  123. 2: "SYMLINK_FILE",
  124. 3: "SYMLINK_DIRECTORY",
  125. 4: "SYMLINK_UNKNOWN",
  126. }
  127. var FileInfoType_value = map[string]int32{
  128. "FILE": 0,
  129. "DIRECTORY": 1,
  130. "SYMLINK_FILE": 2,
  131. "SYMLINK_DIRECTORY": 3,
  132. "SYMLINK_UNKNOWN": 4,
  133. }
  134. func (x FileInfoType) String() string {
  135. return proto.EnumName(FileInfoType_name, int32(x))
  136. }
  137. func (FileInfoType) EnumDescriptor() ([]byte, []int) { return fileDescriptorBep, []int{3} }
  138. type ErrorCode int32
  139. const (
  140. ErrorCodeNoError ErrorCode = 0
  141. ErrorCodeGeneric ErrorCode = 1
  142. ErrorCodeNoSuchFile ErrorCode = 2
  143. ErrorCodeInvalidFile ErrorCode = 3
  144. )
  145. var ErrorCode_name = map[int32]string{
  146. 0: "NO_ERROR",
  147. 1: "GENERIC",
  148. 2: "NO_SUCH_FILE",
  149. 3: "INVALID_FILE",
  150. }
  151. var ErrorCode_value = map[string]int32{
  152. "NO_ERROR": 0,
  153. "GENERIC": 1,
  154. "NO_SUCH_FILE": 2,
  155. "INVALID_FILE": 3,
  156. }
  157. func (x ErrorCode) String() string {
  158. return proto.EnumName(ErrorCode_name, int32(x))
  159. }
  160. func (ErrorCode) EnumDescriptor() ([]byte, []int) { return fileDescriptorBep, []int{4} }
  161. type FileDownloadProgressUpdateType int32
  162. const (
  163. UpdateTypeAppend FileDownloadProgressUpdateType = 0
  164. UpdateTypeForget FileDownloadProgressUpdateType = 1
  165. )
  166. var FileDownloadProgressUpdateType_name = map[int32]string{
  167. 0: "APPEND",
  168. 1: "FORGET",
  169. }
  170. var FileDownloadProgressUpdateType_value = map[string]int32{
  171. "APPEND": 0,
  172. "FORGET": 1,
  173. }
  174. func (x FileDownloadProgressUpdateType) String() string {
  175. return proto.EnumName(FileDownloadProgressUpdateType_name, int32(x))
  176. }
  177. func (FileDownloadProgressUpdateType) EnumDescriptor() ([]byte, []int) {
  178. return fileDescriptorBep, []int{5}
  179. }
  180. type Hello struct {
  181. DeviceName string `protobuf:"bytes,1,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"`
  182. ClientName string `protobuf:"bytes,2,opt,name=client_name,json=clientName,proto3" json:"client_name,omitempty"`
  183. ClientVersion string `protobuf:"bytes,3,opt,name=client_version,json=clientVersion,proto3" json:"client_version,omitempty"`
  184. }
  185. func (m *Hello) Reset() { *m = Hello{} }
  186. func (m *Hello) String() string { return proto.CompactTextString(m) }
  187. func (*Hello) ProtoMessage() {}
  188. func (*Hello) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{0} }
  189. type Header struct {
  190. Type MessageType `protobuf:"varint,1,opt,name=type,proto3,enum=protocol.MessageType" json:"type,omitempty"`
  191. Compression MessageCompression `protobuf:"varint,2,opt,name=compression,proto3,enum=protocol.MessageCompression" json:"compression,omitempty"`
  192. }
  193. func (m *Header) Reset() { *m = Header{} }
  194. func (m *Header) String() string { return proto.CompactTextString(m) }
  195. func (*Header) ProtoMessage() {}
  196. func (*Header) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{1} }
  197. type ClusterConfig struct {
  198. Folders []Folder `protobuf:"bytes,1,rep,name=folders" json:"folders"`
  199. }
  200. func (m *ClusterConfig) Reset() { *m = ClusterConfig{} }
  201. func (m *ClusterConfig) String() string { return proto.CompactTextString(m) }
  202. func (*ClusterConfig) ProtoMessage() {}
  203. func (*ClusterConfig) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{2} }
  204. type Folder struct {
  205. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  206. Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
  207. ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
  208. IgnorePermissions bool `protobuf:"varint,4,opt,name=ignore_permissions,json=ignorePermissions,proto3" json:"ignore_permissions,omitempty"`
  209. IgnoreDelete bool `protobuf:"varint,5,opt,name=ignore_delete,json=ignoreDelete,proto3" json:"ignore_delete,omitempty"`
  210. DisableTempIndexes bool `protobuf:"varint,6,opt,name=disable_temp_indexes,json=disableTempIndexes,proto3" json:"disable_temp_indexes,omitempty"`
  211. Devices []Device `protobuf:"bytes,16,rep,name=devices" json:"devices"`
  212. }
  213. func (m *Folder) Reset() { *m = Folder{} }
  214. func (m *Folder) String() string { return proto.CompactTextString(m) }
  215. func (*Folder) ProtoMessage() {}
  216. func (*Folder) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{3} }
  217. type Device struct {
  218. ID []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  219. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
  220. Addresses []string `protobuf:"bytes,3,rep,name=addresses" json:"addresses,omitempty"`
  221. Compression Compression `protobuf:"varint,4,opt,name=compression,proto3,enum=protocol.Compression" json:"compression,omitempty"`
  222. CertName string `protobuf:"bytes,5,opt,name=cert_name,json=certName,proto3" json:"cert_name,omitempty"`
  223. MaxSequence int64 `protobuf:"varint,6,opt,name=max_sequence,json=maxSequence,proto3" json:"max_sequence,omitempty"`
  224. Introducer bool `protobuf:"varint,7,opt,name=introducer,proto3" json:"introducer,omitempty"`
  225. IndexID IndexID `protobuf:"varint,8,opt,name=index_id,json=indexId,proto3,customtype=IndexID" json:"index_id"`
  226. }
  227. func (m *Device) Reset() { *m = Device{} }
  228. func (m *Device) String() string { return proto.CompactTextString(m) }
  229. func (*Device) ProtoMessage() {}
  230. func (*Device) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{4} }
  231. type Index struct {
  232. Folder string `protobuf:"bytes,1,opt,name=folder,proto3" json:"folder,omitempty"`
  233. Files []FileInfo `protobuf:"bytes,2,rep,name=files" json:"files"`
  234. }
  235. func (m *Index) Reset() { *m = Index{} }
  236. func (m *Index) String() string { return proto.CompactTextString(m) }
  237. func (*Index) ProtoMessage() {}
  238. func (*Index) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{5} }
  239. type IndexUpdate struct {
  240. Folder string `protobuf:"bytes,1,opt,name=folder,proto3" json:"folder,omitempty"`
  241. Files []FileInfo `protobuf:"bytes,2,rep,name=files" json:"files"`
  242. }
  243. func (m *IndexUpdate) Reset() { *m = IndexUpdate{} }
  244. func (m *IndexUpdate) String() string { return proto.CompactTextString(m) }
  245. func (*IndexUpdate) ProtoMessage() {}
  246. func (*IndexUpdate) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{6} }
  247. type FileInfo struct {
  248. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  249. Type FileInfoType `protobuf:"varint,2,opt,name=type,proto3,enum=protocol.FileInfoType" json:"type,omitempty"`
  250. Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
  251. Permissions uint32 `protobuf:"varint,4,opt,name=permissions,proto3" json:"permissions,omitempty"`
  252. ModifiedS int64 `protobuf:"varint,5,opt,name=modified_s,json=modifiedS,proto3" json:"modified_s,omitempty"`
  253. ModifiedNs int32 `protobuf:"varint,11,opt,name=modified_ns,json=modifiedNs,proto3" json:"modified_ns,omitempty"`
  254. Deleted bool `protobuf:"varint,6,opt,name=deleted,proto3" json:"deleted,omitempty"`
  255. Invalid bool `protobuf:"varint,7,opt,name=invalid,proto3" json:"invalid,omitempty"`
  256. NoPermissions bool `protobuf:"varint,8,opt,name=no_permissions,json=noPermissions,proto3" json:"no_permissions,omitempty"`
  257. Version Vector `protobuf:"bytes,9,opt,name=version" json:"version"`
  258. Sequence int64 `protobuf:"varint,10,opt,name=sequence,proto3" json:"sequence,omitempty"`
  259. Blocks []BlockInfo `protobuf:"bytes,16,rep,name=Blocks,json=blocks" json:"Blocks"`
  260. }
  261. func (m *FileInfo) Reset() { *m = FileInfo{} }
  262. func (*FileInfo) ProtoMessage() {}
  263. func (*FileInfo) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{7} }
  264. type BlockInfo struct {
  265. Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
  266. Size int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
  267. Hash []byte `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"`
  268. }
  269. func (m *BlockInfo) Reset() { *m = BlockInfo{} }
  270. func (*BlockInfo) ProtoMessage() {}
  271. func (*BlockInfo) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{8} }
  272. type Vector struct {
  273. Counters []Counter `protobuf:"bytes,1,rep,name=counters" json:"counters"`
  274. }
  275. func (m *Vector) Reset() { *m = Vector{} }
  276. func (m *Vector) String() string { return proto.CompactTextString(m) }
  277. func (*Vector) ProtoMessage() {}
  278. func (*Vector) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{9} }
  279. type Counter struct {
  280. ID ShortID `protobuf:"varint,1,opt,name=id,proto3,customtype=ShortID" json:"id"`
  281. Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
  282. }
  283. func (m *Counter) Reset() { *m = Counter{} }
  284. func (m *Counter) String() string { return proto.CompactTextString(m) }
  285. func (*Counter) ProtoMessage() {}
  286. func (*Counter) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{10} }
  287. type Request struct {
  288. ID int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
  289. Folder string `protobuf:"bytes,2,opt,name=folder,proto3" json:"folder,omitempty"`
  290. Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
  291. Offset int64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
  292. Size int32 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"`
  293. Hash []byte `protobuf:"bytes,6,opt,name=hash,proto3" json:"hash,omitempty"`
  294. FromTemporary bool `protobuf:"varint,7,opt,name=from_temporary,json=fromTemporary,proto3" json:"from_temporary,omitempty"`
  295. }
  296. func (m *Request) Reset() { *m = Request{} }
  297. func (m *Request) String() string { return proto.CompactTextString(m) }
  298. func (*Request) ProtoMessage() {}
  299. func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{11} }
  300. type Response struct {
  301. ID int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
  302. Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
  303. Code ErrorCode `protobuf:"varint,3,opt,name=code,proto3,enum=protocol.ErrorCode" json:"code,omitempty"`
  304. }
  305. func (m *Response) Reset() { *m = Response{} }
  306. func (m *Response) String() string { return proto.CompactTextString(m) }
  307. func (*Response) ProtoMessage() {}
  308. func (*Response) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{12} }
  309. type DownloadProgress struct {
  310. Folder string `protobuf:"bytes,1,opt,name=folder,proto3" json:"folder,omitempty"`
  311. Updates []FileDownloadProgressUpdate `protobuf:"bytes,2,rep,name=updates" json:"updates"`
  312. }
  313. func (m *DownloadProgress) Reset() { *m = DownloadProgress{} }
  314. func (m *DownloadProgress) String() string { return proto.CompactTextString(m) }
  315. func (*DownloadProgress) ProtoMessage() {}
  316. func (*DownloadProgress) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{13} }
  317. type FileDownloadProgressUpdate struct {
  318. UpdateType FileDownloadProgressUpdateType `protobuf:"varint,1,opt,name=update_type,json=updateType,proto3,enum=protocol.FileDownloadProgressUpdateType" json:"update_type,omitempty"`
  319. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
  320. Version Vector `protobuf:"bytes,3,opt,name=version" json:"version"`
  321. BlockIndexes []int32 `protobuf:"varint,4,rep,name=block_indexes,json=blockIndexes" json:"block_indexes,omitempty"`
  322. }
  323. func (m *FileDownloadProgressUpdate) Reset() { *m = FileDownloadProgressUpdate{} }
  324. func (m *FileDownloadProgressUpdate) String() string { return proto.CompactTextString(m) }
  325. func (*FileDownloadProgressUpdate) ProtoMessage() {}
  326. func (*FileDownloadProgressUpdate) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{14} }
  327. type Ping struct {
  328. }
  329. func (m *Ping) Reset() { *m = Ping{} }
  330. func (m *Ping) String() string { return proto.CompactTextString(m) }
  331. func (*Ping) ProtoMessage() {}
  332. func (*Ping) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{15} }
  333. type Close struct {
  334. Reason string `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"`
  335. }
  336. func (m *Close) Reset() { *m = Close{} }
  337. func (m *Close) String() string { return proto.CompactTextString(m) }
  338. func (*Close) ProtoMessage() {}
  339. func (*Close) Descriptor() ([]byte, []int) { return fileDescriptorBep, []int{16} }
  340. func init() {
  341. proto.RegisterType((*Hello)(nil), "protocol.Hello")
  342. proto.RegisterType((*Header)(nil), "protocol.Header")
  343. proto.RegisterType((*ClusterConfig)(nil), "protocol.ClusterConfig")
  344. proto.RegisterType((*Folder)(nil), "protocol.Folder")
  345. proto.RegisterType((*Device)(nil), "protocol.Device")
  346. proto.RegisterType((*Index)(nil), "protocol.Index")
  347. proto.RegisterType((*IndexUpdate)(nil), "protocol.IndexUpdate")
  348. proto.RegisterType((*FileInfo)(nil), "protocol.FileInfo")
  349. proto.RegisterType((*BlockInfo)(nil), "protocol.BlockInfo")
  350. proto.RegisterType((*Vector)(nil), "protocol.Vector")
  351. proto.RegisterType((*Counter)(nil), "protocol.Counter")
  352. proto.RegisterType((*Request)(nil), "protocol.Request")
  353. proto.RegisterType((*Response)(nil), "protocol.Response")
  354. proto.RegisterType((*DownloadProgress)(nil), "protocol.DownloadProgress")
  355. proto.RegisterType((*FileDownloadProgressUpdate)(nil), "protocol.FileDownloadProgressUpdate")
  356. proto.RegisterType((*Ping)(nil), "protocol.Ping")
  357. proto.RegisterType((*Close)(nil), "protocol.Close")
  358. proto.RegisterEnum("protocol.MessageType", MessageType_name, MessageType_value)
  359. proto.RegisterEnum("protocol.MessageCompression", MessageCompression_name, MessageCompression_value)
  360. proto.RegisterEnum("protocol.Compression", Compression_name, Compression_value)
  361. proto.RegisterEnum("protocol.FileInfoType", FileInfoType_name, FileInfoType_value)
  362. proto.RegisterEnum("protocol.ErrorCode", ErrorCode_name, ErrorCode_value)
  363. proto.RegisterEnum("protocol.FileDownloadProgressUpdateType", FileDownloadProgressUpdateType_name, FileDownloadProgressUpdateType_value)
  364. }
  365. func (m *Hello) Marshal() (data []byte, err error) {
  366. size := m.ProtoSize()
  367. data = make([]byte, size)
  368. n, err := m.MarshalTo(data)
  369. if err != nil {
  370. return nil, err
  371. }
  372. return data[:n], nil
  373. }
  374. func (m *Hello) MarshalTo(data []byte) (int, error) {
  375. var i int
  376. _ = i
  377. var l int
  378. _ = l
  379. if len(m.DeviceName) > 0 {
  380. data[i] = 0xa
  381. i++
  382. i = encodeVarintBep(data, i, uint64(len(m.DeviceName)))
  383. i += copy(data[i:], m.DeviceName)
  384. }
  385. if len(m.ClientName) > 0 {
  386. data[i] = 0x12
  387. i++
  388. i = encodeVarintBep(data, i, uint64(len(m.ClientName)))
  389. i += copy(data[i:], m.ClientName)
  390. }
  391. if len(m.ClientVersion) > 0 {
  392. data[i] = 0x1a
  393. i++
  394. i = encodeVarintBep(data, i, uint64(len(m.ClientVersion)))
  395. i += copy(data[i:], m.ClientVersion)
  396. }
  397. return i, nil
  398. }
  399. func (m *Header) Marshal() (data []byte, err error) {
  400. size := m.ProtoSize()
  401. data = make([]byte, size)
  402. n, err := m.MarshalTo(data)
  403. if err != nil {
  404. return nil, err
  405. }
  406. return data[:n], nil
  407. }
  408. func (m *Header) MarshalTo(data []byte) (int, error) {
  409. var i int
  410. _ = i
  411. var l int
  412. _ = l
  413. if m.Type != 0 {
  414. data[i] = 0x8
  415. i++
  416. i = encodeVarintBep(data, i, uint64(m.Type))
  417. }
  418. if m.Compression != 0 {
  419. data[i] = 0x10
  420. i++
  421. i = encodeVarintBep(data, i, uint64(m.Compression))
  422. }
  423. return i, nil
  424. }
  425. func (m *ClusterConfig) Marshal() (data []byte, err error) {
  426. size := m.ProtoSize()
  427. data = make([]byte, size)
  428. n, err := m.MarshalTo(data)
  429. if err != nil {
  430. return nil, err
  431. }
  432. return data[:n], nil
  433. }
  434. func (m *ClusterConfig) MarshalTo(data []byte) (int, error) {
  435. var i int
  436. _ = i
  437. var l int
  438. _ = l
  439. if len(m.Folders) > 0 {
  440. for _, msg := range m.Folders {
  441. data[i] = 0xa
  442. i++
  443. i = encodeVarintBep(data, i, uint64(msg.ProtoSize()))
  444. n, err := msg.MarshalTo(data[i:])
  445. if err != nil {
  446. return 0, err
  447. }
  448. i += n
  449. }
  450. }
  451. return i, nil
  452. }
  453. func (m *Folder) Marshal() (data []byte, err error) {
  454. size := m.ProtoSize()
  455. data = make([]byte, size)
  456. n, err := m.MarshalTo(data)
  457. if err != nil {
  458. return nil, err
  459. }
  460. return data[:n], nil
  461. }
  462. func (m *Folder) MarshalTo(data []byte) (int, error) {
  463. var i int
  464. _ = i
  465. var l int
  466. _ = l
  467. if len(m.ID) > 0 {
  468. data[i] = 0xa
  469. i++
  470. i = encodeVarintBep(data, i, uint64(len(m.ID)))
  471. i += copy(data[i:], m.ID)
  472. }
  473. if len(m.Label) > 0 {
  474. data[i] = 0x12
  475. i++
  476. i = encodeVarintBep(data, i, uint64(len(m.Label)))
  477. i += copy(data[i:], m.Label)
  478. }
  479. if m.ReadOnly {
  480. data[i] = 0x18
  481. i++
  482. if m.ReadOnly {
  483. data[i] = 1
  484. } else {
  485. data[i] = 0
  486. }
  487. i++
  488. }
  489. if m.IgnorePermissions {
  490. data[i] = 0x20
  491. i++
  492. if m.IgnorePermissions {
  493. data[i] = 1
  494. } else {
  495. data[i] = 0
  496. }
  497. i++
  498. }
  499. if m.IgnoreDelete {
  500. data[i] = 0x28
  501. i++
  502. if m.IgnoreDelete {
  503. data[i] = 1
  504. } else {
  505. data[i] = 0
  506. }
  507. i++
  508. }
  509. if m.DisableTempIndexes {
  510. data[i] = 0x30
  511. i++
  512. if m.DisableTempIndexes {
  513. data[i] = 1
  514. } else {
  515. data[i] = 0
  516. }
  517. i++
  518. }
  519. if len(m.Devices) > 0 {
  520. for _, msg := range m.Devices {
  521. data[i] = 0x82
  522. i++
  523. data[i] = 0x1
  524. i++
  525. i = encodeVarintBep(data, i, uint64(msg.ProtoSize()))
  526. n, err := msg.MarshalTo(data[i:])
  527. if err != nil {
  528. return 0, err
  529. }
  530. i += n
  531. }
  532. }
  533. return i, nil
  534. }
  535. func (m *Device) Marshal() (data []byte, err error) {
  536. size := m.ProtoSize()
  537. data = make([]byte, size)
  538. n, err := m.MarshalTo(data)
  539. if err != nil {
  540. return nil, err
  541. }
  542. return data[:n], nil
  543. }
  544. func (m *Device) MarshalTo(data []byte) (int, error) {
  545. var i int
  546. _ = i
  547. var l int
  548. _ = l
  549. if len(m.ID) > 0 {
  550. data[i] = 0xa
  551. i++
  552. i = encodeVarintBep(data, i, uint64(len(m.ID)))
  553. i += copy(data[i:], m.ID)
  554. }
  555. if len(m.Name) > 0 {
  556. data[i] = 0x12
  557. i++
  558. i = encodeVarintBep(data, i, uint64(len(m.Name)))
  559. i += copy(data[i:], m.Name)
  560. }
  561. if len(m.Addresses) > 0 {
  562. for _, s := range m.Addresses {
  563. data[i] = 0x1a
  564. i++
  565. l = len(s)
  566. for l >= 1<<7 {
  567. data[i] = uint8(uint64(l)&0x7f | 0x80)
  568. l >>= 7
  569. i++
  570. }
  571. data[i] = uint8(l)
  572. i++
  573. i += copy(data[i:], s)
  574. }
  575. }
  576. if m.Compression != 0 {
  577. data[i] = 0x20
  578. i++
  579. i = encodeVarintBep(data, i, uint64(m.Compression))
  580. }
  581. if len(m.CertName) > 0 {
  582. data[i] = 0x2a
  583. i++
  584. i = encodeVarintBep(data, i, uint64(len(m.CertName)))
  585. i += copy(data[i:], m.CertName)
  586. }
  587. if m.MaxSequence != 0 {
  588. data[i] = 0x30
  589. i++
  590. i = encodeVarintBep(data, i, uint64(m.MaxSequence))
  591. }
  592. if m.Introducer {
  593. data[i] = 0x38
  594. i++
  595. if m.Introducer {
  596. data[i] = 1
  597. } else {
  598. data[i] = 0
  599. }
  600. i++
  601. }
  602. if m.IndexID != 0 {
  603. data[i] = 0x40
  604. i++
  605. i = encodeVarintBep(data, i, uint64(m.IndexID))
  606. }
  607. return i, nil
  608. }
  609. func (m *Index) Marshal() (data []byte, err error) {
  610. size := m.ProtoSize()
  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 *Index) MarshalTo(data []byte) (int, error) {
  619. var i int
  620. _ = i
  621. var l int
  622. _ = l
  623. if len(m.Folder) > 0 {
  624. data[i] = 0xa
  625. i++
  626. i = encodeVarintBep(data, i, uint64(len(m.Folder)))
  627. i += copy(data[i:], m.Folder)
  628. }
  629. if len(m.Files) > 0 {
  630. for _, msg := range m.Files {
  631. data[i] = 0x12
  632. i++
  633. i = encodeVarintBep(data, i, uint64(msg.ProtoSize()))
  634. n, err := msg.MarshalTo(data[i:])
  635. if err != nil {
  636. return 0, err
  637. }
  638. i += n
  639. }
  640. }
  641. return i, nil
  642. }
  643. func (m *IndexUpdate) Marshal() (data []byte, err error) {
  644. size := m.ProtoSize()
  645. data = make([]byte, size)
  646. n, err := m.MarshalTo(data)
  647. if err != nil {
  648. return nil, err
  649. }
  650. return data[:n], nil
  651. }
  652. func (m *IndexUpdate) MarshalTo(data []byte) (int, error) {
  653. var i int
  654. _ = i
  655. var l int
  656. _ = l
  657. if len(m.Folder) > 0 {
  658. data[i] = 0xa
  659. i++
  660. i = encodeVarintBep(data, i, uint64(len(m.Folder)))
  661. i += copy(data[i:], m.Folder)
  662. }
  663. if len(m.Files) > 0 {
  664. for _, msg := range m.Files {
  665. data[i] = 0x12
  666. i++
  667. i = encodeVarintBep(data, i, uint64(msg.ProtoSize()))
  668. n, err := msg.MarshalTo(data[i:])
  669. if err != nil {
  670. return 0, err
  671. }
  672. i += n
  673. }
  674. }
  675. return i, nil
  676. }
  677. func (m *FileInfo) Marshal() (data []byte, err error) {
  678. size := m.ProtoSize()
  679. data = make([]byte, size)
  680. n, err := m.MarshalTo(data)
  681. if err != nil {
  682. return nil, err
  683. }
  684. return data[:n], nil
  685. }
  686. func (m *FileInfo) MarshalTo(data []byte) (int, error) {
  687. var i int
  688. _ = i
  689. var l int
  690. _ = l
  691. if len(m.Name) > 0 {
  692. data[i] = 0xa
  693. i++
  694. i = encodeVarintBep(data, i, uint64(len(m.Name)))
  695. i += copy(data[i:], m.Name)
  696. }
  697. if m.Type != 0 {
  698. data[i] = 0x10
  699. i++
  700. i = encodeVarintBep(data, i, uint64(m.Type))
  701. }
  702. if m.Size != 0 {
  703. data[i] = 0x18
  704. i++
  705. i = encodeVarintBep(data, i, uint64(m.Size))
  706. }
  707. if m.Permissions != 0 {
  708. data[i] = 0x20
  709. i++
  710. i = encodeVarintBep(data, i, uint64(m.Permissions))
  711. }
  712. if m.ModifiedS != 0 {
  713. data[i] = 0x28
  714. i++
  715. i = encodeVarintBep(data, i, uint64(m.ModifiedS))
  716. }
  717. if m.Deleted {
  718. data[i] = 0x30
  719. i++
  720. if m.Deleted {
  721. data[i] = 1
  722. } else {
  723. data[i] = 0
  724. }
  725. i++
  726. }
  727. if m.Invalid {
  728. data[i] = 0x38
  729. i++
  730. if m.Invalid {
  731. data[i] = 1
  732. } else {
  733. data[i] = 0
  734. }
  735. i++
  736. }
  737. if m.NoPermissions {
  738. data[i] = 0x40
  739. i++
  740. if m.NoPermissions {
  741. data[i] = 1
  742. } else {
  743. data[i] = 0
  744. }
  745. i++
  746. }
  747. data[i] = 0x4a
  748. i++
  749. i = encodeVarintBep(data, i, uint64(m.Version.ProtoSize()))
  750. n1, err := m.Version.MarshalTo(data[i:])
  751. if err != nil {
  752. return 0, err
  753. }
  754. i += n1
  755. if m.Sequence != 0 {
  756. data[i] = 0x50
  757. i++
  758. i = encodeVarintBep(data, i, uint64(m.Sequence))
  759. }
  760. if m.ModifiedNs != 0 {
  761. data[i] = 0x58
  762. i++
  763. i = encodeVarintBep(data, i, uint64(m.ModifiedNs))
  764. }
  765. if len(m.Blocks) > 0 {
  766. for _, msg := range m.Blocks {
  767. data[i] = 0x82
  768. i++
  769. data[i] = 0x1
  770. i++
  771. i = encodeVarintBep(data, i, uint64(msg.ProtoSize()))
  772. n, err := msg.MarshalTo(data[i:])
  773. if err != nil {
  774. return 0, err
  775. }
  776. i += n
  777. }
  778. }
  779. return i, nil
  780. }
  781. func (m *BlockInfo) Marshal() (data []byte, err error) {
  782. size := m.ProtoSize()
  783. data = make([]byte, size)
  784. n, err := m.MarshalTo(data)
  785. if err != nil {
  786. return nil, err
  787. }
  788. return data[:n], nil
  789. }
  790. func (m *BlockInfo) MarshalTo(data []byte) (int, error) {
  791. var i int
  792. _ = i
  793. var l int
  794. _ = l
  795. if m.Offset != 0 {
  796. data[i] = 0x8
  797. i++
  798. i = encodeVarintBep(data, i, uint64(m.Offset))
  799. }
  800. if m.Size != 0 {
  801. data[i] = 0x10
  802. i++
  803. i = encodeVarintBep(data, i, uint64(m.Size))
  804. }
  805. if len(m.Hash) > 0 {
  806. data[i] = 0x1a
  807. i++
  808. i = encodeVarintBep(data, i, uint64(len(m.Hash)))
  809. i += copy(data[i:], m.Hash)
  810. }
  811. return i, nil
  812. }
  813. func (m *Vector) Marshal() (data []byte, err error) {
  814. size := m.ProtoSize()
  815. data = make([]byte, size)
  816. n, err := m.MarshalTo(data)
  817. if err != nil {
  818. return nil, err
  819. }
  820. return data[:n], nil
  821. }
  822. func (m *Vector) MarshalTo(data []byte) (int, error) {
  823. var i int
  824. _ = i
  825. var l int
  826. _ = l
  827. if len(m.Counters) > 0 {
  828. for _, msg := range m.Counters {
  829. data[i] = 0xa
  830. i++
  831. i = encodeVarintBep(data, i, uint64(msg.ProtoSize()))
  832. n, err := msg.MarshalTo(data[i:])
  833. if err != nil {
  834. return 0, err
  835. }
  836. i += n
  837. }
  838. }
  839. return i, nil
  840. }
  841. func (m *Counter) Marshal() (data []byte, err error) {
  842. size := m.ProtoSize()
  843. data = make([]byte, size)
  844. n, err := m.MarshalTo(data)
  845. if err != nil {
  846. return nil, err
  847. }
  848. return data[:n], nil
  849. }
  850. func (m *Counter) MarshalTo(data []byte) (int, error) {
  851. var i int
  852. _ = i
  853. var l int
  854. _ = l
  855. if m.ID != 0 {
  856. data[i] = 0x8
  857. i++
  858. i = encodeVarintBep(data, i, uint64(m.ID))
  859. }
  860. if m.Value != 0 {
  861. data[i] = 0x10
  862. i++
  863. i = encodeVarintBep(data, i, uint64(m.Value))
  864. }
  865. return i, nil
  866. }
  867. func (m *Request) Marshal() (data []byte, err error) {
  868. size := m.ProtoSize()
  869. data = make([]byte, size)
  870. n, err := m.MarshalTo(data)
  871. if err != nil {
  872. return nil, err
  873. }
  874. return data[:n], nil
  875. }
  876. func (m *Request) MarshalTo(data []byte) (int, error) {
  877. var i int
  878. _ = i
  879. var l int
  880. _ = l
  881. if m.ID != 0 {
  882. data[i] = 0x8
  883. i++
  884. i = encodeVarintBep(data, i, uint64(m.ID))
  885. }
  886. if len(m.Folder) > 0 {
  887. data[i] = 0x12
  888. i++
  889. i = encodeVarintBep(data, i, uint64(len(m.Folder)))
  890. i += copy(data[i:], m.Folder)
  891. }
  892. if len(m.Name) > 0 {
  893. data[i] = 0x1a
  894. i++
  895. i = encodeVarintBep(data, i, uint64(len(m.Name)))
  896. i += copy(data[i:], m.Name)
  897. }
  898. if m.Offset != 0 {
  899. data[i] = 0x20
  900. i++
  901. i = encodeVarintBep(data, i, uint64(m.Offset))
  902. }
  903. if m.Size != 0 {
  904. data[i] = 0x28
  905. i++
  906. i = encodeVarintBep(data, i, uint64(m.Size))
  907. }
  908. if len(m.Hash) > 0 {
  909. data[i] = 0x32
  910. i++
  911. i = encodeVarintBep(data, i, uint64(len(m.Hash)))
  912. i += copy(data[i:], m.Hash)
  913. }
  914. if m.FromTemporary {
  915. data[i] = 0x38
  916. i++
  917. if m.FromTemporary {
  918. data[i] = 1
  919. } else {
  920. data[i] = 0
  921. }
  922. i++
  923. }
  924. return i, nil
  925. }
  926. func (m *Response) Marshal() (data []byte, err error) {
  927. size := m.ProtoSize()
  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 *Response) MarshalTo(data []byte) (int, error) {
  936. var i int
  937. _ = i
  938. var l int
  939. _ = l
  940. if m.ID != 0 {
  941. data[i] = 0x8
  942. i++
  943. i = encodeVarintBep(data, i, uint64(m.ID))
  944. }
  945. if len(m.Data) > 0 {
  946. data[i] = 0x12
  947. i++
  948. i = encodeVarintBep(data, i, uint64(len(m.Data)))
  949. i += copy(data[i:], m.Data)
  950. }
  951. if m.Code != 0 {
  952. data[i] = 0x18
  953. i++
  954. i = encodeVarintBep(data, i, uint64(m.Code))
  955. }
  956. return i, nil
  957. }
  958. func (m *DownloadProgress) Marshal() (data []byte, err error) {
  959. size := m.ProtoSize()
  960. data = make([]byte, size)
  961. n, err := m.MarshalTo(data)
  962. if err != nil {
  963. return nil, err
  964. }
  965. return data[:n], nil
  966. }
  967. func (m *DownloadProgress) MarshalTo(data []byte) (int, error) {
  968. var i int
  969. _ = i
  970. var l int
  971. _ = l
  972. if len(m.Folder) > 0 {
  973. data[i] = 0xa
  974. i++
  975. i = encodeVarintBep(data, i, uint64(len(m.Folder)))
  976. i += copy(data[i:], m.Folder)
  977. }
  978. if len(m.Updates) > 0 {
  979. for _, msg := range m.Updates {
  980. data[i] = 0x12
  981. i++
  982. i = encodeVarintBep(data, i, uint64(msg.ProtoSize()))
  983. n, err := msg.MarshalTo(data[i:])
  984. if err != nil {
  985. return 0, err
  986. }
  987. i += n
  988. }
  989. }
  990. return i, nil
  991. }
  992. func (m *FileDownloadProgressUpdate) Marshal() (data []byte, err error) {
  993. size := m.ProtoSize()
  994. data = make([]byte, size)
  995. n, err := m.MarshalTo(data)
  996. if err != nil {
  997. return nil, err
  998. }
  999. return data[:n], nil
  1000. }
  1001. func (m *FileDownloadProgressUpdate) MarshalTo(data []byte) (int, error) {
  1002. var i int
  1003. _ = i
  1004. var l int
  1005. _ = l
  1006. if m.UpdateType != 0 {
  1007. data[i] = 0x8
  1008. i++
  1009. i = encodeVarintBep(data, i, uint64(m.UpdateType))
  1010. }
  1011. if len(m.Name) > 0 {
  1012. data[i] = 0x12
  1013. i++
  1014. i = encodeVarintBep(data, i, uint64(len(m.Name)))
  1015. i += copy(data[i:], m.Name)
  1016. }
  1017. data[i] = 0x1a
  1018. i++
  1019. i = encodeVarintBep(data, i, uint64(m.Version.ProtoSize()))
  1020. n2, err := m.Version.MarshalTo(data[i:])
  1021. if err != nil {
  1022. return 0, err
  1023. }
  1024. i += n2
  1025. if len(m.BlockIndexes) > 0 {
  1026. for _, num := range m.BlockIndexes {
  1027. data[i] = 0x20
  1028. i++
  1029. i = encodeVarintBep(data, i, uint64(num))
  1030. }
  1031. }
  1032. return i, nil
  1033. }
  1034. func (m *Ping) Marshal() (data []byte, err error) {
  1035. size := m.ProtoSize()
  1036. data = make([]byte, size)
  1037. n, err := m.MarshalTo(data)
  1038. if err != nil {
  1039. return nil, err
  1040. }
  1041. return data[:n], nil
  1042. }
  1043. func (m *Ping) MarshalTo(data []byte) (int, error) {
  1044. var i int
  1045. _ = i
  1046. var l int
  1047. _ = l
  1048. return i, nil
  1049. }
  1050. func (m *Close) Marshal() (data []byte, err error) {
  1051. size := m.ProtoSize()
  1052. data = make([]byte, size)
  1053. n, err := m.MarshalTo(data)
  1054. if err != nil {
  1055. return nil, err
  1056. }
  1057. return data[:n], nil
  1058. }
  1059. func (m *Close) MarshalTo(data []byte) (int, error) {
  1060. var i int
  1061. _ = i
  1062. var l int
  1063. _ = l
  1064. if len(m.Reason) > 0 {
  1065. data[i] = 0xa
  1066. i++
  1067. i = encodeVarintBep(data, i, uint64(len(m.Reason)))
  1068. i += copy(data[i:], m.Reason)
  1069. }
  1070. return i, nil
  1071. }
  1072. func encodeFixed64Bep(data []byte, offset int, v uint64) int {
  1073. data[offset] = uint8(v)
  1074. data[offset+1] = uint8(v >> 8)
  1075. data[offset+2] = uint8(v >> 16)
  1076. data[offset+3] = uint8(v >> 24)
  1077. data[offset+4] = uint8(v >> 32)
  1078. data[offset+5] = uint8(v >> 40)
  1079. data[offset+6] = uint8(v >> 48)
  1080. data[offset+7] = uint8(v >> 56)
  1081. return offset + 8
  1082. }
  1083. func encodeFixed32Bep(data []byte, offset int, v uint32) int {
  1084. data[offset] = uint8(v)
  1085. data[offset+1] = uint8(v >> 8)
  1086. data[offset+2] = uint8(v >> 16)
  1087. data[offset+3] = uint8(v >> 24)
  1088. return offset + 4
  1089. }
  1090. func encodeVarintBep(data []byte, offset int, v uint64) int {
  1091. for v >= 1<<7 {
  1092. data[offset] = uint8(v&0x7f | 0x80)
  1093. v >>= 7
  1094. offset++
  1095. }
  1096. data[offset] = uint8(v)
  1097. return offset + 1
  1098. }
  1099. func (m *Hello) ProtoSize() (n int) {
  1100. var l int
  1101. _ = l
  1102. l = len(m.DeviceName)
  1103. if l > 0 {
  1104. n += 1 + l + sovBep(uint64(l))
  1105. }
  1106. l = len(m.ClientName)
  1107. if l > 0 {
  1108. n += 1 + l + sovBep(uint64(l))
  1109. }
  1110. l = len(m.ClientVersion)
  1111. if l > 0 {
  1112. n += 1 + l + sovBep(uint64(l))
  1113. }
  1114. return n
  1115. }
  1116. func (m *Header) ProtoSize() (n int) {
  1117. var l int
  1118. _ = l
  1119. if m.Type != 0 {
  1120. n += 1 + sovBep(uint64(m.Type))
  1121. }
  1122. if m.Compression != 0 {
  1123. n += 1 + sovBep(uint64(m.Compression))
  1124. }
  1125. return n
  1126. }
  1127. func (m *ClusterConfig) ProtoSize() (n int) {
  1128. var l int
  1129. _ = l
  1130. if len(m.Folders) > 0 {
  1131. for _, e := range m.Folders {
  1132. l = e.ProtoSize()
  1133. n += 1 + l + sovBep(uint64(l))
  1134. }
  1135. }
  1136. return n
  1137. }
  1138. func (m *Folder) ProtoSize() (n int) {
  1139. var l int
  1140. _ = l
  1141. l = len(m.ID)
  1142. if l > 0 {
  1143. n += 1 + l + sovBep(uint64(l))
  1144. }
  1145. l = len(m.Label)
  1146. if l > 0 {
  1147. n += 1 + l + sovBep(uint64(l))
  1148. }
  1149. if m.ReadOnly {
  1150. n += 2
  1151. }
  1152. if m.IgnorePermissions {
  1153. n += 2
  1154. }
  1155. if m.IgnoreDelete {
  1156. n += 2
  1157. }
  1158. if m.DisableTempIndexes {
  1159. n += 2
  1160. }
  1161. if len(m.Devices) > 0 {
  1162. for _, e := range m.Devices {
  1163. l = e.ProtoSize()
  1164. n += 2 + l + sovBep(uint64(l))
  1165. }
  1166. }
  1167. return n
  1168. }
  1169. func (m *Device) ProtoSize() (n int) {
  1170. var l int
  1171. _ = l
  1172. l = len(m.ID)
  1173. if l > 0 {
  1174. n += 1 + l + sovBep(uint64(l))
  1175. }
  1176. l = len(m.Name)
  1177. if l > 0 {
  1178. n += 1 + l + sovBep(uint64(l))
  1179. }
  1180. if len(m.Addresses) > 0 {
  1181. for _, s := range m.Addresses {
  1182. l = len(s)
  1183. n += 1 + l + sovBep(uint64(l))
  1184. }
  1185. }
  1186. if m.Compression != 0 {
  1187. n += 1 + sovBep(uint64(m.Compression))
  1188. }
  1189. l = len(m.CertName)
  1190. if l > 0 {
  1191. n += 1 + l + sovBep(uint64(l))
  1192. }
  1193. if m.MaxSequence != 0 {
  1194. n += 1 + sovBep(uint64(m.MaxSequence))
  1195. }
  1196. if m.Introducer {
  1197. n += 2
  1198. }
  1199. if m.IndexID != 0 {
  1200. n += 1 + sovBep(uint64(m.IndexID))
  1201. }
  1202. return n
  1203. }
  1204. func (m *Index) ProtoSize() (n int) {
  1205. var l int
  1206. _ = l
  1207. l = len(m.Folder)
  1208. if l > 0 {
  1209. n += 1 + l + sovBep(uint64(l))
  1210. }
  1211. if len(m.Files) > 0 {
  1212. for _, e := range m.Files {
  1213. l = e.ProtoSize()
  1214. n += 1 + l + sovBep(uint64(l))
  1215. }
  1216. }
  1217. return n
  1218. }
  1219. func (m *IndexUpdate) ProtoSize() (n int) {
  1220. var l int
  1221. _ = l
  1222. l = len(m.Folder)
  1223. if l > 0 {
  1224. n += 1 + l + sovBep(uint64(l))
  1225. }
  1226. if len(m.Files) > 0 {
  1227. for _, e := range m.Files {
  1228. l = e.ProtoSize()
  1229. n += 1 + l + sovBep(uint64(l))
  1230. }
  1231. }
  1232. return n
  1233. }
  1234. func (m *FileInfo) ProtoSize() (n int) {
  1235. var l int
  1236. _ = l
  1237. l = len(m.Name)
  1238. if l > 0 {
  1239. n += 1 + l + sovBep(uint64(l))
  1240. }
  1241. if m.Type != 0 {
  1242. n += 1 + sovBep(uint64(m.Type))
  1243. }
  1244. if m.Size != 0 {
  1245. n += 1 + sovBep(uint64(m.Size))
  1246. }
  1247. if m.Permissions != 0 {
  1248. n += 1 + sovBep(uint64(m.Permissions))
  1249. }
  1250. if m.ModifiedS != 0 {
  1251. n += 1 + sovBep(uint64(m.ModifiedS))
  1252. }
  1253. if m.Deleted {
  1254. n += 2
  1255. }
  1256. if m.Invalid {
  1257. n += 2
  1258. }
  1259. if m.NoPermissions {
  1260. n += 2
  1261. }
  1262. l = m.Version.ProtoSize()
  1263. n += 1 + l + sovBep(uint64(l))
  1264. if m.Sequence != 0 {
  1265. n += 1 + sovBep(uint64(m.Sequence))
  1266. }
  1267. if m.ModifiedNs != 0 {
  1268. n += 1 + sovBep(uint64(m.ModifiedNs))
  1269. }
  1270. if len(m.Blocks) > 0 {
  1271. for _, e := range m.Blocks {
  1272. l = e.ProtoSize()
  1273. n += 2 + l + sovBep(uint64(l))
  1274. }
  1275. }
  1276. return n
  1277. }
  1278. func (m *BlockInfo) ProtoSize() (n int) {
  1279. var l int
  1280. _ = l
  1281. if m.Offset != 0 {
  1282. n += 1 + sovBep(uint64(m.Offset))
  1283. }
  1284. if m.Size != 0 {
  1285. n += 1 + sovBep(uint64(m.Size))
  1286. }
  1287. l = len(m.Hash)
  1288. if l > 0 {
  1289. n += 1 + l + sovBep(uint64(l))
  1290. }
  1291. return n
  1292. }
  1293. func (m *Vector) ProtoSize() (n int) {
  1294. var l int
  1295. _ = l
  1296. if len(m.Counters) > 0 {
  1297. for _, e := range m.Counters {
  1298. l = e.ProtoSize()
  1299. n += 1 + l + sovBep(uint64(l))
  1300. }
  1301. }
  1302. return n
  1303. }
  1304. func (m *Counter) ProtoSize() (n int) {
  1305. var l int
  1306. _ = l
  1307. if m.ID != 0 {
  1308. n += 1 + sovBep(uint64(m.ID))
  1309. }
  1310. if m.Value != 0 {
  1311. n += 1 + sovBep(uint64(m.Value))
  1312. }
  1313. return n
  1314. }
  1315. func (m *Request) ProtoSize() (n int) {
  1316. var l int
  1317. _ = l
  1318. if m.ID != 0 {
  1319. n += 1 + sovBep(uint64(m.ID))
  1320. }
  1321. l = len(m.Folder)
  1322. if l > 0 {
  1323. n += 1 + l + sovBep(uint64(l))
  1324. }
  1325. l = len(m.Name)
  1326. if l > 0 {
  1327. n += 1 + l + sovBep(uint64(l))
  1328. }
  1329. if m.Offset != 0 {
  1330. n += 1 + sovBep(uint64(m.Offset))
  1331. }
  1332. if m.Size != 0 {
  1333. n += 1 + sovBep(uint64(m.Size))
  1334. }
  1335. l = len(m.Hash)
  1336. if l > 0 {
  1337. n += 1 + l + sovBep(uint64(l))
  1338. }
  1339. if m.FromTemporary {
  1340. n += 2
  1341. }
  1342. return n
  1343. }
  1344. func (m *Response) ProtoSize() (n int) {
  1345. var l int
  1346. _ = l
  1347. if m.ID != 0 {
  1348. n += 1 + sovBep(uint64(m.ID))
  1349. }
  1350. l = len(m.Data)
  1351. if l > 0 {
  1352. n += 1 + l + sovBep(uint64(l))
  1353. }
  1354. if m.Code != 0 {
  1355. n += 1 + sovBep(uint64(m.Code))
  1356. }
  1357. return n
  1358. }
  1359. func (m *DownloadProgress) ProtoSize() (n int) {
  1360. var l int
  1361. _ = l
  1362. l = len(m.Folder)
  1363. if l > 0 {
  1364. n += 1 + l + sovBep(uint64(l))
  1365. }
  1366. if len(m.Updates) > 0 {
  1367. for _, e := range m.Updates {
  1368. l = e.ProtoSize()
  1369. n += 1 + l + sovBep(uint64(l))
  1370. }
  1371. }
  1372. return n
  1373. }
  1374. func (m *FileDownloadProgressUpdate) ProtoSize() (n int) {
  1375. var l int
  1376. _ = l
  1377. if m.UpdateType != 0 {
  1378. n += 1 + sovBep(uint64(m.UpdateType))
  1379. }
  1380. l = len(m.Name)
  1381. if l > 0 {
  1382. n += 1 + l + sovBep(uint64(l))
  1383. }
  1384. l = m.Version.ProtoSize()
  1385. n += 1 + l + sovBep(uint64(l))
  1386. if len(m.BlockIndexes) > 0 {
  1387. for _, e := range m.BlockIndexes {
  1388. n += 1 + sovBep(uint64(e))
  1389. }
  1390. }
  1391. return n
  1392. }
  1393. func (m *Ping) ProtoSize() (n int) {
  1394. var l int
  1395. _ = l
  1396. return n
  1397. }
  1398. func (m *Close) ProtoSize() (n int) {
  1399. var l int
  1400. _ = l
  1401. l = len(m.Reason)
  1402. if l > 0 {
  1403. n += 1 + l + sovBep(uint64(l))
  1404. }
  1405. return n
  1406. }
  1407. func sovBep(x uint64) (n int) {
  1408. for {
  1409. n++
  1410. x >>= 7
  1411. if x == 0 {
  1412. break
  1413. }
  1414. }
  1415. return n
  1416. }
  1417. func sozBep(x uint64) (n int) {
  1418. return sovBep(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1419. }
  1420. func (m *Hello) Unmarshal(data []byte) error {
  1421. l := len(data)
  1422. iNdEx := 0
  1423. for iNdEx < l {
  1424. preIndex := iNdEx
  1425. var wire uint64
  1426. for shift := uint(0); ; shift += 7 {
  1427. if shift >= 64 {
  1428. return ErrIntOverflowBep
  1429. }
  1430. if iNdEx >= l {
  1431. return io.ErrUnexpectedEOF
  1432. }
  1433. b := data[iNdEx]
  1434. iNdEx++
  1435. wire |= (uint64(b) & 0x7F) << shift
  1436. if b < 0x80 {
  1437. break
  1438. }
  1439. }
  1440. fieldNum := int32(wire >> 3)
  1441. wireType := int(wire & 0x7)
  1442. if wireType == 4 {
  1443. return fmt.Errorf("proto: Hello: wiretype end group for non-group")
  1444. }
  1445. if fieldNum <= 0 {
  1446. return fmt.Errorf("proto: Hello: illegal tag %d (wire type %d)", fieldNum, wire)
  1447. }
  1448. switch fieldNum {
  1449. case 1:
  1450. if wireType != 2 {
  1451. return fmt.Errorf("proto: wrong wireType = %d for field DeviceName", wireType)
  1452. }
  1453. var stringLen uint64
  1454. for shift := uint(0); ; shift += 7 {
  1455. if shift >= 64 {
  1456. return ErrIntOverflowBep
  1457. }
  1458. if iNdEx >= l {
  1459. return io.ErrUnexpectedEOF
  1460. }
  1461. b := data[iNdEx]
  1462. iNdEx++
  1463. stringLen |= (uint64(b) & 0x7F) << shift
  1464. if b < 0x80 {
  1465. break
  1466. }
  1467. }
  1468. intStringLen := int(stringLen)
  1469. if intStringLen < 0 {
  1470. return ErrInvalidLengthBep
  1471. }
  1472. postIndex := iNdEx + intStringLen
  1473. if postIndex > l {
  1474. return io.ErrUnexpectedEOF
  1475. }
  1476. m.DeviceName = string(data[iNdEx:postIndex])
  1477. iNdEx = postIndex
  1478. case 2:
  1479. if wireType != 2 {
  1480. return fmt.Errorf("proto: wrong wireType = %d for field ClientName", wireType)
  1481. }
  1482. var stringLen uint64
  1483. for shift := uint(0); ; shift += 7 {
  1484. if shift >= 64 {
  1485. return ErrIntOverflowBep
  1486. }
  1487. if iNdEx >= l {
  1488. return io.ErrUnexpectedEOF
  1489. }
  1490. b := data[iNdEx]
  1491. iNdEx++
  1492. stringLen |= (uint64(b) & 0x7F) << shift
  1493. if b < 0x80 {
  1494. break
  1495. }
  1496. }
  1497. intStringLen := int(stringLen)
  1498. if intStringLen < 0 {
  1499. return ErrInvalidLengthBep
  1500. }
  1501. postIndex := iNdEx + intStringLen
  1502. if postIndex > l {
  1503. return io.ErrUnexpectedEOF
  1504. }
  1505. m.ClientName = string(data[iNdEx:postIndex])
  1506. iNdEx = postIndex
  1507. case 3:
  1508. if wireType != 2 {
  1509. return fmt.Errorf("proto: wrong wireType = %d for field ClientVersion", wireType)
  1510. }
  1511. var stringLen uint64
  1512. for shift := uint(0); ; shift += 7 {
  1513. if shift >= 64 {
  1514. return ErrIntOverflowBep
  1515. }
  1516. if iNdEx >= l {
  1517. return io.ErrUnexpectedEOF
  1518. }
  1519. b := data[iNdEx]
  1520. iNdEx++
  1521. stringLen |= (uint64(b) & 0x7F) << shift
  1522. if b < 0x80 {
  1523. break
  1524. }
  1525. }
  1526. intStringLen := int(stringLen)
  1527. if intStringLen < 0 {
  1528. return ErrInvalidLengthBep
  1529. }
  1530. postIndex := iNdEx + intStringLen
  1531. if postIndex > l {
  1532. return io.ErrUnexpectedEOF
  1533. }
  1534. m.ClientVersion = string(data[iNdEx:postIndex])
  1535. iNdEx = postIndex
  1536. default:
  1537. iNdEx = preIndex
  1538. skippy, err := skipBep(data[iNdEx:])
  1539. if err != nil {
  1540. return err
  1541. }
  1542. if skippy < 0 {
  1543. return ErrInvalidLengthBep
  1544. }
  1545. if (iNdEx + skippy) > l {
  1546. return io.ErrUnexpectedEOF
  1547. }
  1548. iNdEx += skippy
  1549. }
  1550. }
  1551. if iNdEx > l {
  1552. return io.ErrUnexpectedEOF
  1553. }
  1554. return nil
  1555. }
  1556. func (m *Header) Unmarshal(data []byte) error {
  1557. l := len(data)
  1558. iNdEx := 0
  1559. for iNdEx < l {
  1560. preIndex := iNdEx
  1561. var wire uint64
  1562. for shift := uint(0); ; shift += 7 {
  1563. if shift >= 64 {
  1564. return ErrIntOverflowBep
  1565. }
  1566. if iNdEx >= l {
  1567. return io.ErrUnexpectedEOF
  1568. }
  1569. b := data[iNdEx]
  1570. iNdEx++
  1571. wire |= (uint64(b) & 0x7F) << shift
  1572. if b < 0x80 {
  1573. break
  1574. }
  1575. }
  1576. fieldNum := int32(wire >> 3)
  1577. wireType := int(wire & 0x7)
  1578. if wireType == 4 {
  1579. return fmt.Errorf("proto: Header: wiretype end group for non-group")
  1580. }
  1581. if fieldNum <= 0 {
  1582. return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire)
  1583. }
  1584. switch fieldNum {
  1585. case 1:
  1586. if wireType != 0 {
  1587. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1588. }
  1589. m.Type = 0
  1590. for shift := uint(0); ; shift += 7 {
  1591. if shift >= 64 {
  1592. return ErrIntOverflowBep
  1593. }
  1594. if iNdEx >= l {
  1595. return io.ErrUnexpectedEOF
  1596. }
  1597. b := data[iNdEx]
  1598. iNdEx++
  1599. m.Type |= (MessageType(b) & 0x7F) << shift
  1600. if b < 0x80 {
  1601. break
  1602. }
  1603. }
  1604. case 2:
  1605. if wireType != 0 {
  1606. return fmt.Errorf("proto: wrong wireType = %d for field Compression", wireType)
  1607. }
  1608. m.Compression = 0
  1609. for shift := uint(0); ; shift += 7 {
  1610. if shift >= 64 {
  1611. return ErrIntOverflowBep
  1612. }
  1613. if iNdEx >= l {
  1614. return io.ErrUnexpectedEOF
  1615. }
  1616. b := data[iNdEx]
  1617. iNdEx++
  1618. m.Compression |= (MessageCompression(b) & 0x7F) << shift
  1619. if b < 0x80 {
  1620. break
  1621. }
  1622. }
  1623. default:
  1624. iNdEx = preIndex
  1625. skippy, err := skipBep(data[iNdEx:])
  1626. if err != nil {
  1627. return err
  1628. }
  1629. if skippy < 0 {
  1630. return ErrInvalidLengthBep
  1631. }
  1632. if (iNdEx + skippy) > l {
  1633. return io.ErrUnexpectedEOF
  1634. }
  1635. iNdEx += skippy
  1636. }
  1637. }
  1638. if iNdEx > l {
  1639. return io.ErrUnexpectedEOF
  1640. }
  1641. return nil
  1642. }
  1643. func (m *ClusterConfig) Unmarshal(data []byte) error {
  1644. l := len(data)
  1645. iNdEx := 0
  1646. for iNdEx < l {
  1647. preIndex := iNdEx
  1648. var wire uint64
  1649. for shift := uint(0); ; shift += 7 {
  1650. if shift >= 64 {
  1651. return ErrIntOverflowBep
  1652. }
  1653. if iNdEx >= l {
  1654. return io.ErrUnexpectedEOF
  1655. }
  1656. b := data[iNdEx]
  1657. iNdEx++
  1658. wire |= (uint64(b) & 0x7F) << shift
  1659. if b < 0x80 {
  1660. break
  1661. }
  1662. }
  1663. fieldNum := int32(wire >> 3)
  1664. wireType := int(wire & 0x7)
  1665. if wireType == 4 {
  1666. return fmt.Errorf("proto: ClusterConfig: wiretype end group for non-group")
  1667. }
  1668. if fieldNum <= 0 {
  1669. return fmt.Errorf("proto: ClusterConfig: illegal tag %d (wire type %d)", fieldNum, wire)
  1670. }
  1671. switch fieldNum {
  1672. case 1:
  1673. if wireType != 2 {
  1674. return fmt.Errorf("proto: wrong wireType = %d for field Folders", wireType)
  1675. }
  1676. var msglen int
  1677. for shift := uint(0); ; shift += 7 {
  1678. if shift >= 64 {
  1679. return ErrIntOverflowBep
  1680. }
  1681. if iNdEx >= l {
  1682. return io.ErrUnexpectedEOF
  1683. }
  1684. b := data[iNdEx]
  1685. iNdEx++
  1686. msglen |= (int(b) & 0x7F) << shift
  1687. if b < 0x80 {
  1688. break
  1689. }
  1690. }
  1691. if msglen < 0 {
  1692. return ErrInvalidLengthBep
  1693. }
  1694. postIndex := iNdEx + msglen
  1695. if postIndex > l {
  1696. return io.ErrUnexpectedEOF
  1697. }
  1698. m.Folders = append(m.Folders, Folder{})
  1699. if err := m.Folders[len(m.Folders)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  1700. return err
  1701. }
  1702. iNdEx = postIndex
  1703. default:
  1704. iNdEx = preIndex
  1705. skippy, err := skipBep(data[iNdEx:])
  1706. if err != nil {
  1707. return err
  1708. }
  1709. if skippy < 0 {
  1710. return ErrInvalidLengthBep
  1711. }
  1712. if (iNdEx + skippy) > l {
  1713. return io.ErrUnexpectedEOF
  1714. }
  1715. iNdEx += skippy
  1716. }
  1717. }
  1718. if iNdEx > l {
  1719. return io.ErrUnexpectedEOF
  1720. }
  1721. return nil
  1722. }
  1723. func (m *Folder) Unmarshal(data []byte) error {
  1724. l := len(data)
  1725. iNdEx := 0
  1726. for iNdEx < l {
  1727. preIndex := iNdEx
  1728. var wire uint64
  1729. for shift := uint(0); ; shift += 7 {
  1730. if shift >= 64 {
  1731. return ErrIntOverflowBep
  1732. }
  1733. if iNdEx >= l {
  1734. return io.ErrUnexpectedEOF
  1735. }
  1736. b := data[iNdEx]
  1737. iNdEx++
  1738. wire |= (uint64(b) & 0x7F) << shift
  1739. if b < 0x80 {
  1740. break
  1741. }
  1742. }
  1743. fieldNum := int32(wire >> 3)
  1744. wireType := int(wire & 0x7)
  1745. if wireType == 4 {
  1746. return fmt.Errorf("proto: Folder: wiretype end group for non-group")
  1747. }
  1748. if fieldNum <= 0 {
  1749. return fmt.Errorf("proto: Folder: illegal tag %d (wire type %d)", fieldNum, wire)
  1750. }
  1751. switch fieldNum {
  1752. case 1:
  1753. if wireType != 2 {
  1754. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  1755. }
  1756. var stringLen uint64
  1757. for shift := uint(0); ; shift += 7 {
  1758. if shift >= 64 {
  1759. return ErrIntOverflowBep
  1760. }
  1761. if iNdEx >= l {
  1762. return io.ErrUnexpectedEOF
  1763. }
  1764. b := data[iNdEx]
  1765. iNdEx++
  1766. stringLen |= (uint64(b) & 0x7F) << shift
  1767. if b < 0x80 {
  1768. break
  1769. }
  1770. }
  1771. intStringLen := int(stringLen)
  1772. if intStringLen < 0 {
  1773. return ErrInvalidLengthBep
  1774. }
  1775. postIndex := iNdEx + intStringLen
  1776. if postIndex > l {
  1777. return io.ErrUnexpectedEOF
  1778. }
  1779. m.ID = string(data[iNdEx:postIndex])
  1780. iNdEx = postIndex
  1781. case 2:
  1782. if wireType != 2 {
  1783. return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType)
  1784. }
  1785. var stringLen uint64
  1786. for shift := uint(0); ; shift += 7 {
  1787. if shift >= 64 {
  1788. return ErrIntOverflowBep
  1789. }
  1790. if iNdEx >= l {
  1791. return io.ErrUnexpectedEOF
  1792. }
  1793. b := data[iNdEx]
  1794. iNdEx++
  1795. stringLen |= (uint64(b) & 0x7F) << shift
  1796. if b < 0x80 {
  1797. break
  1798. }
  1799. }
  1800. intStringLen := int(stringLen)
  1801. if intStringLen < 0 {
  1802. return ErrInvalidLengthBep
  1803. }
  1804. postIndex := iNdEx + intStringLen
  1805. if postIndex > l {
  1806. return io.ErrUnexpectedEOF
  1807. }
  1808. m.Label = string(data[iNdEx:postIndex])
  1809. iNdEx = postIndex
  1810. case 3:
  1811. if wireType != 0 {
  1812. return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType)
  1813. }
  1814. var v int
  1815. for shift := uint(0); ; shift += 7 {
  1816. if shift >= 64 {
  1817. return ErrIntOverflowBep
  1818. }
  1819. if iNdEx >= l {
  1820. return io.ErrUnexpectedEOF
  1821. }
  1822. b := data[iNdEx]
  1823. iNdEx++
  1824. v |= (int(b) & 0x7F) << shift
  1825. if b < 0x80 {
  1826. break
  1827. }
  1828. }
  1829. m.ReadOnly = bool(v != 0)
  1830. case 4:
  1831. if wireType != 0 {
  1832. return fmt.Errorf("proto: wrong wireType = %d for field IgnorePermissions", wireType)
  1833. }
  1834. var v int
  1835. for shift := uint(0); ; shift += 7 {
  1836. if shift >= 64 {
  1837. return ErrIntOverflowBep
  1838. }
  1839. if iNdEx >= l {
  1840. return io.ErrUnexpectedEOF
  1841. }
  1842. b := data[iNdEx]
  1843. iNdEx++
  1844. v |= (int(b) & 0x7F) << shift
  1845. if b < 0x80 {
  1846. break
  1847. }
  1848. }
  1849. m.IgnorePermissions = bool(v != 0)
  1850. case 5:
  1851. if wireType != 0 {
  1852. return fmt.Errorf("proto: wrong wireType = %d for field IgnoreDelete", wireType)
  1853. }
  1854. var v int
  1855. for shift := uint(0); ; shift += 7 {
  1856. if shift >= 64 {
  1857. return ErrIntOverflowBep
  1858. }
  1859. if iNdEx >= l {
  1860. return io.ErrUnexpectedEOF
  1861. }
  1862. b := data[iNdEx]
  1863. iNdEx++
  1864. v |= (int(b) & 0x7F) << shift
  1865. if b < 0x80 {
  1866. break
  1867. }
  1868. }
  1869. m.IgnoreDelete = bool(v != 0)
  1870. case 6:
  1871. if wireType != 0 {
  1872. return fmt.Errorf("proto: wrong wireType = %d for field DisableTempIndexes", wireType)
  1873. }
  1874. var v int
  1875. for shift := uint(0); ; shift += 7 {
  1876. if shift >= 64 {
  1877. return ErrIntOverflowBep
  1878. }
  1879. if iNdEx >= l {
  1880. return io.ErrUnexpectedEOF
  1881. }
  1882. b := data[iNdEx]
  1883. iNdEx++
  1884. v |= (int(b) & 0x7F) << shift
  1885. if b < 0x80 {
  1886. break
  1887. }
  1888. }
  1889. m.DisableTempIndexes = bool(v != 0)
  1890. case 16:
  1891. if wireType != 2 {
  1892. return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType)
  1893. }
  1894. var msglen int
  1895. for shift := uint(0); ; shift += 7 {
  1896. if shift >= 64 {
  1897. return ErrIntOverflowBep
  1898. }
  1899. if iNdEx >= l {
  1900. return io.ErrUnexpectedEOF
  1901. }
  1902. b := data[iNdEx]
  1903. iNdEx++
  1904. msglen |= (int(b) & 0x7F) << shift
  1905. if b < 0x80 {
  1906. break
  1907. }
  1908. }
  1909. if msglen < 0 {
  1910. return ErrInvalidLengthBep
  1911. }
  1912. postIndex := iNdEx + msglen
  1913. if postIndex > l {
  1914. return io.ErrUnexpectedEOF
  1915. }
  1916. m.Devices = append(m.Devices, Device{})
  1917. if err := m.Devices[len(m.Devices)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  1918. return err
  1919. }
  1920. iNdEx = postIndex
  1921. default:
  1922. iNdEx = preIndex
  1923. skippy, err := skipBep(data[iNdEx:])
  1924. if err != nil {
  1925. return err
  1926. }
  1927. if skippy < 0 {
  1928. return ErrInvalidLengthBep
  1929. }
  1930. if (iNdEx + skippy) > l {
  1931. return io.ErrUnexpectedEOF
  1932. }
  1933. iNdEx += skippy
  1934. }
  1935. }
  1936. if iNdEx > l {
  1937. return io.ErrUnexpectedEOF
  1938. }
  1939. return nil
  1940. }
  1941. func (m *Device) Unmarshal(data []byte) error {
  1942. l := len(data)
  1943. iNdEx := 0
  1944. for iNdEx < l {
  1945. preIndex := iNdEx
  1946. var wire uint64
  1947. for shift := uint(0); ; shift += 7 {
  1948. if shift >= 64 {
  1949. return ErrIntOverflowBep
  1950. }
  1951. if iNdEx >= l {
  1952. return io.ErrUnexpectedEOF
  1953. }
  1954. b := data[iNdEx]
  1955. iNdEx++
  1956. wire |= (uint64(b) & 0x7F) << shift
  1957. if b < 0x80 {
  1958. break
  1959. }
  1960. }
  1961. fieldNum := int32(wire >> 3)
  1962. wireType := int(wire & 0x7)
  1963. if wireType == 4 {
  1964. return fmt.Errorf("proto: Device: wiretype end group for non-group")
  1965. }
  1966. if fieldNum <= 0 {
  1967. return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire)
  1968. }
  1969. switch fieldNum {
  1970. case 1:
  1971. if wireType != 2 {
  1972. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  1973. }
  1974. var byteLen int
  1975. for shift := uint(0); ; shift += 7 {
  1976. if shift >= 64 {
  1977. return ErrIntOverflowBep
  1978. }
  1979. if iNdEx >= l {
  1980. return io.ErrUnexpectedEOF
  1981. }
  1982. b := data[iNdEx]
  1983. iNdEx++
  1984. byteLen |= (int(b) & 0x7F) << shift
  1985. if b < 0x80 {
  1986. break
  1987. }
  1988. }
  1989. if byteLen < 0 {
  1990. return ErrInvalidLengthBep
  1991. }
  1992. postIndex := iNdEx + byteLen
  1993. if postIndex > l {
  1994. return io.ErrUnexpectedEOF
  1995. }
  1996. m.ID = append(m.ID[:0], data[iNdEx:postIndex]...)
  1997. if m.ID == nil {
  1998. m.ID = []byte{}
  1999. }
  2000. iNdEx = postIndex
  2001. case 2:
  2002. if wireType != 2 {
  2003. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  2004. }
  2005. var stringLen uint64
  2006. for shift := uint(0); ; shift += 7 {
  2007. if shift >= 64 {
  2008. return ErrIntOverflowBep
  2009. }
  2010. if iNdEx >= l {
  2011. return io.ErrUnexpectedEOF
  2012. }
  2013. b := data[iNdEx]
  2014. iNdEx++
  2015. stringLen |= (uint64(b) & 0x7F) << shift
  2016. if b < 0x80 {
  2017. break
  2018. }
  2019. }
  2020. intStringLen := int(stringLen)
  2021. if intStringLen < 0 {
  2022. return ErrInvalidLengthBep
  2023. }
  2024. postIndex := iNdEx + intStringLen
  2025. if postIndex > l {
  2026. return io.ErrUnexpectedEOF
  2027. }
  2028. m.Name = string(data[iNdEx:postIndex])
  2029. iNdEx = postIndex
  2030. case 3:
  2031. if wireType != 2 {
  2032. return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType)
  2033. }
  2034. var stringLen uint64
  2035. for shift := uint(0); ; shift += 7 {
  2036. if shift >= 64 {
  2037. return ErrIntOverflowBep
  2038. }
  2039. if iNdEx >= l {
  2040. return io.ErrUnexpectedEOF
  2041. }
  2042. b := data[iNdEx]
  2043. iNdEx++
  2044. stringLen |= (uint64(b) & 0x7F) << shift
  2045. if b < 0x80 {
  2046. break
  2047. }
  2048. }
  2049. intStringLen := int(stringLen)
  2050. if intStringLen < 0 {
  2051. return ErrInvalidLengthBep
  2052. }
  2053. postIndex := iNdEx + intStringLen
  2054. if postIndex > l {
  2055. return io.ErrUnexpectedEOF
  2056. }
  2057. m.Addresses = append(m.Addresses, string(data[iNdEx:postIndex]))
  2058. iNdEx = postIndex
  2059. case 4:
  2060. if wireType != 0 {
  2061. return fmt.Errorf("proto: wrong wireType = %d for field Compression", wireType)
  2062. }
  2063. m.Compression = 0
  2064. for shift := uint(0); ; shift += 7 {
  2065. if shift >= 64 {
  2066. return ErrIntOverflowBep
  2067. }
  2068. if iNdEx >= l {
  2069. return io.ErrUnexpectedEOF
  2070. }
  2071. b := data[iNdEx]
  2072. iNdEx++
  2073. m.Compression |= (Compression(b) & 0x7F) << shift
  2074. if b < 0x80 {
  2075. break
  2076. }
  2077. }
  2078. case 5:
  2079. if wireType != 2 {
  2080. return fmt.Errorf("proto: wrong wireType = %d for field CertName", wireType)
  2081. }
  2082. var stringLen uint64
  2083. for shift := uint(0); ; shift += 7 {
  2084. if shift >= 64 {
  2085. return ErrIntOverflowBep
  2086. }
  2087. if iNdEx >= l {
  2088. return io.ErrUnexpectedEOF
  2089. }
  2090. b := data[iNdEx]
  2091. iNdEx++
  2092. stringLen |= (uint64(b) & 0x7F) << shift
  2093. if b < 0x80 {
  2094. break
  2095. }
  2096. }
  2097. intStringLen := int(stringLen)
  2098. if intStringLen < 0 {
  2099. return ErrInvalidLengthBep
  2100. }
  2101. postIndex := iNdEx + intStringLen
  2102. if postIndex > l {
  2103. return io.ErrUnexpectedEOF
  2104. }
  2105. m.CertName = string(data[iNdEx:postIndex])
  2106. iNdEx = postIndex
  2107. case 6:
  2108. if wireType != 0 {
  2109. return fmt.Errorf("proto: wrong wireType = %d for field MaxSequence", wireType)
  2110. }
  2111. m.MaxSequence = 0
  2112. for shift := uint(0); ; shift += 7 {
  2113. if shift >= 64 {
  2114. return ErrIntOverflowBep
  2115. }
  2116. if iNdEx >= l {
  2117. return io.ErrUnexpectedEOF
  2118. }
  2119. b := data[iNdEx]
  2120. iNdEx++
  2121. m.MaxSequence |= (int64(b) & 0x7F) << shift
  2122. if b < 0x80 {
  2123. break
  2124. }
  2125. }
  2126. case 7:
  2127. if wireType != 0 {
  2128. return fmt.Errorf("proto: wrong wireType = %d for field Introducer", wireType)
  2129. }
  2130. var v int
  2131. for shift := uint(0); ; shift += 7 {
  2132. if shift >= 64 {
  2133. return ErrIntOverflowBep
  2134. }
  2135. if iNdEx >= l {
  2136. return io.ErrUnexpectedEOF
  2137. }
  2138. b := data[iNdEx]
  2139. iNdEx++
  2140. v |= (int(b) & 0x7F) << shift
  2141. if b < 0x80 {
  2142. break
  2143. }
  2144. }
  2145. m.Introducer = bool(v != 0)
  2146. case 8:
  2147. if wireType != 0 {
  2148. return fmt.Errorf("proto: wrong wireType = %d for field IndexID", wireType)
  2149. }
  2150. m.IndexID = 0
  2151. for shift := uint(0); ; shift += 7 {
  2152. if shift >= 64 {
  2153. return ErrIntOverflowBep
  2154. }
  2155. if iNdEx >= l {
  2156. return io.ErrUnexpectedEOF
  2157. }
  2158. b := data[iNdEx]
  2159. iNdEx++
  2160. m.IndexID |= (IndexID(b) & 0x7F) << shift
  2161. if b < 0x80 {
  2162. break
  2163. }
  2164. }
  2165. default:
  2166. iNdEx = preIndex
  2167. skippy, err := skipBep(data[iNdEx:])
  2168. if err != nil {
  2169. return err
  2170. }
  2171. if skippy < 0 {
  2172. return ErrInvalidLengthBep
  2173. }
  2174. if (iNdEx + skippy) > l {
  2175. return io.ErrUnexpectedEOF
  2176. }
  2177. iNdEx += skippy
  2178. }
  2179. }
  2180. if iNdEx > l {
  2181. return io.ErrUnexpectedEOF
  2182. }
  2183. return nil
  2184. }
  2185. func (m *Index) Unmarshal(data []byte) error {
  2186. l := len(data)
  2187. iNdEx := 0
  2188. for iNdEx < l {
  2189. preIndex := iNdEx
  2190. var wire uint64
  2191. for shift := uint(0); ; shift += 7 {
  2192. if shift >= 64 {
  2193. return ErrIntOverflowBep
  2194. }
  2195. if iNdEx >= l {
  2196. return io.ErrUnexpectedEOF
  2197. }
  2198. b := data[iNdEx]
  2199. iNdEx++
  2200. wire |= (uint64(b) & 0x7F) << shift
  2201. if b < 0x80 {
  2202. break
  2203. }
  2204. }
  2205. fieldNum := int32(wire >> 3)
  2206. wireType := int(wire & 0x7)
  2207. if wireType == 4 {
  2208. return fmt.Errorf("proto: Index: wiretype end group for non-group")
  2209. }
  2210. if fieldNum <= 0 {
  2211. return fmt.Errorf("proto: Index: illegal tag %d (wire type %d)", fieldNum, wire)
  2212. }
  2213. switch fieldNum {
  2214. case 1:
  2215. if wireType != 2 {
  2216. return fmt.Errorf("proto: wrong wireType = %d for field Folder", wireType)
  2217. }
  2218. var stringLen uint64
  2219. for shift := uint(0); ; shift += 7 {
  2220. if shift >= 64 {
  2221. return ErrIntOverflowBep
  2222. }
  2223. if iNdEx >= l {
  2224. return io.ErrUnexpectedEOF
  2225. }
  2226. b := data[iNdEx]
  2227. iNdEx++
  2228. stringLen |= (uint64(b) & 0x7F) << shift
  2229. if b < 0x80 {
  2230. break
  2231. }
  2232. }
  2233. intStringLen := int(stringLen)
  2234. if intStringLen < 0 {
  2235. return ErrInvalidLengthBep
  2236. }
  2237. postIndex := iNdEx + intStringLen
  2238. if postIndex > l {
  2239. return io.ErrUnexpectedEOF
  2240. }
  2241. m.Folder = string(data[iNdEx:postIndex])
  2242. iNdEx = postIndex
  2243. case 2:
  2244. if wireType != 2 {
  2245. return fmt.Errorf("proto: wrong wireType = %d for field Files", wireType)
  2246. }
  2247. var msglen int
  2248. for shift := uint(0); ; shift += 7 {
  2249. if shift >= 64 {
  2250. return ErrIntOverflowBep
  2251. }
  2252. if iNdEx >= l {
  2253. return io.ErrUnexpectedEOF
  2254. }
  2255. b := data[iNdEx]
  2256. iNdEx++
  2257. msglen |= (int(b) & 0x7F) << shift
  2258. if b < 0x80 {
  2259. break
  2260. }
  2261. }
  2262. if msglen < 0 {
  2263. return ErrInvalidLengthBep
  2264. }
  2265. postIndex := iNdEx + msglen
  2266. if postIndex > l {
  2267. return io.ErrUnexpectedEOF
  2268. }
  2269. m.Files = append(m.Files, FileInfo{})
  2270. if err := m.Files[len(m.Files)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2271. return err
  2272. }
  2273. iNdEx = postIndex
  2274. default:
  2275. iNdEx = preIndex
  2276. skippy, err := skipBep(data[iNdEx:])
  2277. if err != nil {
  2278. return err
  2279. }
  2280. if skippy < 0 {
  2281. return ErrInvalidLengthBep
  2282. }
  2283. if (iNdEx + skippy) > l {
  2284. return io.ErrUnexpectedEOF
  2285. }
  2286. iNdEx += skippy
  2287. }
  2288. }
  2289. if iNdEx > l {
  2290. return io.ErrUnexpectedEOF
  2291. }
  2292. return nil
  2293. }
  2294. func (m *IndexUpdate) Unmarshal(data []byte) error {
  2295. l := len(data)
  2296. iNdEx := 0
  2297. for iNdEx < l {
  2298. preIndex := iNdEx
  2299. var wire uint64
  2300. for shift := uint(0); ; shift += 7 {
  2301. if shift >= 64 {
  2302. return ErrIntOverflowBep
  2303. }
  2304. if iNdEx >= l {
  2305. return io.ErrUnexpectedEOF
  2306. }
  2307. b := data[iNdEx]
  2308. iNdEx++
  2309. wire |= (uint64(b) & 0x7F) << shift
  2310. if b < 0x80 {
  2311. break
  2312. }
  2313. }
  2314. fieldNum := int32(wire >> 3)
  2315. wireType := int(wire & 0x7)
  2316. if wireType == 4 {
  2317. return fmt.Errorf("proto: IndexUpdate: wiretype end group for non-group")
  2318. }
  2319. if fieldNum <= 0 {
  2320. return fmt.Errorf("proto: IndexUpdate: illegal tag %d (wire type %d)", fieldNum, wire)
  2321. }
  2322. switch fieldNum {
  2323. case 1:
  2324. if wireType != 2 {
  2325. return fmt.Errorf("proto: wrong wireType = %d for field Folder", wireType)
  2326. }
  2327. var stringLen uint64
  2328. for shift := uint(0); ; shift += 7 {
  2329. if shift >= 64 {
  2330. return ErrIntOverflowBep
  2331. }
  2332. if iNdEx >= l {
  2333. return io.ErrUnexpectedEOF
  2334. }
  2335. b := data[iNdEx]
  2336. iNdEx++
  2337. stringLen |= (uint64(b) & 0x7F) << shift
  2338. if b < 0x80 {
  2339. break
  2340. }
  2341. }
  2342. intStringLen := int(stringLen)
  2343. if intStringLen < 0 {
  2344. return ErrInvalidLengthBep
  2345. }
  2346. postIndex := iNdEx + intStringLen
  2347. if postIndex > l {
  2348. return io.ErrUnexpectedEOF
  2349. }
  2350. m.Folder = string(data[iNdEx:postIndex])
  2351. iNdEx = postIndex
  2352. case 2:
  2353. if wireType != 2 {
  2354. return fmt.Errorf("proto: wrong wireType = %d for field Files", wireType)
  2355. }
  2356. var msglen int
  2357. for shift := uint(0); ; shift += 7 {
  2358. if shift >= 64 {
  2359. return ErrIntOverflowBep
  2360. }
  2361. if iNdEx >= l {
  2362. return io.ErrUnexpectedEOF
  2363. }
  2364. b := data[iNdEx]
  2365. iNdEx++
  2366. msglen |= (int(b) & 0x7F) << shift
  2367. if b < 0x80 {
  2368. break
  2369. }
  2370. }
  2371. if msglen < 0 {
  2372. return ErrInvalidLengthBep
  2373. }
  2374. postIndex := iNdEx + msglen
  2375. if postIndex > l {
  2376. return io.ErrUnexpectedEOF
  2377. }
  2378. m.Files = append(m.Files, FileInfo{})
  2379. if err := m.Files[len(m.Files)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2380. return err
  2381. }
  2382. iNdEx = postIndex
  2383. default:
  2384. iNdEx = preIndex
  2385. skippy, err := skipBep(data[iNdEx:])
  2386. if err != nil {
  2387. return err
  2388. }
  2389. if skippy < 0 {
  2390. return ErrInvalidLengthBep
  2391. }
  2392. if (iNdEx + skippy) > l {
  2393. return io.ErrUnexpectedEOF
  2394. }
  2395. iNdEx += skippy
  2396. }
  2397. }
  2398. if iNdEx > l {
  2399. return io.ErrUnexpectedEOF
  2400. }
  2401. return nil
  2402. }
  2403. func (m *FileInfo) Unmarshal(data []byte) error {
  2404. l := len(data)
  2405. iNdEx := 0
  2406. for iNdEx < l {
  2407. preIndex := iNdEx
  2408. var wire uint64
  2409. for shift := uint(0); ; shift += 7 {
  2410. if shift >= 64 {
  2411. return ErrIntOverflowBep
  2412. }
  2413. if iNdEx >= l {
  2414. return io.ErrUnexpectedEOF
  2415. }
  2416. b := data[iNdEx]
  2417. iNdEx++
  2418. wire |= (uint64(b) & 0x7F) << shift
  2419. if b < 0x80 {
  2420. break
  2421. }
  2422. }
  2423. fieldNum := int32(wire >> 3)
  2424. wireType := int(wire & 0x7)
  2425. if wireType == 4 {
  2426. return fmt.Errorf("proto: FileInfo: wiretype end group for non-group")
  2427. }
  2428. if fieldNum <= 0 {
  2429. return fmt.Errorf("proto: FileInfo: illegal tag %d (wire type %d)", fieldNum, wire)
  2430. }
  2431. switch fieldNum {
  2432. case 1:
  2433. if wireType != 2 {
  2434. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  2435. }
  2436. var stringLen uint64
  2437. for shift := uint(0); ; shift += 7 {
  2438. if shift >= 64 {
  2439. return ErrIntOverflowBep
  2440. }
  2441. if iNdEx >= l {
  2442. return io.ErrUnexpectedEOF
  2443. }
  2444. b := data[iNdEx]
  2445. iNdEx++
  2446. stringLen |= (uint64(b) & 0x7F) << shift
  2447. if b < 0x80 {
  2448. break
  2449. }
  2450. }
  2451. intStringLen := int(stringLen)
  2452. if intStringLen < 0 {
  2453. return ErrInvalidLengthBep
  2454. }
  2455. postIndex := iNdEx + intStringLen
  2456. if postIndex > l {
  2457. return io.ErrUnexpectedEOF
  2458. }
  2459. m.Name = string(data[iNdEx:postIndex])
  2460. iNdEx = postIndex
  2461. case 2:
  2462. if wireType != 0 {
  2463. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  2464. }
  2465. m.Type = 0
  2466. for shift := uint(0); ; shift += 7 {
  2467. if shift >= 64 {
  2468. return ErrIntOverflowBep
  2469. }
  2470. if iNdEx >= l {
  2471. return io.ErrUnexpectedEOF
  2472. }
  2473. b := data[iNdEx]
  2474. iNdEx++
  2475. m.Type |= (FileInfoType(b) & 0x7F) << shift
  2476. if b < 0x80 {
  2477. break
  2478. }
  2479. }
  2480. case 3:
  2481. if wireType != 0 {
  2482. return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType)
  2483. }
  2484. m.Size = 0
  2485. for shift := uint(0); ; shift += 7 {
  2486. if shift >= 64 {
  2487. return ErrIntOverflowBep
  2488. }
  2489. if iNdEx >= l {
  2490. return io.ErrUnexpectedEOF
  2491. }
  2492. b := data[iNdEx]
  2493. iNdEx++
  2494. m.Size |= (int64(b) & 0x7F) << shift
  2495. if b < 0x80 {
  2496. break
  2497. }
  2498. }
  2499. case 4:
  2500. if wireType != 0 {
  2501. return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType)
  2502. }
  2503. m.Permissions = 0
  2504. for shift := uint(0); ; shift += 7 {
  2505. if shift >= 64 {
  2506. return ErrIntOverflowBep
  2507. }
  2508. if iNdEx >= l {
  2509. return io.ErrUnexpectedEOF
  2510. }
  2511. b := data[iNdEx]
  2512. iNdEx++
  2513. m.Permissions |= (uint32(b) & 0x7F) << shift
  2514. if b < 0x80 {
  2515. break
  2516. }
  2517. }
  2518. case 5:
  2519. if wireType != 0 {
  2520. return fmt.Errorf("proto: wrong wireType = %d for field ModifiedS", wireType)
  2521. }
  2522. m.ModifiedS = 0
  2523. for shift := uint(0); ; shift += 7 {
  2524. if shift >= 64 {
  2525. return ErrIntOverflowBep
  2526. }
  2527. if iNdEx >= l {
  2528. return io.ErrUnexpectedEOF
  2529. }
  2530. b := data[iNdEx]
  2531. iNdEx++
  2532. m.ModifiedS |= (int64(b) & 0x7F) << shift
  2533. if b < 0x80 {
  2534. break
  2535. }
  2536. }
  2537. case 6:
  2538. if wireType != 0 {
  2539. return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType)
  2540. }
  2541. var v int
  2542. for shift := uint(0); ; shift += 7 {
  2543. if shift >= 64 {
  2544. return ErrIntOverflowBep
  2545. }
  2546. if iNdEx >= l {
  2547. return io.ErrUnexpectedEOF
  2548. }
  2549. b := data[iNdEx]
  2550. iNdEx++
  2551. v |= (int(b) & 0x7F) << shift
  2552. if b < 0x80 {
  2553. break
  2554. }
  2555. }
  2556. m.Deleted = bool(v != 0)
  2557. case 7:
  2558. if wireType != 0 {
  2559. return fmt.Errorf("proto: wrong wireType = %d for field Invalid", wireType)
  2560. }
  2561. var v int
  2562. for shift := uint(0); ; shift += 7 {
  2563. if shift >= 64 {
  2564. return ErrIntOverflowBep
  2565. }
  2566. if iNdEx >= l {
  2567. return io.ErrUnexpectedEOF
  2568. }
  2569. b := data[iNdEx]
  2570. iNdEx++
  2571. v |= (int(b) & 0x7F) << shift
  2572. if b < 0x80 {
  2573. break
  2574. }
  2575. }
  2576. m.Invalid = bool(v != 0)
  2577. case 8:
  2578. if wireType != 0 {
  2579. return fmt.Errorf("proto: wrong wireType = %d for field NoPermissions", wireType)
  2580. }
  2581. var v int
  2582. for shift := uint(0); ; shift += 7 {
  2583. if shift >= 64 {
  2584. return ErrIntOverflowBep
  2585. }
  2586. if iNdEx >= l {
  2587. return io.ErrUnexpectedEOF
  2588. }
  2589. b := data[iNdEx]
  2590. iNdEx++
  2591. v |= (int(b) & 0x7F) << shift
  2592. if b < 0x80 {
  2593. break
  2594. }
  2595. }
  2596. m.NoPermissions = bool(v != 0)
  2597. case 9:
  2598. if wireType != 2 {
  2599. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  2600. }
  2601. var msglen int
  2602. for shift := uint(0); ; shift += 7 {
  2603. if shift >= 64 {
  2604. return ErrIntOverflowBep
  2605. }
  2606. if iNdEx >= l {
  2607. return io.ErrUnexpectedEOF
  2608. }
  2609. b := data[iNdEx]
  2610. iNdEx++
  2611. msglen |= (int(b) & 0x7F) << shift
  2612. if b < 0x80 {
  2613. break
  2614. }
  2615. }
  2616. if msglen < 0 {
  2617. return ErrInvalidLengthBep
  2618. }
  2619. postIndex := iNdEx + msglen
  2620. if postIndex > l {
  2621. return io.ErrUnexpectedEOF
  2622. }
  2623. if err := m.Version.Unmarshal(data[iNdEx:postIndex]); err != nil {
  2624. return err
  2625. }
  2626. iNdEx = postIndex
  2627. case 10:
  2628. if wireType != 0 {
  2629. return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType)
  2630. }
  2631. m.Sequence = 0
  2632. for shift := uint(0); ; shift += 7 {
  2633. if shift >= 64 {
  2634. return ErrIntOverflowBep
  2635. }
  2636. if iNdEx >= l {
  2637. return io.ErrUnexpectedEOF
  2638. }
  2639. b := data[iNdEx]
  2640. iNdEx++
  2641. m.Sequence |= (int64(b) & 0x7F) << shift
  2642. if b < 0x80 {
  2643. break
  2644. }
  2645. }
  2646. case 11:
  2647. if wireType != 0 {
  2648. return fmt.Errorf("proto: wrong wireType = %d for field ModifiedNs", wireType)
  2649. }
  2650. m.ModifiedNs = 0
  2651. for shift := uint(0); ; shift += 7 {
  2652. if shift >= 64 {
  2653. return ErrIntOverflowBep
  2654. }
  2655. if iNdEx >= l {
  2656. return io.ErrUnexpectedEOF
  2657. }
  2658. b := data[iNdEx]
  2659. iNdEx++
  2660. m.ModifiedNs |= (int32(b) & 0x7F) << shift
  2661. if b < 0x80 {
  2662. break
  2663. }
  2664. }
  2665. case 16:
  2666. if wireType != 2 {
  2667. return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType)
  2668. }
  2669. var msglen int
  2670. for shift := uint(0); ; shift += 7 {
  2671. if shift >= 64 {
  2672. return ErrIntOverflowBep
  2673. }
  2674. if iNdEx >= l {
  2675. return io.ErrUnexpectedEOF
  2676. }
  2677. b := data[iNdEx]
  2678. iNdEx++
  2679. msglen |= (int(b) & 0x7F) << shift
  2680. if b < 0x80 {
  2681. break
  2682. }
  2683. }
  2684. if msglen < 0 {
  2685. return ErrInvalidLengthBep
  2686. }
  2687. postIndex := iNdEx + msglen
  2688. if postIndex > l {
  2689. return io.ErrUnexpectedEOF
  2690. }
  2691. m.Blocks = append(m.Blocks, BlockInfo{})
  2692. if err := m.Blocks[len(m.Blocks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2693. return err
  2694. }
  2695. iNdEx = postIndex
  2696. default:
  2697. iNdEx = preIndex
  2698. skippy, err := skipBep(data[iNdEx:])
  2699. if err != nil {
  2700. return err
  2701. }
  2702. if skippy < 0 {
  2703. return ErrInvalidLengthBep
  2704. }
  2705. if (iNdEx + skippy) > l {
  2706. return io.ErrUnexpectedEOF
  2707. }
  2708. iNdEx += skippy
  2709. }
  2710. }
  2711. if iNdEx > l {
  2712. return io.ErrUnexpectedEOF
  2713. }
  2714. return nil
  2715. }
  2716. func (m *BlockInfo) Unmarshal(data []byte) error {
  2717. l := len(data)
  2718. iNdEx := 0
  2719. for iNdEx < l {
  2720. preIndex := iNdEx
  2721. var wire uint64
  2722. for shift := uint(0); ; shift += 7 {
  2723. if shift >= 64 {
  2724. return ErrIntOverflowBep
  2725. }
  2726. if iNdEx >= l {
  2727. return io.ErrUnexpectedEOF
  2728. }
  2729. b := data[iNdEx]
  2730. iNdEx++
  2731. wire |= (uint64(b) & 0x7F) << shift
  2732. if b < 0x80 {
  2733. break
  2734. }
  2735. }
  2736. fieldNum := int32(wire >> 3)
  2737. wireType := int(wire & 0x7)
  2738. if wireType == 4 {
  2739. return fmt.Errorf("proto: BlockInfo: wiretype end group for non-group")
  2740. }
  2741. if fieldNum <= 0 {
  2742. return fmt.Errorf("proto: BlockInfo: illegal tag %d (wire type %d)", fieldNum, wire)
  2743. }
  2744. switch fieldNum {
  2745. case 1:
  2746. if wireType != 0 {
  2747. return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType)
  2748. }
  2749. m.Offset = 0
  2750. for shift := uint(0); ; shift += 7 {
  2751. if shift >= 64 {
  2752. return ErrIntOverflowBep
  2753. }
  2754. if iNdEx >= l {
  2755. return io.ErrUnexpectedEOF
  2756. }
  2757. b := data[iNdEx]
  2758. iNdEx++
  2759. m.Offset |= (int64(b) & 0x7F) << shift
  2760. if b < 0x80 {
  2761. break
  2762. }
  2763. }
  2764. case 2:
  2765. if wireType != 0 {
  2766. return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType)
  2767. }
  2768. m.Size = 0
  2769. for shift := uint(0); ; shift += 7 {
  2770. if shift >= 64 {
  2771. return ErrIntOverflowBep
  2772. }
  2773. if iNdEx >= l {
  2774. return io.ErrUnexpectedEOF
  2775. }
  2776. b := data[iNdEx]
  2777. iNdEx++
  2778. m.Size |= (int32(b) & 0x7F) << shift
  2779. if b < 0x80 {
  2780. break
  2781. }
  2782. }
  2783. case 3:
  2784. if wireType != 2 {
  2785. return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType)
  2786. }
  2787. var byteLen int
  2788. for shift := uint(0); ; shift += 7 {
  2789. if shift >= 64 {
  2790. return ErrIntOverflowBep
  2791. }
  2792. if iNdEx >= l {
  2793. return io.ErrUnexpectedEOF
  2794. }
  2795. b := data[iNdEx]
  2796. iNdEx++
  2797. byteLen |= (int(b) & 0x7F) << shift
  2798. if b < 0x80 {
  2799. break
  2800. }
  2801. }
  2802. if byteLen < 0 {
  2803. return ErrInvalidLengthBep
  2804. }
  2805. postIndex := iNdEx + byteLen
  2806. if postIndex > l {
  2807. return io.ErrUnexpectedEOF
  2808. }
  2809. m.Hash = append(m.Hash[:0], data[iNdEx:postIndex]...)
  2810. if m.Hash == nil {
  2811. m.Hash = []byte{}
  2812. }
  2813. iNdEx = postIndex
  2814. default:
  2815. iNdEx = preIndex
  2816. skippy, err := skipBep(data[iNdEx:])
  2817. if err != nil {
  2818. return err
  2819. }
  2820. if skippy < 0 {
  2821. return ErrInvalidLengthBep
  2822. }
  2823. if (iNdEx + skippy) > l {
  2824. return io.ErrUnexpectedEOF
  2825. }
  2826. iNdEx += skippy
  2827. }
  2828. }
  2829. if iNdEx > l {
  2830. return io.ErrUnexpectedEOF
  2831. }
  2832. return nil
  2833. }
  2834. func (m *Vector) Unmarshal(data []byte) error {
  2835. l := len(data)
  2836. iNdEx := 0
  2837. for iNdEx < l {
  2838. preIndex := iNdEx
  2839. var wire uint64
  2840. for shift := uint(0); ; shift += 7 {
  2841. if shift >= 64 {
  2842. return ErrIntOverflowBep
  2843. }
  2844. if iNdEx >= l {
  2845. return io.ErrUnexpectedEOF
  2846. }
  2847. b := data[iNdEx]
  2848. iNdEx++
  2849. wire |= (uint64(b) & 0x7F) << shift
  2850. if b < 0x80 {
  2851. break
  2852. }
  2853. }
  2854. fieldNum := int32(wire >> 3)
  2855. wireType := int(wire & 0x7)
  2856. if wireType == 4 {
  2857. return fmt.Errorf("proto: Vector: wiretype end group for non-group")
  2858. }
  2859. if fieldNum <= 0 {
  2860. return fmt.Errorf("proto: Vector: illegal tag %d (wire type %d)", fieldNum, wire)
  2861. }
  2862. switch fieldNum {
  2863. case 1:
  2864. if wireType != 2 {
  2865. return fmt.Errorf("proto: wrong wireType = %d for field Counters", wireType)
  2866. }
  2867. var msglen int
  2868. for shift := uint(0); ; shift += 7 {
  2869. if shift >= 64 {
  2870. return ErrIntOverflowBep
  2871. }
  2872. if iNdEx >= l {
  2873. return io.ErrUnexpectedEOF
  2874. }
  2875. b := data[iNdEx]
  2876. iNdEx++
  2877. msglen |= (int(b) & 0x7F) << shift
  2878. if b < 0x80 {
  2879. break
  2880. }
  2881. }
  2882. if msglen < 0 {
  2883. return ErrInvalidLengthBep
  2884. }
  2885. postIndex := iNdEx + msglen
  2886. if postIndex > l {
  2887. return io.ErrUnexpectedEOF
  2888. }
  2889. m.Counters = append(m.Counters, Counter{})
  2890. if err := m.Counters[len(m.Counters)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  2891. return err
  2892. }
  2893. iNdEx = postIndex
  2894. default:
  2895. iNdEx = preIndex
  2896. skippy, err := skipBep(data[iNdEx:])
  2897. if err != nil {
  2898. return err
  2899. }
  2900. if skippy < 0 {
  2901. return ErrInvalidLengthBep
  2902. }
  2903. if (iNdEx + skippy) > l {
  2904. return io.ErrUnexpectedEOF
  2905. }
  2906. iNdEx += skippy
  2907. }
  2908. }
  2909. if iNdEx > l {
  2910. return io.ErrUnexpectedEOF
  2911. }
  2912. return nil
  2913. }
  2914. func (m *Counter) Unmarshal(data []byte) error {
  2915. l := len(data)
  2916. iNdEx := 0
  2917. for iNdEx < l {
  2918. preIndex := iNdEx
  2919. var wire uint64
  2920. for shift := uint(0); ; shift += 7 {
  2921. if shift >= 64 {
  2922. return ErrIntOverflowBep
  2923. }
  2924. if iNdEx >= l {
  2925. return io.ErrUnexpectedEOF
  2926. }
  2927. b := data[iNdEx]
  2928. iNdEx++
  2929. wire |= (uint64(b) & 0x7F) << shift
  2930. if b < 0x80 {
  2931. break
  2932. }
  2933. }
  2934. fieldNum := int32(wire >> 3)
  2935. wireType := int(wire & 0x7)
  2936. if wireType == 4 {
  2937. return fmt.Errorf("proto: Counter: wiretype end group for non-group")
  2938. }
  2939. if fieldNum <= 0 {
  2940. return fmt.Errorf("proto: Counter: illegal tag %d (wire type %d)", fieldNum, wire)
  2941. }
  2942. switch fieldNum {
  2943. case 1:
  2944. if wireType != 0 {
  2945. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  2946. }
  2947. m.ID = 0
  2948. for shift := uint(0); ; shift += 7 {
  2949. if shift >= 64 {
  2950. return ErrIntOverflowBep
  2951. }
  2952. if iNdEx >= l {
  2953. return io.ErrUnexpectedEOF
  2954. }
  2955. b := data[iNdEx]
  2956. iNdEx++
  2957. m.ID |= (ShortID(b) & 0x7F) << shift
  2958. if b < 0x80 {
  2959. break
  2960. }
  2961. }
  2962. case 2:
  2963. if wireType != 0 {
  2964. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  2965. }
  2966. m.Value = 0
  2967. for shift := uint(0); ; shift += 7 {
  2968. if shift >= 64 {
  2969. return ErrIntOverflowBep
  2970. }
  2971. if iNdEx >= l {
  2972. return io.ErrUnexpectedEOF
  2973. }
  2974. b := data[iNdEx]
  2975. iNdEx++
  2976. m.Value |= (uint64(b) & 0x7F) << shift
  2977. if b < 0x80 {
  2978. break
  2979. }
  2980. }
  2981. default:
  2982. iNdEx = preIndex
  2983. skippy, err := skipBep(data[iNdEx:])
  2984. if err != nil {
  2985. return err
  2986. }
  2987. if skippy < 0 {
  2988. return ErrInvalidLengthBep
  2989. }
  2990. if (iNdEx + skippy) > l {
  2991. return io.ErrUnexpectedEOF
  2992. }
  2993. iNdEx += skippy
  2994. }
  2995. }
  2996. if iNdEx > l {
  2997. return io.ErrUnexpectedEOF
  2998. }
  2999. return nil
  3000. }
  3001. func (m *Request) Unmarshal(data []byte) error {
  3002. l := len(data)
  3003. iNdEx := 0
  3004. for iNdEx < l {
  3005. preIndex := iNdEx
  3006. var wire uint64
  3007. for shift := uint(0); ; shift += 7 {
  3008. if shift >= 64 {
  3009. return ErrIntOverflowBep
  3010. }
  3011. if iNdEx >= l {
  3012. return io.ErrUnexpectedEOF
  3013. }
  3014. b := data[iNdEx]
  3015. iNdEx++
  3016. wire |= (uint64(b) & 0x7F) << shift
  3017. if b < 0x80 {
  3018. break
  3019. }
  3020. }
  3021. fieldNum := int32(wire >> 3)
  3022. wireType := int(wire & 0x7)
  3023. if wireType == 4 {
  3024. return fmt.Errorf("proto: Request: wiretype end group for non-group")
  3025. }
  3026. if fieldNum <= 0 {
  3027. return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire)
  3028. }
  3029. switch fieldNum {
  3030. case 1:
  3031. if wireType != 0 {
  3032. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  3033. }
  3034. m.ID = 0
  3035. for shift := uint(0); ; shift += 7 {
  3036. if shift >= 64 {
  3037. return ErrIntOverflowBep
  3038. }
  3039. if iNdEx >= l {
  3040. return io.ErrUnexpectedEOF
  3041. }
  3042. b := data[iNdEx]
  3043. iNdEx++
  3044. m.ID |= (int32(b) & 0x7F) << shift
  3045. if b < 0x80 {
  3046. break
  3047. }
  3048. }
  3049. case 2:
  3050. if wireType != 2 {
  3051. return fmt.Errorf("proto: wrong wireType = %d for field Folder", wireType)
  3052. }
  3053. var stringLen uint64
  3054. for shift := uint(0); ; shift += 7 {
  3055. if shift >= 64 {
  3056. return ErrIntOverflowBep
  3057. }
  3058. if iNdEx >= l {
  3059. return io.ErrUnexpectedEOF
  3060. }
  3061. b := data[iNdEx]
  3062. iNdEx++
  3063. stringLen |= (uint64(b) & 0x7F) << shift
  3064. if b < 0x80 {
  3065. break
  3066. }
  3067. }
  3068. intStringLen := int(stringLen)
  3069. if intStringLen < 0 {
  3070. return ErrInvalidLengthBep
  3071. }
  3072. postIndex := iNdEx + intStringLen
  3073. if postIndex > l {
  3074. return io.ErrUnexpectedEOF
  3075. }
  3076. m.Folder = string(data[iNdEx:postIndex])
  3077. iNdEx = postIndex
  3078. case 3:
  3079. if wireType != 2 {
  3080. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  3081. }
  3082. var stringLen uint64
  3083. for shift := uint(0); ; shift += 7 {
  3084. if shift >= 64 {
  3085. return ErrIntOverflowBep
  3086. }
  3087. if iNdEx >= l {
  3088. return io.ErrUnexpectedEOF
  3089. }
  3090. b := data[iNdEx]
  3091. iNdEx++
  3092. stringLen |= (uint64(b) & 0x7F) << shift
  3093. if b < 0x80 {
  3094. break
  3095. }
  3096. }
  3097. intStringLen := int(stringLen)
  3098. if intStringLen < 0 {
  3099. return ErrInvalidLengthBep
  3100. }
  3101. postIndex := iNdEx + intStringLen
  3102. if postIndex > l {
  3103. return io.ErrUnexpectedEOF
  3104. }
  3105. m.Name = string(data[iNdEx:postIndex])
  3106. iNdEx = postIndex
  3107. case 4:
  3108. if wireType != 0 {
  3109. return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType)
  3110. }
  3111. m.Offset = 0
  3112. for shift := uint(0); ; shift += 7 {
  3113. if shift >= 64 {
  3114. return ErrIntOverflowBep
  3115. }
  3116. if iNdEx >= l {
  3117. return io.ErrUnexpectedEOF
  3118. }
  3119. b := data[iNdEx]
  3120. iNdEx++
  3121. m.Offset |= (int64(b) & 0x7F) << shift
  3122. if b < 0x80 {
  3123. break
  3124. }
  3125. }
  3126. case 5:
  3127. if wireType != 0 {
  3128. return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType)
  3129. }
  3130. m.Size = 0
  3131. for shift := uint(0); ; shift += 7 {
  3132. if shift >= 64 {
  3133. return ErrIntOverflowBep
  3134. }
  3135. if iNdEx >= l {
  3136. return io.ErrUnexpectedEOF
  3137. }
  3138. b := data[iNdEx]
  3139. iNdEx++
  3140. m.Size |= (int32(b) & 0x7F) << shift
  3141. if b < 0x80 {
  3142. break
  3143. }
  3144. }
  3145. case 6:
  3146. if wireType != 2 {
  3147. return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType)
  3148. }
  3149. var byteLen int
  3150. for shift := uint(0); ; shift += 7 {
  3151. if shift >= 64 {
  3152. return ErrIntOverflowBep
  3153. }
  3154. if iNdEx >= l {
  3155. return io.ErrUnexpectedEOF
  3156. }
  3157. b := data[iNdEx]
  3158. iNdEx++
  3159. byteLen |= (int(b) & 0x7F) << shift
  3160. if b < 0x80 {
  3161. break
  3162. }
  3163. }
  3164. if byteLen < 0 {
  3165. return ErrInvalidLengthBep
  3166. }
  3167. postIndex := iNdEx + byteLen
  3168. if postIndex > l {
  3169. return io.ErrUnexpectedEOF
  3170. }
  3171. m.Hash = append(m.Hash[:0], data[iNdEx:postIndex]...)
  3172. if m.Hash == nil {
  3173. m.Hash = []byte{}
  3174. }
  3175. iNdEx = postIndex
  3176. case 7:
  3177. if wireType != 0 {
  3178. return fmt.Errorf("proto: wrong wireType = %d for field FromTemporary", wireType)
  3179. }
  3180. var v int
  3181. for shift := uint(0); ; shift += 7 {
  3182. if shift >= 64 {
  3183. return ErrIntOverflowBep
  3184. }
  3185. if iNdEx >= l {
  3186. return io.ErrUnexpectedEOF
  3187. }
  3188. b := data[iNdEx]
  3189. iNdEx++
  3190. v |= (int(b) & 0x7F) << shift
  3191. if b < 0x80 {
  3192. break
  3193. }
  3194. }
  3195. m.FromTemporary = bool(v != 0)
  3196. default:
  3197. iNdEx = preIndex
  3198. skippy, err := skipBep(data[iNdEx:])
  3199. if err != nil {
  3200. return err
  3201. }
  3202. if skippy < 0 {
  3203. return ErrInvalidLengthBep
  3204. }
  3205. if (iNdEx + skippy) > l {
  3206. return io.ErrUnexpectedEOF
  3207. }
  3208. iNdEx += skippy
  3209. }
  3210. }
  3211. if iNdEx > l {
  3212. return io.ErrUnexpectedEOF
  3213. }
  3214. return nil
  3215. }
  3216. func (m *Response) Unmarshal(data []byte) error {
  3217. l := len(data)
  3218. iNdEx := 0
  3219. for iNdEx < l {
  3220. preIndex := iNdEx
  3221. var wire uint64
  3222. for shift := uint(0); ; shift += 7 {
  3223. if shift >= 64 {
  3224. return ErrIntOverflowBep
  3225. }
  3226. if iNdEx >= l {
  3227. return io.ErrUnexpectedEOF
  3228. }
  3229. b := data[iNdEx]
  3230. iNdEx++
  3231. wire |= (uint64(b) & 0x7F) << shift
  3232. if b < 0x80 {
  3233. break
  3234. }
  3235. }
  3236. fieldNum := int32(wire >> 3)
  3237. wireType := int(wire & 0x7)
  3238. if wireType == 4 {
  3239. return fmt.Errorf("proto: Response: wiretype end group for non-group")
  3240. }
  3241. if fieldNum <= 0 {
  3242. return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire)
  3243. }
  3244. switch fieldNum {
  3245. case 1:
  3246. if wireType != 0 {
  3247. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  3248. }
  3249. m.ID = 0
  3250. for shift := uint(0); ; shift += 7 {
  3251. if shift >= 64 {
  3252. return ErrIntOverflowBep
  3253. }
  3254. if iNdEx >= l {
  3255. return io.ErrUnexpectedEOF
  3256. }
  3257. b := data[iNdEx]
  3258. iNdEx++
  3259. m.ID |= (int32(b) & 0x7F) << shift
  3260. if b < 0x80 {
  3261. break
  3262. }
  3263. }
  3264. case 2:
  3265. if wireType != 2 {
  3266. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  3267. }
  3268. var byteLen int
  3269. for shift := uint(0); ; shift += 7 {
  3270. if shift >= 64 {
  3271. return ErrIntOverflowBep
  3272. }
  3273. if iNdEx >= l {
  3274. return io.ErrUnexpectedEOF
  3275. }
  3276. b := data[iNdEx]
  3277. iNdEx++
  3278. byteLen |= (int(b) & 0x7F) << shift
  3279. if b < 0x80 {
  3280. break
  3281. }
  3282. }
  3283. if byteLen < 0 {
  3284. return ErrInvalidLengthBep
  3285. }
  3286. postIndex := iNdEx + byteLen
  3287. if postIndex > l {
  3288. return io.ErrUnexpectedEOF
  3289. }
  3290. m.Data = append(m.Data[:0], data[iNdEx:postIndex]...)
  3291. if m.Data == nil {
  3292. m.Data = []byte{}
  3293. }
  3294. iNdEx = postIndex
  3295. case 3:
  3296. if wireType != 0 {
  3297. return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType)
  3298. }
  3299. m.Code = 0
  3300. for shift := uint(0); ; shift += 7 {
  3301. if shift >= 64 {
  3302. return ErrIntOverflowBep
  3303. }
  3304. if iNdEx >= l {
  3305. return io.ErrUnexpectedEOF
  3306. }
  3307. b := data[iNdEx]
  3308. iNdEx++
  3309. m.Code |= (ErrorCode(b) & 0x7F) << shift
  3310. if b < 0x80 {
  3311. break
  3312. }
  3313. }
  3314. default:
  3315. iNdEx = preIndex
  3316. skippy, err := skipBep(data[iNdEx:])
  3317. if err != nil {
  3318. return err
  3319. }
  3320. if skippy < 0 {
  3321. return ErrInvalidLengthBep
  3322. }
  3323. if (iNdEx + skippy) > l {
  3324. return io.ErrUnexpectedEOF
  3325. }
  3326. iNdEx += skippy
  3327. }
  3328. }
  3329. if iNdEx > l {
  3330. return io.ErrUnexpectedEOF
  3331. }
  3332. return nil
  3333. }
  3334. func (m *DownloadProgress) Unmarshal(data []byte) error {
  3335. l := len(data)
  3336. iNdEx := 0
  3337. for iNdEx < l {
  3338. preIndex := iNdEx
  3339. var wire uint64
  3340. for shift := uint(0); ; shift += 7 {
  3341. if shift >= 64 {
  3342. return ErrIntOverflowBep
  3343. }
  3344. if iNdEx >= l {
  3345. return io.ErrUnexpectedEOF
  3346. }
  3347. b := data[iNdEx]
  3348. iNdEx++
  3349. wire |= (uint64(b) & 0x7F) << shift
  3350. if b < 0x80 {
  3351. break
  3352. }
  3353. }
  3354. fieldNum := int32(wire >> 3)
  3355. wireType := int(wire & 0x7)
  3356. if wireType == 4 {
  3357. return fmt.Errorf("proto: DownloadProgress: wiretype end group for non-group")
  3358. }
  3359. if fieldNum <= 0 {
  3360. return fmt.Errorf("proto: DownloadProgress: illegal tag %d (wire type %d)", fieldNum, wire)
  3361. }
  3362. switch fieldNum {
  3363. case 1:
  3364. if wireType != 2 {
  3365. return fmt.Errorf("proto: wrong wireType = %d for field Folder", wireType)
  3366. }
  3367. var stringLen uint64
  3368. for shift := uint(0); ; shift += 7 {
  3369. if shift >= 64 {
  3370. return ErrIntOverflowBep
  3371. }
  3372. if iNdEx >= l {
  3373. return io.ErrUnexpectedEOF
  3374. }
  3375. b := data[iNdEx]
  3376. iNdEx++
  3377. stringLen |= (uint64(b) & 0x7F) << shift
  3378. if b < 0x80 {
  3379. break
  3380. }
  3381. }
  3382. intStringLen := int(stringLen)
  3383. if intStringLen < 0 {
  3384. return ErrInvalidLengthBep
  3385. }
  3386. postIndex := iNdEx + intStringLen
  3387. if postIndex > l {
  3388. return io.ErrUnexpectedEOF
  3389. }
  3390. m.Folder = string(data[iNdEx:postIndex])
  3391. iNdEx = postIndex
  3392. case 2:
  3393. if wireType != 2 {
  3394. return fmt.Errorf("proto: wrong wireType = %d for field Updates", wireType)
  3395. }
  3396. var msglen int
  3397. for shift := uint(0); ; shift += 7 {
  3398. if shift >= 64 {
  3399. return ErrIntOverflowBep
  3400. }
  3401. if iNdEx >= l {
  3402. return io.ErrUnexpectedEOF
  3403. }
  3404. b := data[iNdEx]
  3405. iNdEx++
  3406. msglen |= (int(b) & 0x7F) << shift
  3407. if b < 0x80 {
  3408. break
  3409. }
  3410. }
  3411. if msglen < 0 {
  3412. return ErrInvalidLengthBep
  3413. }
  3414. postIndex := iNdEx + msglen
  3415. if postIndex > l {
  3416. return io.ErrUnexpectedEOF
  3417. }
  3418. m.Updates = append(m.Updates, FileDownloadProgressUpdate{})
  3419. if err := m.Updates[len(m.Updates)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
  3420. return err
  3421. }
  3422. iNdEx = postIndex
  3423. default:
  3424. iNdEx = preIndex
  3425. skippy, err := skipBep(data[iNdEx:])
  3426. if err != nil {
  3427. return err
  3428. }
  3429. if skippy < 0 {
  3430. return ErrInvalidLengthBep
  3431. }
  3432. if (iNdEx + skippy) > l {
  3433. return io.ErrUnexpectedEOF
  3434. }
  3435. iNdEx += skippy
  3436. }
  3437. }
  3438. if iNdEx > l {
  3439. return io.ErrUnexpectedEOF
  3440. }
  3441. return nil
  3442. }
  3443. func (m *FileDownloadProgressUpdate) Unmarshal(data []byte) error {
  3444. l := len(data)
  3445. iNdEx := 0
  3446. for iNdEx < l {
  3447. preIndex := iNdEx
  3448. var wire uint64
  3449. for shift := uint(0); ; shift += 7 {
  3450. if shift >= 64 {
  3451. return ErrIntOverflowBep
  3452. }
  3453. if iNdEx >= l {
  3454. return io.ErrUnexpectedEOF
  3455. }
  3456. b := data[iNdEx]
  3457. iNdEx++
  3458. wire |= (uint64(b) & 0x7F) << shift
  3459. if b < 0x80 {
  3460. break
  3461. }
  3462. }
  3463. fieldNum := int32(wire >> 3)
  3464. wireType := int(wire & 0x7)
  3465. if wireType == 4 {
  3466. return fmt.Errorf("proto: FileDownloadProgressUpdate: wiretype end group for non-group")
  3467. }
  3468. if fieldNum <= 0 {
  3469. return fmt.Errorf("proto: FileDownloadProgressUpdate: illegal tag %d (wire type %d)", fieldNum, wire)
  3470. }
  3471. switch fieldNum {
  3472. case 1:
  3473. if wireType != 0 {
  3474. return fmt.Errorf("proto: wrong wireType = %d for field UpdateType", wireType)
  3475. }
  3476. m.UpdateType = 0
  3477. for shift := uint(0); ; shift += 7 {
  3478. if shift >= 64 {
  3479. return ErrIntOverflowBep
  3480. }
  3481. if iNdEx >= l {
  3482. return io.ErrUnexpectedEOF
  3483. }
  3484. b := data[iNdEx]
  3485. iNdEx++
  3486. m.UpdateType |= (FileDownloadProgressUpdateType(b) & 0x7F) << shift
  3487. if b < 0x80 {
  3488. break
  3489. }
  3490. }
  3491. case 2:
  3492. if wireType != 2 {
  3493. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  3494. }
  3495. var stringLen uint64
  3496. for shift := uint(0); ; shift += 7 {
  3497. if shift >= 64 {
  3498. return ErrIntOverflowBep
  3499. }
  3500. if iNdEx >= l {
  3501. return io.ErrUnexpectedEOF
  3502. }
  3503. b := data[iNdEx]
  3504. iNdEx++
  3505. stringLen |= (uint64(b) & 0x7F) << shift
  3506. if b < 0x80 {
  3507. break
  3508. }
  3509. }
  3510. intStringLen := int(stringLen)
  3511. if intStringLen < 0 {
  3512. return ErrInvalidLengthBep
  3513. }
  3514. postIndex := iNdEx + intStringLen
  3515. if postIndex > l {
  3516. return io.ErrUnexpectedEOF
  3517. }
  3518. m.Name = string(data[iNdEx:postIndex])
  3519. iNdEx = postIndex
  3520. case 3:
  3521. if wireType != 2 {
  3522. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  3523. }
  3524. var msglen int
  3525. for shift := uint(0); ; shift += 7 {
  3526. if shift >= 64 {
  3527. return ErrIntOverflowBep
  3528. }
  3529. if iNdEx >= l {
  3530. return io.ErrUnexpectedEOF
  3531. }
  3532. b := data[iNdEx]
  3533. iNdEx++
  3534. msglen |= (int(b) & 0x7F) << shift
  3535. if b < 0x80 {
  3536. break
  3537. }
  3538. }
  3539. if msglen < 0 {
  3540. return ErrInvalidLengthBep
  3541. }
  3542. postIndex := iNdEx + msglen
  3543. if postIndex > l {
  3544. return io.ErrUnexpectedEOF
  3545. }
  3546. if err := m.Version.Unmarshal(data[iNdEx:postIndex]); err != nil {
  3547. return err
  3548. }
  3549. iNdEx = postIndex
  3550. case 4:
  3551. if wireType != 0 {
  3552. return fmt.Errorf("proto: wrong wireType = %d for field BlockIndexes", wireType)
  3553. }
  3554. var v int32
  3555. for shift := uint(0); ; shift += 7 {
  3556. if shift >= 64 {
  3557. return ErrIntOverflowBep
  3558. }
  3559. if iNdEx >= l {
  3560. return io.ErrUnexpectedEOF
  3561. }
  3562. b := data[iNdEx]
  3563. iNdEx++
  3564. v |= (int32(b) & 0x7F) << shift
  3565. if b < 0x80 {
  3566. break
  3567. }
  3568. }
  3569. m.BlockIndexes = append(m.BlockIndexes, v)
  3570. default:
  3571. iNdEx = preIndex
  3572. skippy, err := skipBep(data[iNdEx:])
  3573. if err != nil {
  3574. return err
  3575. }
  3576. if skippy < 0 {
  3577. return ErrInvalidLengthBep
  3578. }
  3579. if (iNdEx + skippy) > l {
  3580. return io.ErrUnexpectedEOF
  3581. }
  3582. iNdEx += skippy
  3583. }
  3584. }
  3585. if iNdEx > l {
  3586. return io.ErrUnexpectedEOF
  3587. }
  3588. return nil
  3589. }
  3590. func (m *Ping) Unmarshal(data []byte) error {
  3591. l := len(data)
  3592. iNdEx := 0
  3593. for iNdEx < l {
  3594. preIndex := iNdEx
  3595. var wire uint64
  3596. for shift := uint(0); ; shift += 7 {
  3597. if shift >= 64 {
  3598. return ErrIntOverflowBep
  3599. }
  3600. if iNdEx >= l {
  3601. return io.ErrUnexpectedEOF
  3602. }
  3603. b := data[iNdEx]
  3604. iNdEx++
  3605. wire |= (uint64(b) & 0x7F) << shift
  3606. if b < 0x80 {
  3607. break
  3608. }
  3609. }
  3610. fieldNum := int32(wire >> 3)
  3611. wireType := int(wire & 0x7)
  3612. if wireType == 4 {
  3613. return fmt.Errorf("proto: Ping: wiretype end group for non-group")
  3614. }
  3615. if fieldNum <= 0 {
  3616. return fmt.Errorf("proto: Ping: illegal tag %d (wire type %d)", fieldNum, wire)
  3617. }
  3618. switch fieldNum {
  3619. default:
  3620. iNdEx = preIndex
  3621. skippy, err := skipBep(data[iNdEx:])
  3622. if err != nil {
  3623. return err
  3624. }
  3625. if skippy < 0 {
  3626. return ErrInvalidLengthBep
  3627. }
  3628. if (iNdEx + skippy) > l {
  3629. return io.ErrUnexpectedEOF
  3630. }
  3631. iNdEx += skippy
  3632. }
  3633. }
  3634. if iNdEx > l {
  3635. return io.ErrUnexpectedEOF
  3636. }
  3637. return nil
  3638. }
  3639. func (m *Close) Unmarshal(data []byte) error {
  3640. l := len(data)
  3641. iNdEx := 0
  3642. for iNdEx < l {
  3643. preIndex := iNdEx
  3644. var wire uint64
  3645. for shift := uint(0); ; shift += 7 {
  3646. if shift >= 64 {
  3647. return ErrIntOverflowBep
  3648. }
  3649. if iNdEx >= l {
  3650. return io.ErrUnexpectedEOF
  3651. }
  3652. b := data[iNdEx]
  3653. iNdEx++
  3654. wire |= (uint64(b) & 0x7F) << shift
  3655. if b < 0x80 {
  3656. break
  3657. }
  3658. }
  3659. fieldNum := int32(wire >> 3)
  3660. wireType := int(wire & 0x7)
  3661. if wireType == 4 {
  3662. return fmt.Errorf("proto: Close: wiretype end group for non-group")
  3663. }
  3664. if fieldNum <= 0 {
  3665. return fmt.Errorf("proto: Close: illegal tag %d (wire type %d)", fieldNum, wire)
  3666. }
  3667. switch fieldNum {
  3668. case 1:
  3669. if wireType != 2 {
  3670. return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType)
  3671. }
  3672. var stringLen uint64
  3673. for shift := uint(0); ; shift += 7 {
  3674. if shift >= 64 {
  3675. return ErrIntOverflowBep
  3676. }
  3677. if iNdEx >= l {
  3678. return io.ErrUnexpectedEOF
  3679. }
  3680. b := data[iNdEx]
  3681. iNdEx++
  3682. stringLen |= (uint64(b) & 0x7F) << shift
  3683. if b < 0x80 {
  3684. break
  3685. }
  3686. }
  3687. intStringLen := int(stringLen)
  3688. if intStringLen < 0 {
  3689. return ErrInvalidLengthBep
  3690. }
  3691. postIndex := iNdEx + intStringLen
  3692. if postIndex > l {
  3693. return io.ErrUnexpectedEOF
  3694. }
  3695. m.Reason = string(data[iNdEx:postIndex])
  3696. iNdEx = postIndex
  3697. default:
  3698. iNdEx = preIndex
  3699. skippy, err := skipBep(data[iNdEx:])
  3700. if err != nil {
  3701. return err
  3702. }
  3703. if skippy < 0 {
  3704. return ErrInvalidLengthBep
  3705. }
  3706. if (iNdEx + skippy) > l {
  3707. return io.ErrUnexpectedEOF
  3708. }
  3709. iNdEx += skippy
  3710. }
  3711. }
  3712. if iNdEx > l {
  3713. return io.ErrUnexpectedEOF
  3714. }
  3715. return nil
  3716. }
  3717. func skipBep(data []byte) (n int, err error) {
  3718. l := len(data)
  3719. iNdEx := 0
  3720. for iNdEx < l {
  3721. var wire uint64
  3722. for shift := uint(0); ; shift += 7 {
  3723. if shift >= 64 {
  3724. return 0, ErrIntOverflowBep
  3725. }
  3726. if iNdEx >= l {
  3727. return 0, io.ErrUnexpectedEOF
  3728. }
  3729. b := data[iNdEx]
  3730. iNdEx++
  3731. wire |= (uint64(b) & 0x7F) << shift
  3732. if b < 0x80 {
  3733. break
  3734. }
  3735. }
  3736. wireType := int(wire & 0x7)
  3737. switch wireType {
  3738. case 0:
  3739. for shift := uint(0); ; shift += 7 {
  3740. if shift >= 64 {
  3741. return 0, ErrIntOverflowBep
  3742. }
  3743. if iNdEx >= l {
  3744. return 0, io.ErrUnexpectedEOF
  3745. }
  3746. iNdEx++
  3747. if data[iNdEx-1] < 0x80 {
  3748. break
  3749. }
  3750. }
  3751. return iNdEx, nil
  3752. case 1:
  3753. iNdEx += 8
  3754. return iNdEx, nil
  3755. case 2:
  3756. var length int
  3757. for shift := uint(0); ; shift += 7 {
  3758. if shift >= 64 {
  3759. return 0, ErrIntOverflowBep
  3760. }
  3761. if iNdEx >= l {
  3762. return 0, io.ErrUnexpectedEOF
  3763. }
  3764. b := data[iNdEx]
  3765. iNdEx++
  3766. length |= (int(b) & 0x7F) << shift
  3767. if b < 0x80 {
  3768. break
  3769. }
  3770. }
  3771. iNdEx += length
  3772. if length < 0 {
  3773. return 0, ErrInvalidLengthBep
  3774. }
  3775. return iNdEx, nil
  3776. case 3:
  3777. for {
  3778. var innerWire uint64
  3779. var start int = iNdEx
  3780. for shift := uint(0); ; shift += 7 {
  3781. if shift >= 64 {
  3782. return 0, ErrIntOverflowBep
  3783. }
  3784. if iNdEx >= l {
  3785. return 0, io.ErrUnexpectedEOF
  3786. }
  3787. b := data[iNdEx]
  3788. iNdEx++
  3789. innerWire |= (uint64(b) & 0x7F) << shift
  3790. if b < 0x80 {
  3791. break
  3792. }
  3793. }
  3794. innerWireType := int(innerWire & 0x7)
  3795. if innerWireType == 4 {
  3796. break
  3797. }
  3798. next, err := skipBep(data[start:])
  3799. if err != nil {
  3800. return 0, err
  3801. }
  3802. iNdEx = start + next
  3803. }
  3804. return iNdEx, nil
  3805. case 4:
  3806. return iNdEx, nil
  3807. case 5:
  3808. iNdEx += 4
  3809. return iNdEx, nil
  3810. default:
  3811. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  3812. }
  3813. }
  3814. panic("unreachable")
  3815. }
  3816. var (
  3817. ErrInvalidLengthBep = fmt.Errorf("proto: negative length found during unmarshaling")
  3818. ErrIntOverflowBep = fmt.Errorf("proto: integer overflow")
  3819. )
  3820. var fileDescriptorBep = []byte{
  3821. // 1589 bytes of a gzipped FileDescriptorProto
  3822. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x6f, 0xdb, 0x46,
  3823. 0x16, 0xb7, 0x24, 0xea, 0xdf, 0x48, 0x76, 0xe4, 0x89, 0xe3, 0x68, 0x19, 0xc7, 0xf6, 0x32, 0x09,
  3824. 0xd6, 0x2b, 0x6c, 0x9c, 0xdd, 0x64, 0x77, 0x03, 0x14, 0x68, 0x01, 0x59, 0xa2, 0x1d, 0x21, 0x32,
  3825. 0xa5, 0x50, 0x92, 0xd3, 0xf4, 0x50, 0x41, 0x12, 0x47, 0x32, 0x11, 0x8a, 0xa3, 0x92, 0x54, 0x12,
  3826. 0xf7, 0x23, 0xb4, 0x5f, 0xa0, 0x97, 0x02, 0x41, 0x6e, 0xbd, 0xf7, 0x43, 0xe4, 0x18, 0xe4, 0xd8,
  3827. 0x43, 0xd0, 0xba, 0x97, 0x7e, 0x81, 0xde, 0xfb, 0xf8, 0x86, 0x94, 0x28, 0xff, 0x29, 0x72, 0xe8,
  3828. 0xc1, 0xd0, 0xcc, 0x7b, 0xbf, 0x99, 0x37, 0xf3, 0x7b, 0xbf, 0xf7, 0x86, 0x26, 0xd9, 0x3e, 0x9b,
  3829. 0xec, 0x4e, 0x1c, 0xee, 0x71, 0x9a, 0xc1, 0x9f, 0x01, 0xb7, 0xe4, 0xbb, 0x23, 0xd3, 0x3b, 0x9e,
  3830. 0xf6, 0x77, 0x07, 0x7c, 0x7c, 0x6f, 0xc4, 0x47, 0xfc, 0x1e, 0x7a, 0xfa, 0xd3, 0x21, 0xce, 0x70,
  3831. 0x82, 0x23, 0xb1, 0x50, 0x99, 0x90, 0xe4, 0x23, 0x66, 0x59, 0x9c, 0x6e, 0x91, 0x9c, 0xc1, 0x5e,
  3832. 0x98, 0x03, 0xd6, 0xb5, 0x7b, 0x63, 0x56, 0x8c, 0x6d, 0xc7, 0x76, 0xb2, 0x3a, 0x11, 0x26, 0x0d,
  3833. 0x2c, 0x3e, 0x60, 0x60, 0x99, 0xcc, 0xf6, 0x04, 0x20, 0x2e, 0x00, 0xc2, 0x84, 0x80, 0x3b, 0x64,
  3834. 0x25, 0x00, 0xbc, 0x60, 0x8e, 0x6b, 0x72, 0xbb, 0x98, 0x40, 0xcc, 0xb2, 0xb0, 0x1e, 0x09, 0xa3,
  3835. 0xe2, 0x92, 0xd4, 0x23, 0xd6, 0x33, 0x98, 0x43, 0xff, 0x49, 0x24, 0xef, 0x64, 0x22, 0x62, 0xad,
  3836. 0xdc, 0xbf, 0xb6, 0x1b, 0xde, 0x61, 0xf7, 0x90, 0xb9, 0x6e, 0x6f, 0xc4, 0xda, 0xe0, 0xd4, 0x11,
  3837. 0x42, 0x3f, 0x83, 0xe0, 0x7c, 0x3c, 0x71, 0xc0, 0xe1, 0x6f, 0x1c, 0xc7, 0x15, 0x1b, 0xe7, 0x56,
  3838. 0x54, 0xe6, 0x18, 0x3d, 0xba, 0x40, 0x29, 0x93, 0xe5, 0x8a, 0x35, 0x75, 0x3d, 0xe6, 0x54, 0xb8,
  3839. 0x3d, 0x34, 0x47, 0xf4, 0xdf, 0x24, 0x3d, 0xe4, 0x16, 0x9c, 0xc2, 0x85, 0xf0, 0x89, 0x9d, 0xdc,
  3840. 0xfd, 0xc2, 0x7c, 0xb3, 0x7d, 0x74, 0xec, 0x49, 0x6f, 0x3f, 0x6c, 0x2d, 0xe9, 0x21, 0x4c, 0xf9,
  3841. 0x36, 0x4e, 0x52, 0xc2, 0x43, 0xd7, 0x49, 0xdc, 0x34, 0x04, 0x45, 0x7b, 0xa9, 0xd3, 0x0f, 0x5b,
  3842. 0xf1, 0x5a, 0x55, 0x07, 0x0b, 0x5d, 0x23, 0x49, 0xab, 0xd7, 0x67, 0x56, 0x40, 0x8e, 0x98, 0xd0,
  3843. 0x1b, 0x24, 0xeb, 0xc0, 0x85, 0xbb, 0xdc, 0xb6, 0x4e, 0x90, 0x92, 0x8c, 0x9e, 0xf1, 0x0d, 0x0d,
  3844. 0x98, 0xd3, 0xbb, 0x84, 0x9a, 0x23, 0x9b, 0x3b, 0xac, 0x3b, 0x61, 0xce, 0xd8, 0xc4, 0xd3, 0xba,
  3845. 0x45, 0x09, 0x51, 0xab, 0xc2, 0xd3, 0x9c, 0x3b, 0xe8, 0x2d, 0xb2, 0x1c, 0xc0, 0x0d, 0x66, 0x31,
  3846. 0x8f, 0x15, 0x93, 0x88, 0xcc, 0x0b, 0x63, 0x15, 0x6d, 0x70, 0xb7, 0x35, 0xc3, 0x74, 0x7b, 0x7d,
  3847. 0x8b, 0x75, 0x3d, 0x36, 0x9e, 0x74, 0x4d, 0xdb, 0x60, 0xaf, 0x98, 0x5b, 0x4c, 0x21, 0x96, 0x06,
  3848. 0xbe, 0x36, 0xb8, 0x6a, 0xc2, 0xe3, 0xb3, 0x21, 0x32, 0xed, 0x16, 0x0b, 0x67, 0xd9, 0xa8, 0xa2,
  3849. 0x23, 0x64, 0x23, 0x80, 0x29, 0x6f, 0x80, 0x0d, 0xe1, 0x89, 0xb0, 0x91, 0x5f, 0x60, 0x83, 0x12,
  3850. 0x29, 0xa2, 0x14, 0x1c, 0xd3, 0x0d, 0x92, 0xed, 0x19, 0x86, 0x9f, 0x15, 0x08, 0x95, 0x80, 0x50,
  3851. 0x59, 0x7d, 0x6e, 0xa0, 0x0f, 0x17, 0xb3, 0x2c, 0x9d, 0xd5, 0xc5, 0x65, 0xe9, 0xf5, 0x29, 0x1e,
  3852. 0x30, 0x27, 0x50, 0x66, 0x12, 0xe3, 0x65, 0x7c, 0x03, 0xea, 0xf2, 0xef, 0x24, 0x3f, 0xee, 0xbd,
  3853. 0xea, 0xba, 0xec, 0xab, 0x29, 0xb3, 0x07, 0x0c, 0x69, 0x48, 0xe8, 0x39, 0xb0, 0xb5, 0x02, 0x13,
  3854. 0xdd, 0x24, 0xc4, 0xb4, 0x3d, 0x87, 0x1b, 0x53, 0x58, 0x55, 0x4c, 0x23, 0x4f, 0x11, 0x0b, 0xfd,
  3855. 0x1f, 0xc9, 0x20, 0x89, 0x5d, 0xb8, 0x68, 0x06, 0xbc, 0xd2, 0x9e, 0xec, 0xd3, 0xf1, 0xd3, 0x87,
  3856. 0xad, 0x34, 0x52, 0x58, 0xab, 0x9e, 0xce, 0x87, 0x7a, 0x1a, 0xb1, 0x35, 0x43, 0x69, 0x90, 0x24,
  3857. 0xda, 0x80, 0xa2, 0x94, 0x90, 0x51, 0x50, 0x57, 0xc1, 0x8c, 0xee, 0x92, 0xe4, 0xd0, 0xb4, 0x80,
  3858. 0x8a, 0x38, 0xb2, 0x4e, 0x23, 0x1a, 0x04, 0x73, 0xcd, 0x1e, 0xf2, 0x80, 0x77, 0x01, 0x53, 0x3a,
  3859. 0x24, 0x87, 0x1b, 0x76, 0x26, 0x46, 0xcf, 0x63, 0x7f, 0xd9, 0xb6, 0x6f, 0x12, 0x24, 0x13, 0x7a,
  3860. 0x66, 0x69, 0x8b, 0x45, 0xd2, 0x56, 0x0a, 0x2a, 0x55, 0xd4, 0xdd, 0xfa, 0xf9, 0xfd, 0x22, 0xa5,
  3861. 0x0a, 0xeb, 0x5d, 0xf3, 0x6b, 0x86, 0x4a, 0x4f, 0xe8, 0x38, 0xa6, 0xdb, 0x24, 0x77, 0x56, 0xde,
  3862. 0xcb, 0x7a, 0xd4, 0x44, 0x6f, 0x12, 0x32, 0xe6, 0x86, 0x39, 0x34, 0x99, 0xd1, 0x75, 0x31, 0x85,
  3863. 0x09, 0x3d, 0x1b, 0x5a, 0x5a, 0xb4, 0xe8, 0x0b, 0xd4, 0x17, 0xb7, 0x11, 0xa8, 0x38, 0x9c, 0xfa,
  3864. 0x1e, 0xd3, 0x7e, 0xd1, 0xb3, 0x20, 0x33, 0x22, 0x6f, 0xe1, 0xd4, 0xef, 0x47, 0x36, 0x5f, 0x28,
  3865. 0xab, 0x0c, 0x02, 0x96, 0x6d, 0x1e, 0x2d, 0x29, 0xd0, 0x7e, 0xd8, 0xaf, 0xb2, 0xe0, 0x5f, 0xd0,
  3866. 0xfe, 0x11, 0x1b, 0x78, 0x7c, 0xd6, 0x09, 0x02, 0x18, 0x95, 0x49, 0x66, 0x26, 0x26, 0x82, 0x27,
  3867. 0x9d, 0xcd, 0xfd, 0x2e, 0x39, 0xbb, 0x07, 0x44, 0xcc, 0x81, 0x3b, 0xa9, 0xcf, 0xae, 0xa6, 0xb9,
  3868. 0xf4, 0x3f, 0x24, 0xb5, 0x67, 0xf1, 0xc1, 0xf3, 0xb0, 0xd2, 0xae, 0xce, 0xa3, 0xa1, 0x3d, 0x92,
  3869. 0x9d, 0x54, 0x1f, 0x81, 0x9f, 0x48, 0xdf, 0xbd, 0xde, 0x5a, 0x52, 0x9e, 0x90, 0xec, 0x0c, 0xe0,
  3870. 0x67, 0x9e, 0x0f, 0x87, 0x2e, 0xf3, 0x30, 0x4d, 0x09, 0x3d, 0x98, 0xcd, 0xc8, 0x8f, 0x63, 0x5c,
  3871. 0x41, 0x3e, 0xd8, 0x8e, 0x7b, 0xee, 0x31, 0x26, 0x24, 0xaf, 0xe3, 0x38, 0xd8, 0xf2, 0x53, 0x92,
  3872. 0x12, 0x37, 0xa4, 0x0f, 0x48, 0x66, 0xc0, 0xa7, 0xb6, 0x37, 0xef, 0x87, 0xab, 0xd1, 0xb2, 0x43,
  3873. 0x4f, 0x70, 0xaa, 0x19, 0x50, 0xd9, 0x27, 0xe9, 0xc0, 0x05, 0x5c, 0x87, 0x3d, 0x40, 0xda, 0xbb,
  3874. 0x16, 0x96, 0x46, 0xeb, 0x98, 0x3b, 0x1e, 0x96, 0x46, 0xa4, 0x41, 0x42, 0x6e, 0xa6, 0xe2, 0x7c,
  3875. 0x92, 0x2e, 0x26, 0xca, 0x8f, 0x31, 0x92, 0xd6, 0x7d, 0x02, 0x5d, 0x2f, 0xd2, 0x4c, 0x92, 0x0b,
  3876. 0xcd, 0x64, 0x2e, 0xf5, 0xf8, 0x82, 0xd4, 0x43, 0xb5, 0x26, 0x22, 0x6a, 0x9d, 0x93, 0x23, 0x5d,
  3877. 0x48, 0x4e, 0xf2, 0x02, 0x72, 0x52, 0x73, 0x72, 0x7c, 0xe1, 0x0c, 0x1d, 0x3e, 0xc6, 0xe6, 0xc9,
  3878. 0x9d, 0x9e, 0x73, 0x12, 0x28, 0x6b, 0xd9, 0xb7, 0xb6, 0x43, 0xa3, 0xd2, 0x25, 0x19, 0x9d, 0xb9,
  3879. 0x13, 0xd0, 0x10, 0xbb, 0xf4, 0xd8, 0xb0, 0x3d, 0x54, 0x6a, 0x0f, 0x0f, 0x0d, 0xdb, 0xfb, 0x63,
  3880. 0xfa, 0x0f, 0x22, 0x0d, 0xb8, 0x21, 0x8e, 0xbc, 0x12, 0xcd, 0xbf, 0xea, 0x38, 0x1c, 0xde, 0x27,
  3881. 0x03, 0x2a, 0xc9, 0x07, 0xc0, 0xdb, 0x5c, 0xa8, 0xf2, 0x97, 0xb6, 0xc5, 0x7b, 0x46, 0xd3, 0xe1,
  3882. 0x23, 0xbf, 0xd9, 0x5d, 0x5a, 0xf2, 0x55, 0x92, 0x9e, 0x62, 0x53, 0x08, 0x8b, 0xfe, 0xf6, 0x62,
  3883. 0x91, 0x9e, 0xdd, 0x48, 0x74, 0x90, 0x50, 0xd9, 0xc1, 0x52, 0xe5, 0x7d, 0x8c, 0xc8, 0x97, 0xa3,
  3884. 0x69, 0x8d, 0xe4, 0x04, 0xb2, 0x1b, 0x79, 0xb7, 0x77, 0x3e, 0x26, 0x10, 0xf6, 0x07, 0x32, 0x9d,
  3885. 0x8d, 0x2f, 0x7c, 0x1c, 0x22, 0x95, 0x98, 0xf8, 0xb8, 0x4a, 0x84, 0xe7, 0x10, 0x6b, 0x64, 0xf6,
  3886. 0xc4, 0x49, 0x70, 0xf7, 0xa4, 0x9e, 0xef, 0x8b, 0x42, 0x41, 0x9b, 0x92, 0x22, 0x52, 0xd3, 0xb4,
  3887. 0x47, 0xca, 0x16, 0x49, 0x56, 0x2c, 0x8e, 0xc9, 0x4a, 0xc1, 0xfb, 0xeb, 0x42, 0x98, 0x80, 0x43,
  3888. 0x31, 0x2b, 0xbd, 0x8f, 0x93, 0x5c, 0xe4, 0xd3, 0x03, 0xce, 0xb3, 0x52, 0xa9, 0x77, 0x5a, 0x6d,
  3889. 0x55, 0xef, 0x56, 0x1a, 0xda, 0x7e, 0xed, 0xa0, 0xb0, 0x24, 0x6f, 0x7c, 0xf3, 0xfd, 0x76, 0x71,
  3890. 0x3c, 0x07, 0x2d, 0x7e, 0x55, 0x40, 0x88, 0x9a, 0x56, 0x55, 0x3f, 0x2f, 0xc4, 0xe4, 0x35, 0x00,
  3891. 0x16, 0x22, 0x40, 0xf1, 0x10, 0xfc, 0x8b, 0xe4, 0x11, 0xd0, 0xed, 0x34, 0xab, 0xe5, 0xb6, 0x5a,
  3892. 0x88, 0xcb, 0x32, 0xe0, 0xd6, 0xcf, 0xe2, 0x02, 0xbe, 0x6f, 0x41, 0x5d, 0xa8, 0x4f, 0x3a, 0x6a,
  3893. 0xab, 0x5d, 0x48, 0xc8, 0xeb, 0x00, 0xa4, 0x11, 0x60, 0x58, 0x31, 0x77, 0x40, 0x86, 0x6a, 0xab,
  3894. 0xd9, 0xd0, 0x5a, 0x6a, 0x41, 0x92, 0xaf, 0x03, 0xea, 0xea, 0x02, 0x2a, 0x50, 0xe8, 0xff, 0xc9,
  3895. 0x6a, 0xb5, 0xf1, 0x54, 0xab, 0x37, 0xca, 0xd5, 0x6e, 0x53, 0x6f, 0x1c, 0xc0, 0x9a, 0x56, 0x21,
  3896. 0x29, 0x6f, 0x01, 0xfe, 0x46, 0x04, 0x7f, 0x4e, 0x70, 0x37, 0x81, 0xbd, 0x9a, 0x76, 0x50, 0x48,
  3897. 0xc9, 0x57, 0x01, 0x7a, 0x25, 0x02, 0xf5, 0x49, 0xf5, 0x6f, 0x5c, 0xa9, 0x37, 0x20, 0x74, 0xfa,
  3898. 0xdc, 0x8d, 0x91, 0xec, 0xd2, 0x97, 0x84, 0x9e, 0xff, 0x38, 0xa3, 0xb7, 0x89, 0xa4, 0x35, 0x34,
  3899. 0x15, 0x08, 0xc5, 0xfb, 0x9f, 0x47, 0x68, 0xdc, 0x66, 0x54, 0x21, 0x89, 0xfa, 0x17, 0xff, 0x05,
  3900. 0x32, 0xff, 0x06, 0xa0, 0x6b, 0xe7, 0x41, 0xe0, 0x2c, 0x71, 0x92, 0x8b, 0x6e, 0xac, 0x90, 0xcc,
  3901. 0xa1, 0xda, 0x2e, 0x03, 0xb9, 0x65, 0xd8, 0x1c, 0x8f, 0x14, 0xba, 0x0f, 0x99, 0xd7, 0xc3, 0x02,
  3902. 0xdc, 0x20, 0x49, 0x4d, 0x3d, 0x52, 0x75, 0xd8, 0x78, 0x15, 0x00, 0xcb, 0x21, 0x40, 0x63, 0xa0,
  3903. 0x2b, 0xf8, 0x16, 0x48, 0x95, 0xeb, 0x4f, 0xcb, 0xcf, 0x5a, 0x90, 0x1c, 0x0a, 0xee, 0x95, 0xd0,
  3904. 0x5d, 0xb6, 0x5e, 0xf6, 0x4e, 0xdc, 0xd2, 0xef, 0x31, 0x92, 0x8f, 0x3e, 0x7b, 0xb0, 0x40, 0xda,
  3905. 0xaf, 0xd5, 0xd5, 0x30, 0x5c, 0xd4, 0xe7, 0x8f, 0xe9, 0x0e, 0xc9, 0x56, 0x6b, 0xba, 0x5a, 0x69,
  3906. 0x37, 0xf4, 0x67, 0xe1, 0x5d, 0xa2, 0xa0, 0xaa, 0xe9, 0xa0, 0xb8, 0xfd, 0x8f, 0xc1, 0x7c, 0xeb,
  3907. 0xd9, 0x61, 0xbd, 0xa6, 0x3d, 0xee, 0xe2, 0x8e, 0x71, 0xf9, 0x06, 0x80, 0xaf, 0x47, 0xc1, 0xad,
  3908. 0x93, 0xb1, 0x65, 0xda, 0xcf, 0x71, 0xe3, 0x87, 0x64, 0x35, 0x84, 0xcf, 0x03, 0x24, 0xe4, 0x6d,
  3909. 0x58, 0xb3, 0x71, 0xc1, 0x9a, 0x79, 0x9c, 0x07, 0xe4, 0x4a, 0xb8, 0xb0, 0xa3, 0x3d, 0xd6, 0x40,
  3910. 0x16, 0xa0, 0x9c, 0x4d, 0x58, 0x26, 0x5f, 0xb0, 0xac, 0x63, 0x3f, 0xb7, 0x41, 0x14, 0xa5, 0x1f,
  3911. 0x62, 0x24, 0x3b, 0xeb, 0x50, 0x3e, 0xcf, 0x5a, 0xa3, 0xab, 0xea, 0x7a, 0x43, 0x0f, 0x2f, 0x3e,
  3912. 0x73, 0x6a, 0x1c, 0x87, 0xf0, 0xe1, 0x95, 0x3e, 0x50, 0x35, 0x55, 0xaf, 0x55, 0xc2, 0x7a, 0x98,
  3913. 0x41, 0x0e, 0x98, 0xcd, 0x1c, 0x73, 0x00, 0xff, 0x02, 0xe4, 0x61, 0x9b, 0x56, 0xa7, 0xf2, 0x28,
  3914. 0xbc, 0x31, 0x0a, 0x38, 0xb2, 0x55, 0x6b, 0x3a, 0x38, 0xc6, 0xdb, 0x96, 0xfc, 0xd2, 0x39, 0x2a,
  3915. 0xd7, 0x6b, 0x55, 0x01, 0x4d, 0xc8, 0x45, 0x80, 0xae, 0xcd, 0xa0, 0x35, 0xf1, 0xec, 0xfb, 0xd8,
  3916. 0x92, 0x41, 0x36, 0xff, 0xbc, 0x17, 0xc1, 0x17, 0x49, 0xaa, 0xdc, 0x6c, 0xaa, 0x5a, 0x35, 0x3c,
  3917. 0xfd, 0xdc, 0x57, 0x9e, 0x4c, 0x98, 0x6d, 0xf8, 0x88, 0xfd, 0x86, 0x7e, 0xa0, 0xb6, 0xc3, 0xc3,
  3918. 0xcf, 0x11, 0xfb, 0xdc, 0x19, 0x31, 0x6f, 0x6f, 0xe3, 0xed, 0x2f, 0x9b, 0x4b, 0xef, 0xe0, 0xef,
  3919. 0xed, 0xe9, 0x66, 0xec, 0x1d, 0xfc, 0xfd, 0x7c, 0xba, 0xb9, 0xf4, 0x1b, 0xfc, 0xbe, 0xfe, 0x75,
  3920. 0x33, 0xd6, 0x4f, 0x61, 0xef, 0x7a, 0xf0, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0x83, 0x88, 0xa1,
  3921. 0x6a, 0xa6, 0x0d, 0x00, 0x00,
  3922. }