objects.pb.go 217 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: github.com/docker/swarmkit/api/objects.proto
  3. package api
  4. import proto "github.com/gogo/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import google_protobuf "github.com/gogo/protobuf/types"
  8. import _ "github.com/gogo/protobuf/gogoproto"
  9. import google_protobuf4 "github.com/gogo/protobuf/types"
  10. import _ "github.com/docker/swarmkit/protobuf/plugin"
  11. import deepcopy "github.com/docker/swarmkit/api/deepcopy"
  12. import go_events "github.com/docker/go-events"
  13. import strings "strings"
  14. import reflect "reflect"
  15. import sortkeys "github.com/gogo/protobuf/sortkeys"
  16. import io "io"
  17. // Reference imports to suppress errors if they are not otherwise used.
  18. var _ = proto.Marshal
  19. var _ = fmt.Errorf
  20. var _ = math.Inf
  21. // Meta contains metadata about objects. Every object contains a meta field.
  22. type Meta struct {
  23. // Version tracks the current version of the object.
  24. Version Version `protobuf:"bytes,1,opt,name=version" json:"version"`
  25. // Object timestamps.
  26. // Note: can't use stdtime because these fields are nullable.
  27. CreatedAt *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt" json:"created_at,omitempty"`
  28. UpdatedAt *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt" json:"updated_at,omitempty"`
  29. }
  30. func (m *Meta) Reset() { *m = Meta{} }
  31. func (*Meta) ProtoMessage() {}
  32. func (*Meta) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{0} }
  33. // Node provides the internal node state as seen by the cluster.
  34. type Node struct {
  35. // ID specifies the identity of the node.
  36. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  37. Meta Meta `protobuf:"bytes,2,opt,name=meta" json:"meta"`
  38. // Spec defines the desired state of the node as specified by the user.
  39. // The system will honor this and will *never* modify it.
  40. Spec NodeSpec `protobuf:"bytes,3,opt,name=spec" json:"spec"`
  41. // Description encapsulated the properties of the Node as reported by the
  42. // agent.
  43. Description *NodeDescription `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"`
  44. // Status provides the current status of the node, as seen by the manager.
  45. Status NodeStatus `protobuf:"bytes,5,opt,name=status" json:"status"`
  46. // ManagerStatus provides the current status of the node's manager
  47. // component, if the node is a manager.
  48. ManagerStatus *ManagerStatus `protobuf:"bytes,6,opt,name=manager_status,json=managerStatus" json:"manager_status,omitempty"`
  49. // DEPRECATED: Use Attachments to find the ingress network
  50. // The node attachment to the ingress network.
  51. Attachment *NetworkAttachment `protobuf:"bytes,7,opt,name=attachment" json:"attachment,omitempty"`
  52. // Certificate is the TLS certificate issued for the node, if any.
  53. Certificate Certificate `protobuf:"bytes,8,opt,name=certificate" json:"certificate"`
  54. // Role is the *observed* role for this node. It differs from the
  55. // desired role set in Node.Spec.Role because the role here is only
  56. // updated after the Raft member list has been reconciled with the
  57. // desired role from the spec.
  58. //
  59. // This field represents the current reconciled state. If an action is
  60. // to be performed, first verify the role in the cert. This field only
  61. // shows the privilege level that the CA would currently grant when
  62. // issuing or renewing the node's certificate.
  63. Role NodeRole `protobuf:"varint,9,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole" json:"role,omitempty"`
  64. // Attachments enumerates the network attachments for the node to set up an
  65. // endpoint on the node to be used for load balancing. Each overlay
  66. // network, including ingress network, will have an NetworkAttachment.
  67. Attachments []*NetworkAttachment `protobuf:"bytes,10,rep,name=attachments" json:"attachments,omitempty"`
  68. // VXLANUDPPort specifies the UDP port for VXLAN traffic.
  69. // This information is passed from cluster object to individual nodes.
  70. VXLANUDPPort uint32 `protobuf:"varint,11,opt,name=VXLANUDPPort,proto3" json:"VXLANUDPPort,omitempty"`
  71. }
  72. func (m *Node) Reset() { *m = Node{} }
  73. func (*Node) ProtoMessage() {}
  74. func (*Node) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{1} }
  75. type Service struct {
  76. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  77. Meta Meta `protobuf:"bytes,2,opt,name=meta" json:"meta"`
  78. Spec ServiceSpec `protobuf:"bytes,3,opt,name=spec" json:"spec"`
  79. // SpecVersion versions Spec, to identify changes in the spec. Note that
  80. // this is not directly comparable to the service's Version.
  81. SpecVersion *Version `protobuf:"bytes,10,opt,name=spec_version,json=specVersion" json:"spec_version,omitempty"`
  82. // PreviousSpec is the previous service spec that was in place before
  83. // "Spec".
  84. PreviousSpec *ServiceSpec `protobuf:"bytes,6,opt,name=previous_spec,json=previousSpec" json:"previous_spec,omitempty"`
  85. // PreviousSpecVersion versions PreviousSpec. Note that this is not
  86. // directly comparable to the service's Version.
  87. PreviousSpecVersion *Version `protobuf:"bytes,11,opt,name=previous_spec_version,json=previousSpecVersion" json:"previous_spec_version,omitempty"`
  88. // Runtime state of service endpoint. This may be different
  89. // from the spec version because the user may not have entered
  90. // the optional fields like node_port or virtual_ip and it
  91. // could be auto allocated by the system.
  92. Endpoint *Endpoint `protobuf:"bytes,4,opt,name=endpoint" json:"endpoint,omitempty"`
  93. // UpdateStatus contains the status of an update, if one is in
  94. // progress.
  95. UpdateStatus *UpdateStatus `protobuf:"bytes,5,opt,name=update_status,json=updateStatus" json:"update_status,omitempty"`
  96. // PendingDelete indicates that this service's deletion has been requested.
  97. // Services, as well as all service-level resources, can only be deleted
  98. // after all of the service's containers have properly shut down.
  99. // When a user requests a deletion, we just flip this flag
  100. // the deallocator will take it from there - it will start monitoring
  101. // this service's tasks, and proceed to delete the service itself (and
  102. // potentially its associated resources also marked for deletion) when
  103. // all of its tasks are gone
  104. PendingDelete bool `protobuf:"varint,7,opt,name=pending_delete,json=pendingDelete,proto3" json:"pending_delete,omitempty"`
  105. }
  106. func (m *Service) Reset() { *m = Service{} }
  107. func (*Service) ProtoMessage() {}
  108. func (*Service) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{2} }
  109. // Endpoint specified all the network parameters required to
  110. // correctly discover and load balance a service
  111. type Endpoint struct {
  112. Spec *EndpointSpec `protobuf:"bytes,1,opt,name=spec" json:"spec,omitempty"`
  113. // Runtime state of the exposed ports which may carry
  114. // auto-allocated swarm ports in addition to the user
  115. // configured information.
  116. Ports []*PortConfig `protobuf:"bytes,2,rep,name=ports" json:"ports,omitempty"`
  117. // VirtualIPs specifies the IP addresses under which this endpoint will be
  118. // made available.
  119. VirtualIPs []*Endpoint_VirtualIP `protobuf:"bytes,3,rep,name=virtual_ips,json=virtualIps" json:"virtual_ips,omitempty"`
  120. }
  121. func (m *Endpoint) Reset() { *m = Endpoint{} }
  122. func (*Endpoint) ProtoMessage() {}
  123. func (*Endpoint) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{3} }
  124. // VirtualIP specifies a set of networks this endpoint will be attached to
  125. // and the IP addresses the target service will be made available under.
  126. type Endpoint_VirtualIP struct {
  127. // NetworkID for which this endpoint attachment was created.
  128. NetworkID string `protobuf:"bytes,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"`
  129. // A virtual IP is used to address this service in IP
  130. // layer that the client can use to send requests to
  131. // this service. A DNS A/AAAA query on the service
  132. // name might return this IP to the client. This is
  133. // strictly a logical IP and there may not be any
  134. // interfaces assigned this IP address or any route
  135. // created for this address. More than one to
  136. // accommodate for both IPv4 and IPv6
  137. Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
  138. }
  139. func (m *Endpoint_VirtualIP) Reset() { *m = Endpoint_VirtualIP{} }
  140. func (*Endpoint_VirtualIP) ProtoMessage() {}
  141. func (*Endpoint_VirtualIP) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{3, 0} }
  142. // Task specifies the parameters for implementing a Spec. A task is effectively
  143. // immutable and idempotent. Once it is dispatched to a node, it will not be
  144. // dispatched to another node.
  145. type Task struct {
  146. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  147. Meta Meta `protobuf:"bytes,2,opt,name=meta" json:"meta"`
  148. // Spec defines the desired state of the task as specified by the user.
  149. // The system will honor this and will *never* modify it.
  150. Spec TaskSpec `protobuf:"bytes,3,opt,name=spec" json:"spec"`
  151. // SpecVersion is copied from Service, to identify which version of the
  152. // spec this task has. Note that this is not directly comparable to the
  153. // service's Version.
  154. SpecVersion *Version `protobuf:"bytes,14,opt,name=spec_version,json=specVersion" json:"spec_version,omitempty"`
  155. // ServiceID indicates the service under which this task is orchestrated. This
  156. // should almost always be set.
  157. ServiceID string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
  158. // Slot is the service slot number for a task.
  159. // For example, if a replicated service has replicas = 2, there will be a
  160. // task with slot = 1, and another with slot = 2.
  161. Slot uint64 `protobuf:"varint,5,opt,name=slot,proto3" json:"slot,omitempty"`
  162. // NodeID indicates the node to which the task is assigned. If this field
  163. // is empty or not set, the task is unassigned.
  164. NodeID string `protobuf:"bytes,6,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
  165. // Annotations defines the names and labels for the runtime, as set by
  166. // the cluster manager.
  167. //
  168. // As backup, if this field has an empty name, the runtime will
  169. // allocate a unique name for the actual container.
  170. //
  171. // NOTE(stevvooe): The preserves the ability for us to making naming
  172. // decisions for tasks in orchestrator, albeit, this is left empty for now.
  173. Annotations Annotations `protobuf:"bytes,7,opt,name=annotations" json:"annotations"`
  174. // ServiceAnnotations is a direct copy of the service name and labels when
  175. // this task is created.
  176. //
  177. // Labels set here will *not* be propagated to the runtime target, such as a
  178. // container. Use labels on the runtime target for that purpose.
  179. ServiceAnnotations Annotations `protobuf:"bytes,8,opt,name=service_annotations,json=serviceAnnotations" json:"service_annotations"`
  180. Status TaskStatus `protobuf:"bytes,9,opt,name=status" json:"status"`
  181. // DesiredState is the target state for the task. It is set to
  182. // TaskStateRunning when a task is first created, and changed to
  183. // TaskStateShutdown if the manager wants to terminate the task. This field
  184. // is only written by the manager.
  185. DesiredState TaskState `protobuf:"varint,10,opt,name=desired_state,json=desiredState,proto3,enum=docker.swarmkit.v1.TaskState" json:"desired_state,omitempty"`
  186. // List of network attachments by the task.
  187. Networks []*NetworkAttachment `protobuf:"bytes,11,rep,name=networks" json:"networks,omitempty"`
  188. // A copy of runtime state of service endpoint from Service
  189. // object to be distributed to agents as part of the task.
  190. Endpoint *Endpoint `protobuf:"bytes,12,opt,name=endpoint" json:"endpoint,omitempty"`
  191. // LogDriver specifies the selected log driver to use for the task. Agent
  192. // processes should always favor the value in this field.
  193. //
  194. // If present in the TaskSpec, this will be a copy of that value. The
  195. // orchestrator may choose to insert a value here, which should be honored,
  196. // such a cluster default or policy-based value.
  197. //
  198. // If not present, the daemon's default will be used.
  199. LogDriver *Driver `protobuf:"bytes,13,opt,name=log_driver,json=logDriver" json:"log_driver,omitempty"`
  200. AssignedGenericResources []*GenericResource `protobuf:"bytes,15,rep,name=assigned_generic_resources,json=assignedGenericResources" json:"assigned_generic_resources,omitempty"`
  201. }
  202. func (m *Task) Reset() { *m = Task{} }
  203. func (*Task) ProtoMessage() {}
  204. func (*Task) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{4} }
  205. // NetworkAttachment specifies the network parameters of attachment to
  206. // a single network by an object such as task or node.
  207. type NetworkAttachment struct {
  208. // Network state as a whole becomes part of the object so that
  209. // it always is available for use in agents so that agents
  210. // don't have any other dependency during execution.
  211. Network *Network `protobuf:"bytes,1,opt,name=network" json:"network,omitempty"`
  212. // List of IPv4/IPv6 addresses that are assigned to the object
  213. // as part of getting attached to this network.
  214. Addresses []string `protobuf:"bytes,2,rep,name=addresses" json:"addresses,omitempty"`
  215. // List of aliases by which a task is resolved in a network
  216. Aliases []string `protobuf:"bytes,3,rep,name=aliases" json:"aliases,omitempty"`
  217. // Map of all the driver attachment options for this network
  218. DriverAttachmentOpts map[string]string `protobuf:"bytes,4,rep,name=driver_attachment_opts,json=driverAttachmentOpts" json:"driver_attachment_opts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
  219. }
  220. func (m *NetworkAttachment) Reset() { *m = NetworkAttachment{} }
  221. func (*NetworkAttachment) ProtoMessage() {}
  222. func (*NetworkAttachment) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{5} }
  223. type Network struct {
  224. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  225. Meta Meta `protobuf:"bytes,2,opt,name=meta" json:"meta"`
  226. Spec NetworkSpec `protobuf:"bytes,3,opt,name=spec" json:"spec"`
  227. // Driver specific operational state provided by the network driver.
  228. DriverState *Driver `protobuf:"bytes,4,opt,name=driver_state,json=driverState" json:"driver_state,omitempty"`
  229. // Runtime state of IPAM options. This may not reflect the
  230. // ipam options from NetworkSpec.
  231. IPAM *IPAMOptions `protobuf:"bytes,5,opt,name=ipam" json:"ipam,omitempty"`
  232. // PendingDelete indicates that this network's deletion has been requested.
  233. // Services, as well as all service-level resources, can only be deleted
  234. // after all the service's containers have properly shut down
  235. // when a user requests a deletion, we just flip this flag
  236. // the deallocator will take it from there
  237. // PendingDelete indicates that this network's deletion has been requested.
  238. // Services, as well as all service-level resources, can only be deleted
  239. // after all of the service's containers have properly shut down.
  240. // When a user requests a deletion of this network, we just flip this flag
  241. // the deallocator will take it from there - it will start monitoring
  242. // the services that still use this service, and proceed to delete
  243. // this network when all of these services are gone
  244. PendingDelete bool `protobuf:"varint,6,opt,name=pending_delete,json=pendingDelete,proto3" json:"pending_delete,omitempty"`
  245. }
  246. func (m *Network) Reset() { *m = Network{} }
  247. func (*Network) ProtoMessage() {}
  248. func (*Network) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{6} }
  249. // Cluster provides global cluster settings.
  250. type Cluster struct {
  251. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  252. Meta Meta `protobuf:"bytes,2,opt,name=meta" json:"meta"`
  253. Spec ClusterSpec `protobuf:"bytes,3,opt,name=spec" json:"spec"`
  254. // RootCA contains key material for the root CA.
  255. RootCA RootCA `protobuf:"bytes,4,opt,name=root_ca,json=rootCa" json:"root_ca"`
  256. // Symmetric encryption key distributed by the lead manager. Used by agents
  257. // for securing network bootstrapping and communication.
  258. NetworkBootstrapKeys []*EncryptionKey `protobuf:"bytes,5,rep,name=network_bootstrap_keys,json=networkBootstrapKeys" json:"network_bootstrap_keys,omitempty"`
  259. // Logical clock used to timestamp every key. It allows other managers
  260. // and agents to unambiguously identify the older key to be deleted when
  261. // a new key is allocated on key rotation.
  262. EncryptionKeyLamportClock uint64 `protobuf:"varint,6,opt,name=encryption_key_lamport_clock,json=encryptionKeyLamportClock,proto3" json:"encryption_key_lamport_clock,omitempty"`
  263. // BlacklistedCertificates tracks certificates that should no longer
  264. // be honored. It's a mapping from CN -> BlacklistedCertificate.
  265. // swarm. Their certificates should effectively be blacklisted.
  266. BlacklistedCertificates map[string]*BlacklistedCertificate `protobuf:"bytes,8,rep,name=blacklisted_certificates,json=blacklistedCertificates" json:"blacklisted_certificates,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"`
  267. // UnlockKeys defines the keys that lock node data at rest. For example,
  268. // this would contain the key encrypting key (KEK) that will encrypt the
  269. // manager TLS keys at rest and the raft encryption keys at rest.
  270. // If the key is empty, the node will be unlocked (will not require a key
  271. // to start up from a shut down state).
  272. UnlockKeys []*EncryptionKey `protobuf:"bytes,9,rep,name=unlock_keys,json=unlockKeys" json:"unlock_keys,omitempty"`
  273. // FIPS specifies whether this cluster should be in FIPS mode. This changes
  274. // the format of the join tokens, and nodes that are not FIPS-enabled should
  275. // reject joining the cluster. Nodes that report themselves to be non-FIPS
  276. // should be rejected from the cluster.
  277. FIPS bool `protobuf:"varint,10,opt,name=fips,proto3" json:"fips,omitempty"`
  278. // This field specifies default subnet pools for global scope networks. If
  279. // unspecified, Docker will use the predefined subnets as it works on older releases.
  280. // Format Example : {"20.20.0.0/16",""20.20.0.0/16"}
  281. DefaultAddressPool []string `protobuf:"bytes,11,rep,name=defaultAddressPool" json:"defaultAddressPool,omitempty"`
  282. // This flag specifies the default subnet size of global scope networks by giving
  283. // the length of the subnet masks for every such network
  284. SubnetSize uint32 `protobuf:"varint,12,opt,name=subnetSize,proto3" json:"subnetSize,omitempty"`
  285. // VXLANUDPPort specifies the UDP port for VXLAN traffic.
  286. VXLANUDPPort uint32 `protobuf:"varint,13,opt,name=VXLANUDPPort,proto3" json:"VXLANUDPPort,omitempty"`
  287. }
  288. func (m *Cluster) Reset() { *m = Cluster{} }
  289. func (*Cluster) ProtoMessage() {}
  290. func (*Cluster) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{7} }
  291. // Secret represents a secret that should be passed to a container or a node,
  292. // and is immutable.
  293. type Secret struct {
  294. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  295. Meta Meta `protobuf:"bytes,2,opt,name=meta" json:"meta"`
  296. // Spec contains the actual secret data, as well as any context around the
  297. // secret data that the user provides.
  298. Spec SecretSpec `protobuf:"bytes,3,opt,name=spec" json:"spec"`
  299. // Whether the secret is an internal secret (not set by a user) or not.
  300. Internal bool `protobuf:"varint,4,opt,name=internal,proto3" json:"internal,omitempty"`
  301. }
  302. func (m *Secret) Reset() { *m = Secret{} }
  303. func (*Secret) ProtoMessage() {}
  304. func (*Secret) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{8} }
  305. // Config represents a set of configuration files that should be passed to a
  306. // container.
  307. type Config struct {
  308. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  309. Meta Meta `protobuf:"bytes,2,opt,name=meta" json:"meta"`
  310. // Spec contains the actual config data, as well as any context around the
  311. // config data that the user provides.
  312. Spec ConfigSpec `protobuf:"bytes,3,opt,name=spec" json:"spec"`
  313. }
  314. func (m *Config) Reset() { *m = Config{} }
  315. func (*Config) ProtoMessage() {}
  316. func (*Config) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{9} }
  317. // Resource is a top-level object with externally defined content and indexing.
  318. // SwarmKit can serve as a store for these objects without understanding their
  319. // meanings.
  320. type Resource struct {
  321. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  322. Meta Meta `protobuf:"bytes,2,opt,name=meta" json:"meta"`
  323. Annotations Annotations `protobuf:"bytes,3,opt,name=annotations" json:"annotations"`
  324. // Kind identifies this class of object. It is essentially a namespace
  325. // to keep IDs or indices from colliding between unrelated Resource
  326. // objects. This must correspond to the name of an Extension.
  327. Kind string `protobuf:"bytes,4,opt,name=kind,proto3" json:"kind,omitempty"`
  328. // Payload bytes. This data is not interpreted in any way by SwarmKit.
  329. // By convention, it should be a marshalled protocol buffers message.
  330. Payload *google_protobuf4.Any `protobuf:"bytes,5,opt,name=payload" json:"payload,omitempty"`
  331. }
  332. func (m *Resource) Reset() { *m = Resource{} }
  333. func (*Resource) ProtoMessage() {}
  334. func (*Resource) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{10} }
  335. // Extension declares a type of "resource" object. This message provides some
  336. // metadata about the objects.
  337. type Extension struct {
  338. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  339. Meta Meta `protobuf:"bytes,2,opt,name=meta" json:"meta"`
  340. Annotations Annotations `protobuf:"bytes,3,opt,name=annotations" json:"annotations"`
  341. Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
  342. }
  343. func (m *Extension) Reset() { *m = Extension{} }
  344. func (*Extension) ProtoMessage() {}
  345. func (*Extension) Descriptor() ([]byte, []int) { return fileDescriptorObjects, []int{11} }
  346. func init() {
  347. proto.RegisterType((*Meta)(nil), "docker.swarmkit.v1.Meta")
  348. proto.RegisterType((*Node)(nil), "docker.swarmkit.v1.Node")
  349. proto.RegisterType((*Service)(nil), "docker.swarmkit.v1.Service")
  350. proto.RegisterType((*Endpoint)(nil), "docker.swarmkit.v1.Endpoint")
  351. proto.RegisterType((*Endpoint_VirtualIP)(nil), "docker.swarmkit.v1.Endpoint.VirtualIP")
  352. proto.RegisterType((*Task)(nil), "docker.swarmkit.v1.Task")
  353. proto.RegisterType((*NetworkAttachment)(nil), "docker.swarmkit.v1.NetworkAttachment")
  354. proto.RegisterType((*Network)(nil), "docker.swarmkit.v1.Network")
  355. proto.RegisterType((*Cluster)(nil), "docker.swarmkit.v1.Cluster")
  356. proto.RegisterType((*Secret)(nil), "docker.swarmkit.v1.Secret")
  357. proto.RegisterType((*Config)(nil), "docker.swarmkit.v1.Config")
  358. proto.RegisterType((*Resource)(nil), "docker.swarmkit.v1.Resource")
  359. proto.RegisterType((*Extension)(nil), "docker.swarmkit.v1.Extension")
  360. }
  361. func (m *Meta) Copy() *Meta {
  362. if m == nil {
  363. return nil
  364. }
  365. o := &Meta{}
  366. o.CopyFrom(m)
  367. return o
  368. }
  369. func (m *Meta) CopyFrom(src interface{}) {
  370. o := src.(*Meta)
  371. *m = *o
  372. deepcopy.Copy(&m.Version, &o.Version)
  373. if o.CreatedAt != nil {
  374. m.CreatedAt = &google_protobuf.Timestamp{}
  375. deepcopy.Copy(m.CreatedAt, o.CreatedAt)
  376. }
  377. if o.UpdatedAt != nil {
  378. m.UpdatedAt = &google_protobuf.Timestamp{}
  379. deepcopy.Copy(m.UpdatedAt, o.UpdatedAt)
  380. }
  381. }
  382. func (m *Node) Copy() *Node {
  383. if m == nil {
  384. return nil
  385. }
  386. o := &Node{}
  387. o.CopyFrom(m)
  388. return o
  389. }
  390. func (m *Node) CopyFrom(src interface{}) {
  391. o := src.(*Node)
  392. *m = *o
  393. deepcopy.Copy(&m.Meta, &o.Meta)
  394. deepcopy.Copy(&m.Spec, &o.Spec)
  395. if o.Description != nil {
  396. m.Description = &NodeDescription{}
  397. deepcopy.Copy(m.Description, o.Description)
  398. }
  399. deepcopy.Copy(&m.Status, &o.Status)
  400. if o.ManagerStatus != nil {
  401. m.ManagerStatus = &ManagerStatus{}
  402. deepcopy.Copy(m.ManagerStatus, o.ManagerStatus)
  403. }
  404. if o.Attachment != nil {
  405. m.Attachment = &NetworkAttachment{}
  406. deepcopy.Copy(m.Attachment, o.Attachment)
  407. }
  408. deepcopy.Copy(&m.Certificate, &o.Certificate)
  409. if o.Attachments != nil {
  410. m.Attachments = make([]*NetworkAttachment, len(o.Attachments))
  411. for i := range m.Attachments {
  412. m.Attachments[i] = &NetworkAttachment{}
  413. deepcopy.Copy(m.Attachments[i], o.Attachments[i])
  414. }
  415. }
  416. }
  417. func (m *Service) Copy() *Service {
  418. if m == nil {
  419. return nil
  420. }
  421. o := &Service{}
  422. o.CopyFrom(m)
  423. return o
  424. }
  425. func (m *Service) CopyFrom(src interface{}) {
  426. o := src.(*Service)
  427. *m = *o
  428. deepcopy.Copy(&m.Meta, &o.Meta)
  429. deepcopy.Copy(&m.Spec, &o.Spec)
  430. if o.SpecVersion != nil {
  431. m.SpecVersion = &Version{}
  432. deepcopy.Copy(m.SpecVersion, o.SpecVersion)
  433. }
  434. if o.PreviousSpec != nil {
  435. m.PreviousSpec = &ServiceSpec{}
  436. deepcopy.Copy(m.PreviousSpec, o.PreviousSpec)
  437. }
  438. if o.PreviousSpecVersion != nil {
  439. m.PreviousSpecVersion = &Version{}
  440. deepcopy.Copy(m.PreviousSpecVersion, o.PreviousSpecVersion)
  441. }
  442. if o.Endpoint != nil {
  443. m.Endpoint = &Endpoint{}
  444. deepcopy.Copy(m.Endpoint, o.Endpoint)
  445. }
  446. if o.UpdateStatus != nil {
  447. m.UpdateStatus = &UpdateStatus{}
  448. deepcopy.Copy(m.UpdateStatus, o.UpdateStatus)
  449. }
  450. }
  451. func (m *Endpoint) Copy() *Endpoint {
  452. if m == nil {
  453. return nil
  454. }
  455. o := &Endpoint{}
  456. o.CopyFrom(m)
  457. return o
  458. }
  459. func (m *Endpoint) CopyFrom(src interface{}) {
  460. o := src.(*Endpoint)
  461. *m = *o
  462. if o.Spec != nil {
  463. m.Spec = &EndpointSpec{}
  464. deepcopy.Copy(m.Spec, o.Spec)
  465. }
  466. if o.Ports != nil {
  467. m.Ports = make([]*PortConfig, len(o.Ports))
  468. for i := range m.Ports {
  469. m.Ports[i] = &PortConfig{}
  470. deepcopy.Copy(m.Ports[i], o.Ports[i])
  471. }
  472. }
  473. if o.VirtualIPs != nil {
  474. m.VirtualIPs = make([]*Endpoint_VirtualIP, len(o.VirtualIPs))
  475. for i := range m.VirtualIPs {
  476. m.VirtualIPs[i] = &Endpoint_VirtualIP{}
  477. deepcopy.Copy(m.VirtualIPs[i], o.VirtualIPs[i])
  478. }
  479. }
  480. }
  481. func (m *Endpoint_VirtualIP) Copy() *Endpoint_VirtualIP {
  482. if m == nil {
  483. return nil
  484. }
  485. o := &Endpoint_VirtualIP{}
  486. o.CopyFrom(m)
  487. return o
  488. }
  489. func (m *Endpoint_VirtualIP) CopyFrom(src interface{}) {
  490. o := src.(*Endpoint_VirtualIP)
  491. *m = *o
  492. }
  493. func (m *Task) Copy() *Task {
  494. if m == nil {
  495. return nil
  496. }
  497. o := &Task{}
  498. o.CopyFrom(m)
  499. return o
  500. }
  501. func (m *Task) CopyFrom(src interface{}) {
  502. o := src.(*Task)
  503. *m = *o
  504. deepcopy.Copy(&m.Meta, &o.Meta)
  505. deepcopy.Copy(&m.Spec, &o.Spec)
  506. if o.SpecVersion != nil {
  507. m.SpecVersion = &Version{}
  508. deepcopy.Copy(m.SpecVersion, o.SpecVersion)
  509. }
  510. deepcopy.Copy(&m.Annotations, &o.Annotations)
  511. deepcopy.Copy(&m.ServiceAnnotations, &o.ServiceAnnotations)
  512. deepcopy.Copy(&m.Status, &o.Status)
  513. if o.Networks != nil {
  514. m.Networks = make([]*NetworkAttachment, len(o.Networks))
  515. for i := range m.Networks {
  516. m.Networks[i] = &NetworkAttachment{}
  517. deepcopy.Copy(m.Networks[i], o.Networks[i])
  518. }
  519. }
  520. if o.Endpoint != nil {
  521. m.Endpoint = &Endpoint{}
  522. deepcopy.Copy(m.Endpoint, o.Endpoint)
  523. }
  524. if o.LogDriver != nil {
  525. m.LogDriver = &Driver{}
  526. deepcopy.Copy(m.LogDriver, o.LogDriver)
  527. }
  528. if o.AssignedGenericResources != nil {
  529. m.AssignedGenericResources = make([]*GenericResource, len(o.AssignedGenericResources))
  530. for i := range m.AssignedGenericResources {
  531. m.AssignedGenericResources[i] = &GenericResource{}
  532. deepcopy.Copy(m.AssignedGenericResources[i], o.AssignedGenericResources[i])
  533. }
  534. }
  535. }
  536. func (m *NetworkAttachment) Copy() *NetworkAttachment {
  537. if m == nil {
  538. return nil
  539. }
  540. o := &NetworkAttachment{}
  541. o.CopyFrom(m)
  542. return o
  543. }
  544. func (m *NetworkAttachment) CopyFrom(src interface{}) {
  545. o := src.(*NetworkAttachment)
  546. *m = *o
  547. if o.Network != nil {
  548. m.Network = &Network{}
  549. deepcopy.Copy(m.Network, o.Network)
  550. }
  551. if o.Addresses != nil {
  552. m.Addresses = make([]string, len(o.Addresses))
  553. copy(m.Addresses, o.Addresses)
  554. }
  555. if o.Aliases != nil {
  556. m.Aliases = make([]string, len(o.Aliases))
  557. copy(m.Aliases, o.Aliases)
  558. }
  559. if o.DriverAttachmentOpts != nil {
  560. m.DriverAttachmentOpts = make(map[string]string, len(o.DriverAttachmentOpts))
  561. for k, v := range o.DriverAttachmentOpts {
  562. m.DriverAttachmentOpts[k] = v
  563. }
  564. }
  565. }
  566. func (m *Network) Copy() *Network {
  567. if m == nil {
  568. return nil
  569. }
  570. o := &Network{}
  571. o.CopyFrom(m)
  572. return o
  573. }
  574. func (m *Network) CopyFrom(src interface{}) {
  575. o := src.(*Network)
  576. *m = *o
  577. deepcopy.Copy(&m.Meta, &o.Meta)
  578. deepcopy.Copy(&m.Spec, &o.Spec)
  579. if o.DriverState != nil {
  580. m.DriverState = &Driver{}
  581. deepcopy.Copy(m.DriverState, o.DriverState)
  582. }
  583. if o.IPAM != nil {
  584. m.IPAM = &IPAMOptions{}
  585. deepcopy.Copy(m.IPAM, o.IPAM)
  586. }
  587. }
  588. func (m *Cluster) Copy() *Cluster {
  589. if m == nil {
  590. return nil
  591. }
  592. o := &Cluster{}
  593. o.CopyFrom(m)
  594. return o
  595. }
  596. func (m *Cluster) CopyFrom(src interface{}) {
  597. o := src.(*Cluster)
  598. *m = *o
  599. deepcopy.Copy(&m.Meta, &o.Meta)
  600. deepcopy.Copy(&m.Spec, &o.Spec)
  601. deepcopy.Copy(&m.RootCA, &o.RootCA)
  602. if o.NetworkBootstrapKeys != nil {
  603. m.NetworkBootstrapKeys = make([]*EncryptionKey, len(o.NetworkBootstrapKeys))
  604. for i := range m.NetworkBootstrapKeys {
  605. m.NetworkBootstrapKeys[i] = &EncryptionKey{}
  606. deepcopy.Copy(m.NetworkBootstrapKeys[i], o.NetworkBootstrapKeys[i])
  607. }
  608. }
  609. if o.BlacklistedCertificates != nil {
  610. m.BlacklistedCertificates = make(map[string]*BlacklistedCertificate, len(o.BlacklistedCertificates))
  611. for k, v := range o.BlacklistedCertificates {
  612. m.BlacklistedCertificates[k] = &BlacklistedCertificate{}
  613. deepcopy.Copy(m.BlacklistedCertificates[k], v)
  614. }
  615. }
  616. if o.UnlockKeys != nil {
  617. m.UnlockKeys = make([]*EncryptionKey, len(o.UnlockKeys))
  618. for i := range m.UnlockKeys {
  619. m.UnlockKeys[i] = &EncryptionKey{}
  620. deepcopy.Copy(m.UnlockKeys[i], o.UnlockKeys[i])
  621. }
  622. }
  623. if o.DefaultAddressPool != nil {
  624. m.DefaultAddressPool = make([]string, len(o.DefaultAddressPool))
  625. copy(m.DefaultAddressPool, o.DefaultAddressPool)
  626. }
  627. }
  628. func (m *Secret) Copy() *Secret {
  629. if m == nil {
  630. return nil
  631. }
  632. o := &Secret{}
  633. o.CopyFrom(m)
  634. return o
  635. }
  636. func (m *Secret) CopyFrom(src interface{}) {
  637. o := src.(*Secret)
  638. *m = *o
  639. deepcopy.Copy(&m.Meta, &o.Meta)
  640. deepcopy.Copy(&m.Spec, &o.Spec)
  641. }
  642. func (m *Config) Copy() *Config {
  643. if m == nil {
  644. return nil
  645. }
  646. o := &Config{}
  647. o.CopyFrom(m)
  648. return o
  649. }
  650. func (m *Config) CopyFrom(src interface{}) {
  651. o := src.(*Config)
  652. *m = *o
  653. deepcopy.Copy(&m.Meta, &o.Meta)
  654. deepcopy.Copy(&m.Spec, &o.Spec)
  655. }
  656. func (m *Resource) Copy() *Resource {
  657. if m == nil {
  658. return nil
  659. }
  660. o := &Resource{}
  661. o.CopyFrom(m)
  662. return o
  663. }
  664. func (m *Resource) CopyFrom(src interface{}) {
  665. o := src.(*Resource)
  666. *m = *o
  667. deepcopy.Copy(&m.Meta, &o.Meta)
  668. deepcopy.Copy(&m.Annotations, &o.Annotations)
  669. if o.Payload != nil {
  670. m.Payload = &google_protobuf4.Any{}
  671. deepcopy.Copy(m.Payload, o.Payload)
  672. }
  673. }
  674. func (m *Extension) Copy() *Extension {
  675. if m == nil {
  676. return nil
  677. }
  678. o := &Extension{}
  679. o.CopyFrom(m)
  680. return o
  681. }
  682. func (m *Extension) CopyFrom(src interface{}) {
  683. o := src.(*Extension)
  684. *m = *o
  685. deepcopy.Copy(&m.Meta, &o.Meta)
  686. deepcopy.Copy(&m.Annotations, &o.Annotations)
  687. }
  688. func (m *Meta) Marshal() (dAtA []byte, err error) {
  689. size := m.Size()
  690. dAtA = make([]byte, size)
  691. n, err := m.MarshalTo(dAtA)
  692. if err != nil {
  693. return nil, err
  694. }
  695. return dAtA[:n], nil
  696. }
  697. func (m *Meta) MarshalTo(dAtA []byte) (int, error) {
  698. var i int
  699. _ = i
  700. var l int
  701. _ = l
  702. dAtA[i] = 0xa
  703. i++
  704. i = encodeVarintObjects(dAtA, i, uint64(m.Version.Size()))
  705. n1, err := m.Version.MarshalTo(dAtA[i:])
  706. if err != nil {
  707. return 0, err
  708. }
  709. i += n1
  710. if m.CreatedAt != nil {
  711. dAtA[i] = 0x12
  712. i++
  713. i = encodeVarintObjects(dAtA, i, uint64(m.CreatedAt.Size()))
  714. n2, err := m.CreatedAt.MarshalTo(dAtA[i:])
  715. if err != nil {
  716. return 0, err
  717. }
  718. i += n2
  719. }
  720. if m.UpdatedAt != nil {
  721. dAtA[i] = 0x1a
  722. i++
  723. i = encodeVarintObjects(dAtA, i, uint64(m.UpdatedAt.Size()))
  724. n3, err := m.UpdatedAt.MarshalTo(dAtA[i:])
  725. if err != nil {
  726. return 0, err
  727. }
  728. i += n3
  729. }
  730. return i, nil
  731. }
  732. func (m *Node) Marshal() (dAtA []byte, err error) {
  733. size := m.Size()
  734. dAtA = make([]byte, size)
  735. n, err := m.MarshalTo(dAtA)
  736. if err != nil {
  737. return nil, err
  738. }
  739. return dAtA[:n], nil
  740. }
  741. func (m *Node) MarshalTo(dAtA []byte) (int, error) {
  742. var i int
  743. _ = i
  744. var l int
  745. _ = l
  746. if len(m.ID) > 0 {
  747. dAtA[i] = 0xa
  748. i++
  749. i = encodeVarintObjects(dAtA, i, uint64(len(m.ID)))
  750. i += copy(dAtA[i:], m.ID)
  751. }
  752. dAtA[i] = 0x12
  753. i++
  754. i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size()))
  755. n4, err := m.Meta.MarshalTo(dAtA[i:])
  756. if err != nil {
  757. return 0, err
  758. }
  759. i += n4
  760. dAtA[i] = 0x1a
  761. i++
  762. i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size()))
  763. n5, err := m.Spec.MarshalTo(dAtA[i:])
  764. if err != nil {
  765. return 0, err
  766. }
  767. i += n5
  768. if m.Description != nil {
  769. dAtA[i] = 0x22
  770. i++
  771. i = encodeVarintObjects(dAtA, i, uint64(m.Description.Size()))
  772. n6, err := m.Description.MarshalTo(dAtA[i:])
  773. if err != nil {
  774. return 0, err
  775. }
  776. i += n6
  777. }
  778. dAtA[i] = 0x2a
  779. i++
  780. i = encodeVarintObjects(dAtA, i, uint64(m.Status.Size()))
  781. n7, err := m.Status.MarshalTo(dAtA[i:])
  782. if err != nil {
  783. return 0, err
  784. }
  785. i += n7
  786. if m.ManagerStatus != nil {
  787. dAtA[i] = 0x32
  788. i++
  789. i = encodeVarintObjects(dAtA, i, uint64(m.ManagerStatus.Size()))
  790. n8, err := m.ManagerStatus.MarshalTo(dAtA[i:])
  791. if err != nil {
  792. return 0, err
  793. }
  794. i += n8
  795. }
  796. if m.Attachment != nil {
  797. dAtA[i] = 0x3a
  798. i++
  799. i = encodeVarintObjects(dAtA, i, uint64(m.Attachment.Size()))
  800. n9, err := m.Attachment.MarshalTo(dAtA[i:])
  801. if err != nil {
  802. return 0, err
  803. }
  804. i += n9
  805. }
  806. dAtA[i] = 0x42
  807. i++
  808. i = encodeVarintObjects(dAtA, i, uint64(m.Certificate.Size()))
  809. n10, err := m.Certificate.MarshalTo(dAtA[i:])
  810. if err != nil {
  811. return 0, err
  812. }
  813. i += n10
  814. if m.Role != 0 {
  815. dAtA[i] = 0x48
  816. i++
  817. i = encodeVarintObjects(dAtA, i, uint64(m.Role))
  818. }
  819. if len(m.Attachments) > 0 {
  820. for _, msg := range m.Attachments {
  821. dAtA[i] = 0x52
  822. i++
  823. i = encodeVarintObjects(dAtA, i, uint64(msg.Size()))
  824. n, err := msg.MarshalTo(dAtA[i:])
  825. if err != nil {
  826. return 0, err
  827. }
  828. i += n
  829. }
  830. }
  831. if m.VXLANUDPPort != 0 {
  832. dAtA[i] = 0x58
  833. i++
  834. i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort))
  835. }
  836. return i, nil
  837. }
  838. func (m *Service) Marshal() (dAtA []byte, err error) {
  839. size := m.Size()
  840. dAtA = make([]byte, size)
  841. n, err := m.MarshalTo(dAtA)
  842. if err != nil {
  843. return nil, err
  844. }
  845. return dAtA[:n], nil
  846. }
  847. func (m *Service) MarshalTo(dAtA []byte) (int, error) {
  848. var i int
  849. _ = i
  850. var l int
  851. _ = l
  852. if len(m.ID) > 0 {
  853. dAtA[i] = 0xa
  854. i++
  855. i = encodeVarintObjects(dAtA, i, uint64(len(m.ID)))
  856. i += copy(dAtA[i:], m.ID)
  857. }
  858. dAtA[i] = 0x12
  859. i++
  860. i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size()))
  861. n11, err := m.Meta.MarshalTo(dAtA[i:])
  862. if err != nil {
  863. return 0, err
  864. }
  865. i += n11
  866. dAtA[i] = 0x1a
  867. i++
  868. i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size()))
  869. n12, err := m.Spec.MarshalTo(dAtA[i:])
  870. if err != nil {
  871. return 0, err
  872. }
  873. i += n12
  874. if m.Endpoint != nil {
  875. dAtA[i] = 0x22
  876. i++
  877. i = encodeVarintObjects(dAtA, i, uint64(m.Endpoint.Size()))
  878. n13, err := m.Endpoint.MarshalTo(dAtA[i:])
  879. if err != nil {
  880. return 0, err
  881. }
  882. i += n13
  883. }
  884. if m.UpdateStatus != nil {
  885. dAtA[i] = 0x2a
  886. i++
  887. i = encodeVarintObjects(dAtA, i, uint64(m.UpdateStatus.Size()))
  888. n14, err := m.UpdateStatus.MarshalTo(dAtA[i:])
  889. if err != nil {
  890. return 0, err
  891. }
  892. i += n14
  893. }
  894. if m.PreviousSpec != nil {
  895. dAtA[i] = 0x32
  896. i++
  897. i = encodeVarintObjects(dAtA, i, uint64(m.PreviousSpec.Size()))
  898. n15, err := m.PreviousSpec.MarshalTo(dAtA[i:])
  899. if err != nil {
  900. return 0, err
  901. }
  902. i += n15
  903. }
  904. if m.PendingDelete {
  905. dAtA[i] = 0x38
  906. i++
  907. if m.PendingDelete {
  908. dAtA[i] = 1
  909. } else {
  910. dAtA[i] = 0
  911. }
  912. i++
  913. }
  914. if m.SpecVersion != nil {
  915. dAtA[i] = 0x52
  916. i++
  917. i = encodeVarintObjects(dAtA, i, uint64(m.SpecVersion.Size()))
  918. n16, err := m.SpecVersion.MarshalTo(dAtA[i:])
  919. if err != nil {
  920. return 0, err
  921. }
  922. i += n16
  923. }
  924. if m.PreviousSpecVersion != nil {
  925. dAtA[i] = 0x5a
  926. i++
  927. i = encodeVarintObjects(dAtA, i, uint64(m.PreviousSpecVersion.Size()))
  928. n17, err := m.PreviousSpecVersion.MarshalTo(dAtA[i:])
  929. if err != nil {
  930. return 0, err
  931. }
  932. i += n17
  933. }
  934. return i, nil
  935. }
  936. func (m *Endpoint) Marshal() (dAtA []byte, err error) {
  937. size := m.Size()
  938. dAtA = make([]byte, size)
  939. n, err := m.MarshalTo(dAtA)
  940. if err != nil {
  941. return nil, err
  942. }
  943. return dAtA[:n], nil
  944. }
  945. func (m *Endpoint) MarshalTo(dAtA []byte) (int, error) {
  946. var i int
  947. _ = i
  948. var l int
  949. _ = l
  950. if m.Spec != nil {
  951. dAtA[i] = 0xa
  952. i++
  953. i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size()))
  954. n18, err := m.Spec.MarshalTo(dAtA[i:])
  955. if err != nil {
  956. return 0, err
  957. }
  958. i += n18
  959. }
  960. if len(m.Ports) > 0 {
  961. for _, msg := range m.Ports {
  962. dAtA[i] = 0x12
  963. i++
  964. i = encodeVarintObjects(dAtA, i, uint64(msg.Size()))
  965. n, err := msg.MarshalTo(dAtA[i:])
  966. if err != nil {
  967. return 0, err
  968. }
  969. i += n
  970. }
  971. }
  972. if len(m.VirtualIPs) > 0 {
  973. for _, msg := range m.VirtualIPs {
  974. dAtA[i] = 0x1a
  975. i++
  976. i = encodeVarintObjects(dAtA, i, uint64(msg.Size()))
  977. n, err := msg.MarshalTo(dAtA[i:])
  978. if err != nil {
  979. return 0, err
  980. }
  981. i += n
  982. }
  983. }
  984. return i, nil
  985. }
  986. func (m *Endpoint_VirtualIP) Marshal() (dAtA []byte, err error) {
  987. size := m.Size()
  988. dAtA = make([]byte, size)
  989. n, err := m.MarshalTo(dAtA)
  990. if err != nil {
  991. return nil, err
  992. }
  993. return dAtA[:n], nil
  994. }
  995. func (m *Endpoint_VirtualIP) MarshalTo(dAtA []byte) (int, error) {
  996. var i int
  997. _ = i
  998. var l int
  999. _ = l
  1000. if len(m.NetworkID) > 0 {
  1001. dAtA[i] = 0xa
  1002. i++
  1003. i = encodeVarintObjects(dAtA, i, uint64(len(m.NetworkID)))
  1004. i += copy(dAtA[i:], m.NetworkID)
  1005. }
  1006. if len(m.Addr) > 0 {
  1007. dAtA[i] = 0x12
  1008. i++
  1009. i = encodeVarintObjects(dAtA, i, uint64(len(m.Addr)))
  1010. i += copy(dAtA[i:], m.Addr)
  1011. }
  1012. return i, nil
  1013. }
  1014. func (m *Task) Marshal() (dAtA []byte, err error) {
  1015. size := m.Size()
  1016. dAtA = make([]byte, size)
  1017. n, err := m.MarshalTo(dAtA)
  1018. if err != nil {
  1019. return nil, err
  1020. }
  1021. return dAtA[:n], nil
  1022. }
  1023. func (m *Task) MarshalTo(dAtA []byte) (int, error) {
  1024. var i int
  1025. _ = i
  1026. var l int
  1027. _ = l
  1028. if len(m.ID) > 0 {
  1029. dAtA[i] = 0xa
  1030. i++
  1031. i = encodeVarintObjects(dAtA, i, uint64(len(m.ID)))
  1032. i += copy(dAtA[i:], m.ID)
  1033. }
  1034. dAtA[i] = 0x12
  1035. i++
  1036. i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size()))
  1037. n19, err := m.Meta.MarshalTo(dAtA[i:])
  1038. if err != nil {
  1039. return 0, err
  1040. }
  1041. i += n19
  1042. dAtA[i] = 0x1a
  1043. i++
  1044. i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size()))
  1045. n20, err := m.Spec.MarshalTo(dAtA[i:])
  1046. if err != nil {
  1047. return 0, err
  1048. }
  1049. i += n20
  1050. if len(m.ServiceID) > 0 {
  1051. dAtA[i] = 0x22
  1052. i++
  1053. i = encodeVarintObjects(dAtA, i, uint64(len(m.ServiceID)))
  1054. i += copy(dAtA[i:], m.ServiceID)
  1055. }
  1056. if m.Slot != 0 {
  1057. dAtA[i] = 0x28
  1058. i++
  1059. i = encodeVarintObjects(dAtA, i, uint64(m.Slot))
  1060. }
  1061. if len(m.NodeID) > 0 {
  1062. dAtA[i] = 0x32
  1063. i++
  1064. i = encodeVarintObjects(dAtA, i, uint64(len(m.NodeID)))
  1065. i += copy(dAtA[i:], m.NodeID)
  1066. }
  1067. dAtA[i] = 0x3a
  1068. i++
  1069. i = encodeVarintObjects(dAtA, i, uint64(m.Annotations.Size()))
  1070. n21, err := m.Annotations.MarshalTo(dAtA[i:])
  1071. if err != nil {
  1072. return 0, err
  1073. }
  1074. i += n21
  1075. dAtA[i] = 0x42
  1076. i++
  1077. i = encodeVarintObjects(dAtA, i, uint64(m.ServiceAnnotations.Size()))
  1078. n22, err := m.ServiceAnnotations.MarshalTo(dAtA[i:])
  1079. if err != nil {
  1080. return 0, err
  1081. }
  1082. i += n22
  1083. dAtA[i] = 0x4a
  1084. i++
  1085. i = encodeVarintObjects(dAtA, i, uint64(m.Status.Size()))
  1086. n23, err := m.Status.MarshalTo(dAtA[i:])
  1087. if err != nil {
  1088. return 0, err
  1089. }
  1090. i += n23
  1091. if m.DesiredState != 0 {
  1092. dAtA[i] = 0x50
  1093. i++
  1094. i = encodeVarintObjects(dAtA, i, uint64(m.DesiredState))
  1095. }
  1096. if len(m.Networks) > 0 {
  1097. for _, msg := range m.Networks {
  1098. dAtA[i] = 0x5a
  1099. i++
  1100. i = encodeVarintObjects(dAtA, i, uint64(msg.Size()))
  1101. n, err := msg.MarshalTo(dAtA[i:])
  1102. if err != nil {
  1103. return 0, err
  1104. }
  1105. i += n
  1106. }
  1107. }
  1108. if m.Endpoint != nil {
  1109. dAtA[i] = 0x62
  1110. i++
  1111. i = encodeVarintObjects(dAtA, i, uint64(m.Endpoint.Size()))
  1112. n24, err := m.Endpoint.MarshalTo(dAtA[i:])
  1113. if err != nil {
  1114. return 0, err
  1115. }
  1116. i += n24
  1117. }
  1118. if m.LogDriver != nil {
  1119. dAtA[i] = 0x6a
  1120. i++
  1121. i = encodeVarintObjects(dAtA, i, uint64(m.LogDriver.Size()))
  1122. n25, err := m.LogDriver.MarshalTo(dAtA[i:])
  1123. if err != nil {
  1124. return 0, err
  1125. }
  1126. i += n25
  1127. }
  1128. if m.SpecVersion != nil {
  1129. dAtA[i] = 0x72
  1130. i++
  1131. i = encodeVarintObjects(dAtA, i, uint64(m.SpecVersion.Size()))
  1132. n26, err := m.SpecVersion.MarshalTo(dAtA[i:])
  1133. if err != nil {
  1134. return 0, err
  1135. }
  1136. i += n26
  1137. }
  1138. if len(m.AssignedGenericResources) > 0 {
  1139. for _, msg := range m.AssignedGenericResources {
  1140. dAtA[i] = 0x7a
  1141. i++
  1142. i = encodeVarintObjects(dAtA, i, uint64(msg.Size()))
  1143. n, err := msg.MarshalTo(dAtA[i:])
  1144. if err != nil {
  1145. return 0, err
  1146. }
  1147. i += n
  1148. }
  1149. }
  1150. return i, nil
  1151. }
  1152. func (m *NetworkAttachment) Marshal() (dAtA []byte, err error) {
  1153. size := m.Size()
  1154. dAtA = make([]byte, size)
  1155. n, err := m.MarshalTo(dAtA)
  1156. if err != nil {
  1157. return nil, err
  1158. }
  1159. return dAtA[:n], nil
  1160. }
  1161. func (m *NetworkAttachment) MarshalTo(dAtA []byte) (int, error) {
  1162. var i int
  1163. _ = i
  1164. var l int
  1165. _ = l
  1166. if m.Network != nil {
  1167. dAtA[i] = 0xa
  1168. i++
  1169. i = encodeVarintObjects(dAtA, i, uint64(m.Network.Size()))
  1170. n27, err := m.Network.MarshalTo(dAtA[i:])
  1171. if err != nil {
  1172. return 0, err
  1173. }
  1174. i += n27
  1175. }
  1176. if len(m.Addresses) > 0 {
  1177. for _, s := range m.Addresses {
  1178. dAtA[i] = 0x12
  1179. i++
  1180. l = len(s)
  1181. for l >= 1<<7 {
  1182. dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
  1183. l >>= 7
  1184. i++
  1185. }
  1186. dAtA[i] = uint8(l)
  1187. i++
  1188. i += copy(dAtA[i:], s)
  1189. }
  1190. }
  1191. if len(m.Aliases) > 0 {
  1192. for _, s := range m.Aliases {
  1193. dAtA[i] = 0x1a
  1194. i++
  1195. l = len(s)
  1196. for l >= 1<<7 {
  1197. dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
  1198. l >>= 7
  1199. i++
  1200. }
  1201. dAtA[i] = uint8(l)
  1202. i++
  1203. i += copy(dAtA[i:], s)
  1204. }
  1205. }
  1206. if len(m.DriverAttachmentOpts) > 0 {
  1207. for k, _ := range m.DriverAttachmentOpts {
  1208. dAtA[i] = 0x22
  1209. i++
  1210. v := m.DriverAttachmentOpts[k]
  1211. mapSize := 1 + len(k) + sovObjects(uint64(len(k))) + 1 + len(v) + sovObjects(uint64(len(v)))
  1212. i = encodeVarintObjects(dAtA, i, uint64(mapSize))
  1213. dAtA[i] = 0xa
  1214. i++
  1215. i = encodeVarintObjects(dAtA, i, uint64(len(k)))
  1216. i += copy(dAtA[i:], k)
  1217. dAtA[i] = 0x12
  1218. i++
  1219. i = encodeVarintObjects(dAtA, i, uint64(len(v)))
  1220. i += copy(dAtA[i:], v)
  1221. }
  1222. }
  1223. return i, nil
  1224. }
  1225. func (m *Network) Marshal() (dAtA []byte, err error) {
  1226. size := m.Size()
  1227. dAtA = make([]byte, size)
  1228. n, err := m.MarshalTo(dAtA)
  1229. if err != nil {
  1230. return nil, err
  1231. }
  1232. return dAtA[:n], nil
  1233. }
  1234. func (m *Network) MarshalTo(dAtA []byte) (int, error) {
  1235. var i int
  1236. _ = i
  1237. var l int
  1238. _ = l
  1239. if len(m.ID) > 0 {
  1240. dAtA[i] = 0xa
  1241. i++
  1242. i = encodeVarintObjects(dAtA, i, uint64(len(m.ID)))
  1243. i += copy(dAtA[i:], m.ID)
  1244. }
  1245. dAtA[i] = 0x12
  1246. i++
  1247. i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size()))
  1248. n28, err := m.Meta.MarshalTo(dAtA[i:])
  1249. if err != nil {
  1250. return 0, err
  1251. }
  1252. i += n28
  1253. dAtA[i] = 0x1a
  1254. i++
  1255. i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size()))
  1256. n29, err := m.Spec.MarshalTo(dAtA[i:])
  1257. if err != nil {
  1258. return 0, err
  1259. }
  1260. i += n29
  1261. if m.DriverState != nil {
  1262. dAtA[i] = 0x22
  1263. i++
  1264. i = encodeVarintObjects(dAtA, i, uint64(m.DriverState.Size()))
  1265. n30, err := m.DriverState.MarshalTo(dAtA[i:])
  1266. if err != nil {
  1267. return 0, err
  1268. }
  1269. i += n30
  1270. }
  1271. if m.IPAM != nil {
  1272. dAtA[i] = 0x2a
  1273. i++
  1274. i = encodeVarintObjects(dAtA, i, uint64(m.IPAM.Size()))
  1275. n31, err := m.IPAM.MarshalTo(dAtA[i:])
  1276. if err != nil {
  1277. return 0, err
  1278. }
  1279. i += n31
  1280. }
  1281. if m.PendingDelete {
  1282. dAtA[i] = 0x30
  1283. i++
  1284. if m.PendingDelete {
  1285. dAtA[i] = 1
  1286. } else {
  1287. dAtA[i] = 0
  1288. }
  1289. i++
  1290. }
  1291. return i, nil
  1292. }
  1293. func (m *Cluster) Marshal() (dAtA []byte, err error) {
  1294. size := m.Size()
  1295. dAtA = make([]byte, size)
  1296. n, err := m.MarshalTo(dAtA)
  1297. if err != nil {
  1298. return nil, err
  1299. }
  1300. return dAtA[:n], nil
  1301. }
  1302. func (m *Cluster) MarshalTo(dAtA []byte) (int, error) {
  1303. var i int
  1304. _ = i
  1305. var l int
  1306. _ = l
  1307. if len(m.ID) > 0 {
  1308. dAtA[i] = 0xa
  1309. i++
  1310. i = encodeVarintObjects(dAtA, i, uint64(len(m.ID)))
  1311. i += copy(dAtA[i:], m.ID)
  1312. }
  1313. dAtA[i] = 0x12
  1314. i++
  1315. i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size()))
  1316. n32, err := m.Meta.MarshalTo(dAtA[i:])
  1317. if err != nil {
  1318. return 0, err
  1319. }
  1320. i += n32
  1321. dAtA[i] = 0x1a
  1322. i++
  1323. i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size()))
  1324. n33, err := m.Spec.MarshalTo(dAtA[i:])
  1325. if err != nil {
  1326. return 0, err
  1327. }
  1328. i += n33
  1329. dAtA[i] = 0x22
  1330. i++
  1331. i = encodeVarintObjects(dAtA, i, uint64(m.RootCA.Size()))
  1332. n34, err := m.RootCA.MarshalTo(dAtA[i:])
  1333. if err != nil {
  1334. return 0, err
  1335. }
  1336. i += n34
  1337. if len(m.NetworkBootstrapKeys) > 0 {
  1338. for _, msg := range m.NetworkBootstrapKeys {
  1339. dAtA[i] = 0x2a
  1340. i++
  1341. i = encodeVarintObjects(dAtA, i, uint64(msg.Size()))
  1342. n, err := msg.MarshalTo(dAtA[i:])
  1343. if err != nil {
  1344. return 0, err
  1345. }
  1346. i += n
  1347. }
  1348. }
  1349. if m.EncryptionKeyLamportClock != 0 {
  1350. dAtA[i] = 0x30
  1351. i++
  1352. i = encodeVarintObjects(dAtA, i, uint64(m.EncryptionKeyLamportClock))
  1353. }
  1354. if len(m.BlacklistedCertificates) > 0 {
  1355. for k, _ := range m.BlacklistedCertificates {
  1356. dAtA[i] = 0x42
  1357. i++
  1358. v := m.BlacklistedCertificates[k]
  1359. msgSize := 0
  1360. if v != nil {
  1361. msgSize = v.Size()
  1362. msgSize += 1 + sovObjects(uint64(msgSize))
  1363. }
  1364. mapSize := 1 + len(k) + sovObjects(uint64(len(k))) + msgSize
  1365. i = encodeVarintObjects(dAtA, i, uint64(mapSize))
  1366. dAtA[i] = 0xa
  1367. i++
  1368. i = encodeVarintObjects(dAtA, i, uint64(len(k)))
  1369. i += copy(dAtA[i:], k)
  1370. if v != nil {
  1371. dAtA[i] = 0x12
  1372. i++
  1373. i = encodeVarintObjects(dAtA, i, uint64(v.Size()))
  1374. n35, err := v.MarshalTo(dAtA[i:])
  1375. if err != nil {
  1376. return 0, err
  1377. }
  1378. i += n35
  1379. }
  1380. }
  1381. }
  1382. if len(m.UnlockKeys) > 0 {
  1383. for _, msg := range m.UnlockKeys {
  1384. dAtA[i] = 0x4a
  1385. i++
  1386. i = encodeVarintObjects(dAtA, i, uint64(msg.Size()))
  1387. n, err := msg.MarshalTo(dAtA[i:])
  1388. if err != nil {
  1389. return 0, err
  1390. }
  1391. i += n
  1392. }
  1393. }
  1394. if m.FIPS {
  1395. dAtA[i] = 0x50
  1396. i++
  1397. if m.FIPS {
  1398. dAtA[i] = 1
  1399. } else {
  1400. dAtA[i] = 0
  1401. }
  1402. i++
  1403. }
  1404. if len(m.DefaultAddressPool) > 0 {
  1405. for _, s := range m.DefaultAddressPool {
  1406. dAtA[i] = 0x5a
  1407. i++
  1408. l = len(s)
  1409. for l >= 1<<7 {
  1410. dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
  1411. l >>= 7
  1412. i++
  1413. }
  1414. dAtA[i] = uint8(l)
  1415. i++
  1416. i += copy(dAtA[i:], s)
  1417. }
  1418. }
  1419. if m.SubnetSize != 0 {
  1420. dAtA[i] = 0x60
  1421. i++
  1422. i = encodeVarintObjects(dAtA, i, uint64(m.SubnetSize))
  1423. }
  1424. if m.VXLANUDPPort != 0 {
  1425. dAtA[i] = 0x68
  1426. i++
  1427. i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort))
  1428. }
  1429. return i, nil
  1430. }
  1431. func (m *Secret) Marshal() (dAtA []byte, err error) {
  1432. size := m.Size()
  1433. dAtA = make([]byte, size)
  1434. n, err := m.MarshalTo(dAtA)
  1435. if err != nil {
  1436. return nil, err
  1437. }
  1438. return dAtA[:n], nil
  1439. }
  1440. func (m *Secret) MarshalTo(dAtA []byte) (int, error) {
  1441. var i int
  1442. _ = i
  1443. var l int
  1444. _ = l
  1445. if len(m.ID) > 0 {
  1446. dAtA[i] = 0xa
  1447. i++
  1448. i = encodeVarintObjects(dAtA, i, uint64(len(m.ID)))
  1449. i += copy(dAtA[i:], m.ID)
  1450. }
  1451. dAtA[i] = 0x12
  1452. i++
  1453. i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size()))
  1454. n36, err := m.Meta.MarshalTo(dAtA[i:])
  1455. if err != nil {
  1456. return 0, err
  1457. }
  1458. i += n36
  1459. dAtA[i] = 0x1a
  1460. i++
  1461. i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size()))
  1462. n37, err := m.Spec.MarshalTo(dAtA[i:])
  1463. if err != nil {
  1464. return 0, err
  1465. }
  1466. i += n37
  1467. if m.Internal {
  1468. dAtA[i] = 0x20
  1469. i++
  1470. if m.Internal {
  1471. dAtA[i] = 1
  1472. } else {
  1473. dAtA[i] = 0
  1474. }
  1475. i++
  1476. }
  1477. return i, nil
  1478. }
  1479. func (m *Config) Marshal() (dAtA []byte, err error) {
  1480. size := m.Size()
  1481. dAtA = make([]byte, size)
  1482. n, err := m.MarshalTo(dAtA)
  1483. if err != nil {
  1484. return nil, err
  1485. }
  1486. return dAtA[:n], nil
  1487. }
  1488. func (m *Config) MarshalTo(dAtA []byte) (int, error) {
  1489. var i int
  1490. _ = i
  1491. var l int
  1492. _ = l
  1493. if len(m.ID) > 0 {
  1494. dAtA[i] = 0xa
  1495. i++
  1496. i = encodeVarintObjects(dAtA, i, uint64(len(m.ID)))
  1497. i += copy(dAtA[i:], m.ID)
  1498. }
  1499. dAtA[i] = 0x12
  1500. i++
  1501. i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size()))
  1502. n38, err := m.Meta.MarshalTo(dAtA[i:])
  1503. if err != nil {
  1504. return 0, err
  1505. }
  1506. i += n38
  1507. dAtA[i] = 0x1a
  1508. i++
  1509. i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size()))
  1510. n39, err := m.Spec.MarshalTo(dAtA[i:])
  1511. if err != nil {
  1512. return 0, err
  1513. }
  1514. i += n39
  1515. return i, nil
  1516. }
  1517. func (m *Resource) Marshal() (dAtA []byte, err error) {
  1518. size := m.Size()
  1519. dAtA = make([]byte, size)
  1520. n, err := m.MarshalTo(dAtA)
  1521. if err != nil {
  1522. return nil, err
  1523. }
  1524. return dAtA[:n], nil
  1525. }
  1526. func (m *Resource) MarshalTo(dAtA []byte) (int, error) {
  1527. var i int
  1528. _ = i
  1529. var l int
  1530. _ = l
  1531. if len(m.ID) > 0 {
  1532. dAtA[i] = 0xa
  1533. i++
  1534. i = encodeVarintObjects(dAtA, i, uint64(len(m.ID)))
  1535. i += copy(dAtA[i:], m.ID)
  1536. }
  1537. dAtA[i] = 0x12
  1538. i++
  1539. i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size()))
  1540. n40, err := m.Meta.MarshalTo(dAtA[i:])
  1541. if err != nil {
  1542. return 0, err
  1543. }
  1544. i += n40
  1545. dAtA[i] = 0x1a
  1546. i++
  1547. i = encodeVarintObjects(dAtA, i, uint64(m.Annotations.Size()))
  1548. n41, err := m.Annotations.MarshalTo(dAtA[i:])
  1549. if err != nil {
  1550. return 0, err
  1551. }
  1552. i += n41
  1553. if len(m.Kind) > 0 {
  1554. dAtA[i] = 0x22
  1555. i++
  1556. i = encodeVarintObjects(dAtA, i, uint64(len(m.Kind)))
  1557. i += copy(dAtA[i:], m.Kind)
  1558. }
  1559. if m.Payload != nil {
  1560. dAtA[i] = 0x2a
  1561. i++
  1562. i = encodeVarintObjects(dAtA, i, uint64(m.Payload.Size()))
  1563. n42, err := m.Payload.MarshalTo(dAtA[i:])
  1564. if err != nil {
  1565. return 0, err
  1566. }
  1567. i += n42
  1568. }
  1569. return i, nil
  1570. }
  1571. func (m *Extension) Marshal() (dAtA []byte, err error) {
  1572. size := m.Size()
  1573. dAtA = make([]byte, size)
  1574. n, err := m.MarshalTo(dAtA)
  1575. if err != nil {
  1576. return nil, err
  1577. }
  1578. return dAtA[:n], nil
  1579. }
  1580. func (m *Extension) MarshalTo(dAtA []byte) (int, error) {
  1581. var i int
  1582. _ = i
  1583. var l int
  1584. _ = l
  1585. if len(m.ID) > 0 {
  1586. dAtA[i] = 0xa
  1587. i++
  1588. i = encodeVarintObjects(dAtA, i, uint64(len(m.ID)))
  1589. i += copy(dAtA[i:], m.ID)
  1590. }
  1591. dAtA[i] = 0x12
  1592. i++
  1593. i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size()))
  1594. n43, err := m.Meta.MarshalTo(dAtA[i:])
  1595. if err != nil {
  1596. return 0, err
  1597. }
  1598. i += n43
  1599. dAtA[i] = 0x1a
  1600. i++
  1601. i = encodeVarintObjects(dAtA, i, uint64(m.Annotations.Size()))
  1602. n44, err := m.Annotations.MarshalTo(dAtA[i:])
  1603. if err != nil {
  1604. return 0, err
  1605. }
  1606. i += n44
  1607. if len(m.Description) > 0 {
  1608. dAtA[i] = 0x22
  1609. i++
  1610. i = encodeVarintObjects(dAtA, i, uint64(len(m.Description)))
  1611. i += copy(dAtA[i:], m.Description)
  1612. }
  1613. return i, nil
  1614. }
  1615. func encodeVarintObjects(dAtA []byte, offset int, v uint64) int {
  1616. for v >= 1<<7 {
  1617. dAtA[offset] = uint8(v&0x7f | 0x80)
  1618. v >>= 7
  1619. offset++
  1620. }
  1621. dAtA[offset] = uint8(v)
  1622. return offset + 1
  1623. }
  1624. func (m *Meta) Size() (n int) {
  1625. var l int
  1626. _ = l
  1627. l = m.Version.Size()
  1628. n += 1 + l + sovObjects(uint64(l))
  1629. if m.CreatedAt != nil {
  1630. l = m.CreatedAt.Size()
  1631. n += 1 + l + sovObjects(uint64(l))
  1632. }
  1633. if m.UpdatedAt != nil {
  1634. l = m.UpdatedAt.Size()
  1635. n += 1 + l + sovObjects(uint64(l))
  1636. }
  1637. return n
  1638. }
  1639. func (m *Node) Size() (n int) {
  1640. var l int
  1641. _ = l
  1642. l = len(m.ID)
  1643. if l > 0 {
  1644. n += 1 + l + sovObjects(uint64(l))
  1645. }
  1646. l = m.Meta.Size()
  1647. n += 1 + l + sovObjects(uint64(l))
  1648. l = m.Spec.Size()
  1649. n += 1 + l + sovObjects(uint64(l))
  1650. if m.Description != nil {
  1651. l = m.Description.Size()
  1652. n += 1 + l + sovObjects(uint64(l))
  1653. }
  1654. l = m.Status.Size()
  1655. n += 1 + l + sovObjects(uint64(l))
  1656. if m.ManagerStatus != nil {
  1657. l = m.ManagerStatus.Size()
  1658. n += 1 + l + sovObjects(uint64(l))
  1659. }
  1660. if m.Attachment != nil {
  1661. l = m.Attachment.Size()
  1662. n += 1 + l + sovObjects(uint64(l))
  1663. }
  1664. l = m.Certificate.Size()
  1665. n += 1 + l + sovObjects(uint64(l))
  1666. if m.Role != 0 {
  1667. n += 1 + sovObjects(uint64(m.Role))
  1668. }
  1669. if len(m.Attachments) > 0 {
  1670. for _, e := range m.Attachments {
  1671. l = e.Size()
  1672. n += 1 + l + sovObjects(uint64(l))
  1673. }
  1674. }
  1675. if m.VXLANUDPPort != 0 {
  1676. n += 1 + sovObjects(uint64(m.VXLANUDPPort))
  1677. }
  1678. return n
  1679. }
  1680. func (m *Service) Size() (n int) {
  1681. var l int
  1682. _ = l
  1683. l = len(m.ID)
  1684. if l > 0 {
  1685. n += 1 + l + sovObjects(uint64(l))
  1686. }
  1687. l = m.Meta.Size()
  1688. n += 1 + l + sovObjects(uint64(l))
  1689. l = m.Spec.Size()
  1690. n += 1 + l + sovObjects(uint64(l))
  1691. if m.Endpoint != nil {
  1692. l = m.Endpoint.Size()
  1693. n += 1 + l + sovObjects(uint64(l))
  1694. }
  1695. if m.UpdateStatus != nil {
  1696. l = m.UpdateStatus.Size()
  1697. n += 1 + l + sovObjects(uint64(l))
  1698. }
  1699. if m.PreviousSpec != nil {
  1700. l = m.PreviousSpec.Size()
  1701. n += 1 + l + sovObjects(uint64(l))
  1702. }
  1703. if m.PendingDelete {
  1704. n += 2
  1705. }
  1706. if m.SpecVersion != nil {
  1707. l = m.SpecVersion.Size()
  1708. n += 1 + l + sovObjects(uint64(l))
  1709. }
  1710. if m.PreviousSpecVersion != nil {
  1711. l = m.PreviousSpecVersion.Size()
  1712. n += 1 + l + sovObjects(uint64(l))
  1713. }
  1714. return n
  1715. }
  1716. func (m *Endpoint) Size() (n int) {
  1717. var l int
  1718. _ = l
  1719. if m.Spec != nil {
  1720. l = m.Spec.Size()
  1721. n += 1 + l + sovObjects(uint64(l))
  1722. }
  1723. if len(m.Ports) > 0 {
  1724. for _, e := range m.Ports {
  1725. l = e.Size()
  1726. n += 1 + l + sovObjects(uint64(l))
  1727. }
  1728. }
  1729. if len(m.VirtualIPs) > 0 {
  1730. for _, e := range m.VirtualIPs {
  1731. l = e.Size()
  1732. n += 1 + l + sovObjects(uint64(l))
  1733. }
  1734. }
  1735. return n
  1736. }
  1737. func (m *Endpoint_VirtualIP) Size() (n int) {
  1738. var l int
  1739. _ = l
  1740. l = len(m.NetworkID)
  1741. if l > 0 {
  1742. n += 1 + l + sovObjects(uint64(l))
  1743. }
  1744. l = len(m.Addr)
  1745. if l > 0 {
  1746. n += 1 + l + sovObjects(uint64(l))
  1747. }
  1748. return n
  1749. }
  1750. func (m *Task) Size() (n int) {
  1751. var l int
  1752. _ = l
  1753. l = len(m.ID)
  1754. if l > 0 {
  1755. n += 1 + l + sovObjects(uint64(l))
  1756. }
  1757. l = m.Meta.Size()
  1758. n += 1 + l + sovObjects(uint64(l))
  1759. l = m.Spec.Size()
  1760. n += 1 + l + sovObjects(uint64(l))
  1761. l = len(m.ServiceID)
  1762. if l > 0 {
  1763. n += 1 + l + sovObjects(uint64(l))
  1764. }
  1765. if m.Slot != 0 {
  1766. n += 1 + sovObjects(uint64(m.Slot))
  1767. }
  1768. l = len(m.NodeID)
  1769. if l > 0 {
  1770. n += 1 + l + sovObjects(uint64(l))
  1771. }
  1772. l = m.Annotations.Size()
  1773. n += 1 + l + sovObjects(uint64(l))
  1774. l = m.ServiceAnnotations.Size()
  1775. n += 1 + l + sovObjects(uint64(l))
  1776. l = m.Status.Size()
  1777. n += 1 + l + sovObjects(uint64(l))
  1778. if m.DesiredState != 0 {
  1779. n += 1 + sovObjects(uint64(m.DesiredState))
  1780. }
  1781. if len(m.Networks) > 0 {
  1782. for _, e := range m.Networks {
  1783. l = e.Size()
  1784. n += 1 + l + sovObjects(uint64(l))
  1785. }
  1786. }
  1787. if m.Endpoint != nil {
  1788. l = m.Endpoint.Size()
  1789. n += 1 + l + sovObjects(uint64(l))
  1790. }
  1791. if m.LogDriver != nil {
  1792. l = m.LogDriver.Size()
  1793. n += 1 + l + sovObjects(uint64(l))
  1794. }
  1795. if m.SpecVersion != nil {
  1796. l = m.SpecVersion.Size()
  1797. n += 1 + l + sovObjects(uint64(l))
  1798. }
  1799. if len(m.AssignedGenericResources) > 0 {
  1800. for _, e := range m.AssignedGenericResources {
  1801. l = e.Size()
  1802. n += 1 + l + sovObjects(uint64(l))
  1803. }
  1804. }
  1805. return n
  1806. }
  1807. func (m *NetworkAttachment) Size() (n int) {
  1808. var l int
  1809. _ = l
  1810. if m.Network != nil {
  1811. l = m.Network.Size()
  1812. n += 1 + l + sovObjects(uint64(l))
  1813. }
  1814. if len(m.Addresses) > 0 {
  1815. for _, s := range m.Addresses {
  1816. l = len(s)
  1817. n += 1 + l + sovObjects(uint64(l))
  1818. }
  1819. }
  1820. if len(m.Aliases) > 0 {
  1821. for _, s := range m.Aliases {
  1822. l = len(s)
  1823. n += 1 + l + sovObjects(uint64(l))
  1824. }
  1825. }
  1826. if len(m.DriverAttachmentOpts) > 0 {
  1827. for k, v := range m.DriverAttachmentOpts {
  1828. _ = k
  1829. _ = v
  1830. mapEntrySize := 1 + len(k) + sovObjects(uint64(len(k))) + 1 + len(v) + sovObjects(uint64(len(v)))
  1831. n += mapEntrySize + 1 + sovObjects(uint64(mapEntrySize))
  1832. }
  1833. }
  1834. return n
  1835. }
  1836. func (m *Network) Size() (n int) {
  1837. var l int
  1838. _ = l
  1839. l = len(m.ID)
  1840. if l > 0 {
  1841. n += 1 + l + sovObjects(uint64(l))
  1842. }
  1843. l = m.Meta.Size()
  1844. n += 1 + l + sovObjects(uint64(l))
  1845. l = m.Spec.Size()
  1846. n += 1 + l + sovObjects(uint64(l))
  1847. if m.DriverState != nil {
  1848. l = m.DriverState.Size()
  1849. n += 1 + l + sovObjects(uint64(l))
  1850. }
  1851. if m.IPAM != nil {
  1852. l = m.IPAM.Size()
  1853. n += 1 + l + sovObjects(uint64(l))
  1854. }
  1855. if m.PendingDelete {
  1856. n += 2
  1857. }
  1858. return n
  1859. }
  1860. func (m *Cluster) Size() (n int) {
  1861. var l int
  1862. _ = l
  1863. l = len(m.ID)
  1864. if l > 0 {
  1865. n += 1 + l + sovObjects(uint64(l))
  1866. }
  1867. l = m.Meta.Size()
  1868. n += 1 + l + sovObjects(uint64(l))
  1869. l = m.Spec.Size()
  1870. n += 1 + l + sovObjects(uint64(l))
  1871. l = m.RootCA.Size()
  1872. n += 1 + l + sovObjects(uint64(l))
  1873. if len(m.NetworkBootstrapKeys) > 0 {
  1874. for _, e := range m.NetworkBootstrapKeys {
  1875. l = e.Size()
  1876. n += 1 + l + sovObjects(uint64(l))
  1877. }
  1878. }
  1879. if m.EncryptionKeyLamportClock != 0 {
  1880. n += 1 + sovObjects(uint64(m.EncryptionKeyLamportClock))
  1881. }
  1882. if len(m.BlacklistedCertificates) > 0 {
  1883. for k, v := range m.BlacklistedCertificates {
  1884. _ = k
  1885. _ = v
  1886. l = 0
  1887. if v != nil {
  1888. l = v.Size()
  1889. l += 1 + sovObjects(uint64(l))
  1890. }
  1891. mapEntrySize := 1 + len(k) + sovObjects(uint64(len(k))) + l
  1892. n += mapEntrySize + 1 + sovObjects(uint64(mapEntrySize))
  1893. }
  1894. }
  1895. if len(m.UnlockKeys) > 0 {
  1896. for _, e := range m.UnlockKeys {
  1897. l = e.Size()
  1898. n += 1 + l + sovObjects(uint64(l))
  1899. }
  1900. }
  1901. if m.FIPS {
  1902. n += 2
  1903. }
  1904. if len(m.DefaultAddressPool) > 0 {
  1905. for _, s := range m.DefaultAddressPool {
  1906. l = len(s)
  1907. n += 1 + l + sovObjects(uint64(l))
  1908. }
  1909. }
  1910. if m.SubnetSize != 0 {
  1911. n += 1 + sovObjects(uint64(m.SubnetSize))
  1912. }
  1913. if m.VXLANUDPPort != 0 {
  1914. n += 1 + sovObjects(uint64(m.VXLANUDPPort))
  1915. }
  1916. return n
  1917. }
  1918. func (m *Secret) Size() (n int) {
  1919. var l int
  1920. _ = l
  1921. l = len(m.ID)
  1922. if l > 0 {
  1923. n += 1 + l + sovObjects(uint64(l))
  1924. }
  1925. l = m.Meta.Size()
  1926. n += 1 + l + sovObjects(uint64(l))
  1927. l = m.Spec.Size()
  1928. n += 1 + l + sovObjects(uint64(l))
  1929. if m.Internal {
  1930. n += 2
  1931. }
  1932. return n
  1933. }
  1934. func (m *Config) Size() (n int) {
  1935. var l int
  1936. _ = l
  1937. l = len(m.ID)
  1938. if l > 0 {
  1939. n += 1 + l + sovObjects(uint64(l))
  1940. }
  1941. l = m.Meta.Size()
  1942. n += 1 + l + sovObjects(uint64(l))
  1943. l = m.Spec.Size()
  1944. n += 1 + l + sovObjects(uint64(l))
  1945. return n
  1946. }
  1947. func (m *Resource) Size() (n int) {
  1948. var l int
  1949. _ = l
  1950. l = len(m.ID)
  1951. if l > 0 {
  1952. n += 1 + l + sovObjects(uint64(l))
  1953. }
  1954. l = m.Meta.Size()
  1955. n += 1 + l + sovObjects(uint64(l))
  1956. l = m.Annotations.Size()
  1957. n += 1 + l + sovObjects(uint64(l))
  1958. l = len(m.Kind)
  1959. if l > 0 {
  1960. n += 1 + l + sovObjects(uint64(l))
  1961. }
  1962. if m.Payload != nil {
  1963. l = m.Payload.Size()
  1964. n += 1 + l + sovObjects(uint64(l))
  1965. }
  1966. return n
  1967. }
  1968. func (m *Extension) Size() (n int) {
  1969. var l int
  1970. _ = l
  1971. l = len(m.ID)
  1972. if l > 0 {
  1973. n += 1 + l + sovObjects(uint64(l))
  1974. }
  1975. l = m.Meta.Size()
  1976. n += 1 + l + sovObjects(uint64(l))
  1977. l = m.Annotations.Size()
  1978. n += 1 + l + sovObjects(uint64(l))
  1979. l = len(m.Description)
  1980. if l > 0 {
  1981. n += 1 + l + sovObjects(uint64(l))
  1982. }
  1983. return n
  1984. }
  1985. func sovObjects(x uint64) (n int) {
  1986. for {
  1987. n++
  1988. x >>= 7
  1989. if x == 0 {
  1990. break
  1991. }
  1992. }
  1993. return n
  1994. }
  1995. func sozObjects(x uint64) (n int) {
  1996. return sovObjects(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1997. }
  1998. type NodeCheckFunc func(t1, t2 *Node) bool
  1999. type EventNode interface {
  2000. IsEventNode() bool
  2001. }
  2002. type EventCreateNode struct {
  2003. Node *Node
  2004. Checks []NodeCheckFunc
  2005. }
  2006. func (e EventCreateNode) Matches(apiEvent go_events.Event) bool {
  2007. typedEvent, ok := apiEvent.(EventCreateNode)
  2008. if !ok {
  2009. return false
  2010. }
  2011. for _, check := range e.Checks {
  2012. if !check(e.Node, typedEvent.Node) {
  2013. return false
  2014. }
  2015. }
  2016. return true
  2017. }
  2018. func (e EventCreateNode) IsEventCreate() bool {
  2019. return true
  2020. }
  2021. func (e EventCreateNode) IsEventNode() bool {
  2022. return true
  2023. }
  2024. type EventUpdateNode struct {
  2025. Node *Node
  2026. OldNode *Node
  2027. Checks []NodeCheckFunc
  2028. }
  2029. func (e EventUpdateNode) Matches(apiEvent go_events.Event) bool {
  2030. typedEvent, ok := apiEvent.(EventUpdateNode)
  2031. if !ok {
  2032. return false
  2033. }
  2034. for _, check := range e.Checks {
  2035. if !check(e.Node, typedEvent.Node) {
  2036. return false
  2037. }
  2038. }
  2039. return true
  2040. }
  2041. func (e EventUpdateNode) IsEventUpdate() bool {
  2042. return true
  2043. }
  2044. func (e EventUpdateNode) IsEventNode() bool {
  2045. return true
  2046. }
  2047. type EventDeleteNode struct {
  2048. Node *Node
  2049. Checks []NodeCheckFunc
  2050. }
  2051. func (e EventDeleteNode) Matches(apiEvent go_events.Event) bool {
  2052. typedEvent, ok := apiEvent.(EventDeleteNode)
  2053. if !ok {
  2054. return false
  2055. }
  2056. for _, check := range e.Checks {
  2057. if !check(e.Node, typedEvent.Node) {
  2058. return false
  2059. }
  2060. }
  2061. return true
  2062. }
  2063. func (e EventDeleteNode) IsEventDelete() bool {
  2064. return true
  2065. }
  2066. func (e EventDeleteNode) IsEventNode() bool {
  2067. return true
  2068. }
  2069. func (m *Node) CopyStoreObject() StoreObject {
  2070. return m.Copy()
  2071. }
  2072. func (m *Node) GetMeta() Meta {
  2073. return m.Meta
  2074. }
  2075. func (m *Node) SetMeta(meta Meta) {
  2076. m.Meta = meta
  2077. }
  2078. func (m *Node) GetID() string {
  2079. return m.ID
  2080. }
  2081. func (m *Node) EventCreate() Event {
  2082. return EventCreateNode{Node: m}
  2083. }
  2084. func (m *Node) EventUpdate(oldObject StoreObject) Event {
  2085. if oldObject != nil {
  2086. return EventUpdateNode{Node: m, OldNode: oldObject.(*Node)}
  2087. } else {
  2088. return EventUpdateNode{Node: m}
  2089. }
  2090. }
  2091. func (m *Node) EventDelete() Event {
  2092. return EventDeleteNode{Node: m}
  2093. }
  2094. func NodeCheckID(v1, v2 *Node) bool {
  2095. return v1.ID == v2.ID
  2096. }
  2097. func NodeCheckIDPrefix(v1, v2 *Node) bool {
  2098. return strings.HasPrefix(v2.ID, v1.ID)
  2099. }
  2100. func NodeCheckName(v1, v2 *Node) bool {
  2101. if v1.Description == nil || v2.Description == nil {
  2102. return false
  2103. }
  2104. return v1.Description.Hostname == v2.Description.Hostname
  2105. }
  2106. func NodeCheckNamePrefix(v1, v2 *Node) bool {
  2107. if v1.Description == nil || v2.Description == nil {
  2108. return false
  2109. }
  2110. return strings.HasPrefix(v2.Description.Hostname, v1.Description.Hostname)
  2111. }
  2112. func NodeCheckCustom(v1, v2 *Node) bool {
  2113. return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations)
  2114. }
  2115. func NodeCheckCustomPrefix(v1, v2 *Node) bool {
  2116. return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations)
  2117. }
  2118. func NodeCheckRole(v1, v2 *Node) bool {
  2119. return v1.Role == v2.Role
  2120. }
  2121. func NodeCheckMembership(v1, v2 *Node) bool {
  2122. return v1.Spec.Membership == v2.Spec.Membership
  2123. }
  2124. func ConvertNodeWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
  2125. var (
  2126. m Node
  2127. checkFuncs []NodeCheckFunc
  2128. hasRole bool
  2129. hasMembership bool
  2130. )
  2131. for _, filter := range filters {
  2132. switch v := filter.By.(type) {
  2133. case *SelectBy_ID:
  2134. if m.ID != "" {
  2135. return nil, errConflictingFilters
  2136. }
  2137. m.ID = v.ID
  2138. checkFuncs = append(checkFuncs, NodeCheckID)
  2139. case *SelectBy_IDPrefix:
  2140. if m.ID != "" {
  2141. return nil, errConflictingFilters
  2142. }
  2143. m.ID = v.IDPrefix
  2144. checkFuncs = append(checkFuncs, NodeCheckIDPrefix)
  2145. case *SelectBy_Name:
  2146. if m.Description != nil {
  2147. return nil, errConflictingFilters
  2148. }
  2149. m.Description = &NodeDescription{Hostname: v.Name}
  2150. checkFuncs = append(checkFuncs, NodeCheckName)
  2151. case *SelectBy_NamePrefix:
  2152. if m.Description != nil {
  2153. return nil, errConflictingFilters
  2154. }
  2155. m.Description = &NodeDescription{Hostname: v.NamePrefix}
  2156. checkFuncs = append(checkFuncs, NodeCheckNamePrefix)
  2157. case *SelectBy_Custom:
  2158. if len(m.Spec.Annotations.Indices) != 0 {
  2159. return nil, errConflictingFilters
  2160. }
  2161. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}}
  2162. checkFuncs = append(checkFuncs, NodeCheckCustom)
  2163. case *SelectBy_CustomPrefix:
  2164. if len(m.Spec.Annotations.Indices) != 0 {
  2165. return nil, errConflictingFilters
  2166. }
  2167. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}}
  2168. checkFuncs = append(checkFuncs, NodeCheckCustomPrefix)
  2169. case *SelectBy_Role:
  2170. if hasRole {
  2171. return nil, errConflictingFilters
  2172. }
  2173. hasRole = true
  2174. m.Role = v.Role
  2175. checkFuncs = append(checkFuncs, NodeCheckRole)
  2176. case *SelectBy_Membership:
  2177. if hasMembership {
  2178. return nil, errConflictingFilters
  2179. }
  2180. hasMembership = true
  2181. m.Spec.Membership = v.Membership
  2182. checkFuncs = append(checkFuncs, NodeCheckMembership)
  2183. }
  2184. }
  2185. var events []Event
  2186. if (action & WatchActionKindCreate) != 0 {
  2187. events = append(events, EventCreateNode{Node: &m, Checks: checkFuncs})
  2188. }
  2189. if (action & WatchActionKindUpdate) != 0 {
  2190. events = append(events, EventUpdateNode{Node: &m, Checks: checkFuncs})
  2191. }
  2192. if (action & WatchActionKindRemove) != 0 {
  2193. events = append(events, EventDeleteNode{Node: &m, Checks: checkFuncs})
  2194. }
  2195. if len(events) == 0 {
  2196. return nil, errUnrecognizedAction
  2197. }
  2198. return events, nil
  2199. }
  2200. type NodeIndexerByID struct{}
  2201. func (indexer NodeIndexerByID) FromArgs(args ...interface{}) ([]byte, error) {
  2202. return fromArgs(args...)
  2203. }
  2204. func (indexer NodeIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2205. return prefixFromArgs(args...)
  2206. }
  2207. func (indexer NodeIndexerByID) FromObject(obj interface{}) (bool, []byte, error) {
  2208. m := obj.(*Node)
  2209. return true, []byte(m.ID + "\x00"), nil
  2210. }
  2211. type NodeIndexerByName struct{}
  2212. func (indexer NodeIndexerByName) FromArgs(args ...interface{}) ([]byte, error) {
  2213. return fromArgs(args...)
  2214. }
  2215. func (indexer NodeIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2216. return prefixFromArgs(args...)
  2217. }
  2218. func (indexer NodeIndexerByName) FromObject(obj interface{}) (bool, []byte, error) {
  2219. m := obj.(*Node)
  2220. val := m.Spec.Annotations.Name
  2221. return true, []byte(strings.ToLower(val) + "\x00"), nil
  2222. }
  2223. type NodeCustomIndexer struct{}
  2224. func (indexer NodeCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) {
  2225. return fromArgs(args...)
  2226. }
  2227. func (indexer NodeCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2228. return prefixFromArgs(args...)
  2229. }
  2230. func (indexer NodeCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) {
  2231. m := obj.(*Node)
  2232. return customIndexer("", &m.Spec.Annotations)
  2233. }
  2234. type ServiceCheckFunc func(t1, t2 *Service) bool
  2235. type EventService interface {
  2236. IsEventService() bool
  2237. }
  2238. type EventCreateService struct {
  2239. Service *Service
  2240. Checks []ServiceCheckFunc
  2241. }
  2242. func (e EventCreateService) Matches(apiEvent go_events.Event) bool {
  2243. typedEvent, ok := apiEvent.(EventCreateService)
  2244. if !ok {
  2245. return false
  2246. }
  2247. for _, check := range e.Checks {
  2248. if !check(e.Service, typedEvent.Service) {
  2249. return false
  2250. }
  2251. }
  2252. return true
  2253. }
  2254. func (e EventCreateService) IsEventCreate() bool {
  2255. return true
  2256. }
  2257. func (e EventCreateService) IsEventService() bool {
  2258. return true
  2259. }
  2260. type EventUpdateService struct {
  2261. Service *Service
  2262. OldService *Service
  2263. Checks []ServiceCheckFunc
  2264. }
  2265. func (e EventUpdateService) Matches(apiEvent go_events.Event) bool {
  2266. typedEvent, ok := apiEvent.(EventUpdateService)
  2267. if !ok {
  2268. return false
  2269. }
  2270. for _, check := range e.Checks {
  2271. if !check(e.Service, typedEvent.Service) {
  2272. return false
  2273. }
  2274. }
  2275. return true
  2276. }
  2277. func (e EventUpdateService) IsEventUpdate() bool {
  2278. return true
  2279. }
  2280. func (e EventUpdateService) IsEventService() bool {
  2281. return true
  2282. }
  2283. type EventDeleteService struct {
  2284. Service *Service
  2285. Checks []ServiceCheckFunc
  2286. }
  2287. func (e EventDeleteService) Matches(apiEvent go_events.Event) bool {
  2288. typedEvent, ok := apiEvent.(EventDeleteService)
  2289. if !ok {
  2290. return false
  2291. }
  2292. for _, check := range e.Checks {
  2293. if !check(e.Service, typedEvent.Service) {
  2294. return false
  2295. }
  2296. }
  2297. return true
  2298. }
  2299. func (e EventDeleteService) IsEventDelete() bool {
  2300. return true
  2301. }
  2302. func (e EventDeleteService) IsEventService() bool {
  2303. return true
  2304. }
  2305. func (m *Service) CopyStoreObject() StoreObject {
  2306. return m.Copy()
  2307. }
  2308. func (m *Service) GetMeta() Meta {
  2309. return m.Meta
  2310. }
  2311. func (m *Service) SetMeta(meta Meta) {
  2312. m.Meta = meta
  2313. }
  2314. func (m *Service) GetID() string {
  2315. return m.ID
  2316. }
  2317. func (m *Service) EventCreate() Event {
  2318. return EventCreateService{Service: m}
  2319. }
  2320. func (m *Service) EventUpdate(oldObject StoreObject) Event {
  2321. if oldObject != nil {
  2322. return EventUpdateService{Service: m, OldService: oldObject.(*Service)}
  2323. } else {
  2324. return EventUpdateService{Service: m}
  2325. }
  2326. }
  2327. func (m *Service) EventDelete() Event {
  2328. return EventDeleteService{Service: m}
  2329. }
  2330. func ServiceCheckID(v1, v2 *Service) bool {
  2331. return v1.ID == v2.ID
  2332. }
  2333. func ServiceCheckIDPrefix(v1, v2 *Service) bool {
  2334. return strings.HasPrefix(v2.ID, v1.ID)
  2335. }
  2336. func ServiceCheckName(v1, v2 *Service) bool {
  2337. return v1.Spec.Annotations.Name == v2.Spec.Annotations.Name
  2338. }
  2339. func ServiceCheckNamePrefix(v1, v2 *Service) bool {
  2340. return strings.HasPrefix(v2.Spec.Annotations.Name, v1.Spec.Annotations.Name)
  2341. }
  2342. func ServiceCheckCustom(v1, v2 *Service) bool {
  2343. return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations)
  2344. }
  2345. func ServiceCheckCustomPrefix(v1, v2 *Service) bool {
  2346. return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations)
  2347. }
  2348. func ConvertServiceWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
  2349. var (
  2350. m Service
  2351. checkFuncs []ServiceCheckFunc
  2352. )
  2353. for _, filter := range filters {
  2354. switch v := filter.By.(type) {
  2355. case *SelectBy_ID:
  2356. if m.ID != "" {
  2357. return nil, errConflictingFilters
  2358. }
  2359. m.ID = v.ID
  2360. checkFuncs = append(checkFuncs, ServiceCheckID)
  2361. case *SelectBy_IDPrefix:
  2362. if m.ID != "" {
  2363. return nil, errConflictingFilters
  2364. }
  2365. m.ID = v.IDPrefix
  2366. checkFuncs = append(checkFuncs, ServiceCheckIDPrefix)
  2367. case *SelectBy_Name:
  2368. if m.Spec.Annotations.Name != "" {
  2369. return nil, errConflictingFilters
  2370. }
  2371. m.Spec.Annotations.Name = v.Name
  2372. checkFuncs = append(checkFuncs, ServiceCheckName)
  2373. case *SelectBy_NamePrefix:
  2374. if m.Spec.Annotations.Name != "" {
  2375. return nil, errConflictingFilters
  2376. }
  2377. m.Spec.Annotations.Name = v.NamePrefix
  2378. checkFuncs = append(checkFuncs, ServiceCheckNamePrefix)
  2379. case *SelectBy_Custom:
  2380. if len(m.Spec.Annotations.Indices) != 0 {
  2381. return nil, errConflictingFilters
  2382. }
  2383. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}}
  2384. checkFuncs = append(checkFuncs, ServiceCheckCustom)
  2385. case *SelectBy_CustomPrefix:
  2386. if len(m.Spec.Annotations.Indices) != 0 {
  2387. return nil, errConflictingFilters
  2388. }
  2389. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}}
  2390. checkFuncs = append(checkFuncs, ServiceCheckCustomPrefix)
  2391. }
  2392. }
  2393. var events []Event
  2394. if (action & WatchActionKindCreate) != 0 {
  2395. events = append(events, EventCreateService{Service: &m, Checks: checkFuncs})
  2396. }
  2397. if (action & WatchActionKindUpdate) != 0 {
  2398. events = append(events, EventUpdateService{Service: &m, Checks: checkFuncs})
  2399. }
  2400. if (action & WatchActionKindRemove) != 0 {
  2401. events = append(events, EventDeleteService{Service: &m, Checks: checkFuncs})
  2402. }
  2403. if len(events) == 0 {
  2404. return nil, errUnrecognizedAction
  2405. }
  2406. return events, nil
  2407. }
  2408. type ServiceIndexerByID struct{}
  2409. func (indexer ServiceIndexerByID) FromArgs(args ...interface{}) ([]byte, error) {
  2410. return fromArgs(args...)
  2411. }
  2412. func (indexer ServiceIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2413. return prefixFromArgs(args...)
  2414. }
  2415. func (indexer ServiceIndexerByID) FromObject(obj interface{}) (bool, []byte, error) {
  2416. m := obj.(*Service)
  2417. return true, []byte(m.ID + "\x00"), nil
  2418. }
  2419. type ServiceIndexerByName struct{}
  2420. func (indexer ServiceIndexerByName) FromArgs(args ...interface{}) ([]byte, error) {
  2421. return fromArgs(args...)
  2422. }
  2423. func (indexer ServiceIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2424. return prefixFromArgs(args...)
  2425. }
  2426. func (indexer ServiceIndexerByName) FromObject(obj interface{}) (bool, []byte, error) {
  2427. m := obj.(*Service)
  2428. val := m.Spec.Annotations.Name
  2429. return true, []byte(strings.ToLower(val) + "\x00"), nil
  2430. }
  2431. type ServiceCustomIndexer struct{}
  2432. func (indexer ServiceCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) {
  2433. return fromArgs(args...)
  2434. }
  2435. func (indexer ServiceCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2436. return prefixFromArgs(args...)
  2437. }
  2438. func (indexer ServiceCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) {
  2439. m := obj.(*Service)
  2440. return customIndexer("", &m.Spec.Annotations)
  2441. }
  2442. type TaskCheckFunc func(t1, t2 *Task) bool
  2443. type EventTask interface {
  2444. IsEventTask() bool
  2445. }
  2446. type EventCreateTask struct {
  2447. Task *Task
  2448. Checks []TaskCheckFunc
  2449. }
  2450. func (e EventCreateTask) Matches(apiEvent go_events.Event) bool {
  2451. typedEvent, ok := apiEvent.(EventCreateTask)
  2452. if !ok {
  2453. return false
  2454. }
  2455. for _, check := range e.Checks {
  2456. if !check(e.Task, typedEvent.Task) {
  2457. return false
  2458. }
  2459. }
  2460. return true
  2461. }
  2462. func (e EventCreateTask) IsEventCreate() bool {
  2463. return true
  2464. }
  2465. func (e EventCreateTask) IsEventTask() bool {
  2466. return true
  2467. }
  2468. type EventUpdateTask struct {
  2469. Task *Task
  2470. OldTask *Task
  2471. Checks []TaskCheckFunc
  2472. }
  2473. func (e EventUpdateTask) Matches(apiEvent go_events.Event) bool {
  2474. typedEvent, ok := apiEvent.(EventUpdateTask)
  2475. if !ok {
  2476. return false
  2477. }
  2478. for _, check := range e.Checks {
  2479. if !check(e.Task, typedEvent.Task) {
  2480. return false
  2481. }
  2482. }
  2483. return true
  2484. }
  2485. func (e EventUpdateTask) IsEventUpdate() bool {
  2486. return true
  2487. }
  2488. func (e EventUpdateTask) IsEventTask() bool {
  2489. return true
  2490. }
  2491. type EventDeleteTask struct {
  2492. Task *Task
  2493. Checks []TaskCheckFunc
  2494. }
  2495. func (e EventDeleteTask) Matches(apiEvent go_events.Event) bool {
  2496. typedEvent, ok := apiEvent.(EventDeleteTask)
  2497. if !ok {
  2498. return false
  2499. }
  2500. for _, check := range e.Checks {
  2501. if !check(e.Task, typedEvent.Task) {
  2502. return false
  2503. }
  2504. }
  2505. return true
  2506. }
  2507. func (e EventDeleteTask) IsEventDelete() bool {
  2508. return true
  2509. }
  2510. func (e EventDeleteTask) IsEventTask() bool {
  2511. return true
  2512. }
  2513. func (m *Task) CopyStoreObject() StoreObject {
  2514. return m.Copy()
  2515. }
  2516. func (m *Task) GetMeta() Meta {
  2517. return m.Meta
  2518. }
  2519. func (m *Task) SetMeta(meta Meta) {
  2520. m.Meta = meta
  2521. }
  2522. func (m *Task) GetID() string {
  2523. return m.ID
  2524. }
  2525. func (m *Task) EventCreate() Event {
  2526. return EventCreateTask{Task: m}
  2527. }
  2528. func (m *Task) EventUpdate(oldObject StoreObject) Event {
  2529. if oldObject != nil {
  2530. return EventUpdateTask{Task: m, OldTask: oldObject.(*Task)}
  2531. } else {
  2532. return EventUpdateTask{Task: m}
  2533. }
  2534. }
  2535. func (m *Task) EventDelete() Event {
  2536. return EventDeleteTask{Task: m}
  2537. }
  2538. func TaskCheckID(v1, v2 *Task) bool {
  2539. return v1.ID == v2.ID
  2540. }
  2541. func TaskCheckIDPrefix(v1, v2 *Task) bool {
  2542. return strings.HasPrefix(v2.ID, v1.ID)
  2543. }
  2544. func TaskCheckName(v1, v2 *Task) bool {
  2545. return v1.Annotations.Name == v2.Annotations.Name
  2546. }
  2547. func TaskCheckNamePrefix(v1, v2 *Task) bool {
  2548. return strings.HasPrefix(v2.Annotations.Name, v1.Annotations.Name)
  2549. }
  2550. func TaskCheckCustom(v1, v2 *Task) bool {
  2551. return checkCustom(v1.Annotations, v2.Annotations)
  2552. }
  2553. func TaskCheckCustomPrefix(v1, v2 *Task) bool {
  2554. return checkCustomPrefix(v1.Annotations, v2.Annotations)
  2555. }
  2556. func TaskCheckNodeID(v1, v2 *Task) bool {
  2557. return v1.NodeID == v2.NodeID
  2558. }
  2559. func TaskCheckServiceID(v1, v2 *Task) bool {
  2560. return v1.ServiceID == v2.ServiceID
  2561. }
  2562. func TaskCheckSlot(v1, v2 *Task) bool {
  2563. return v1.Slot == v2.Slot
  2564. }
  2565. func TaskCheckDesiredState(v1, v2 *Task) bool {
  2566. return v1.DesiredState == v2.DesiredState
  2567. }
  2568. func ConvertTaskWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
  2569. var (
  2570. m Task
  2571. checkFuncs []TaskCheckFunc
  2572. hasDesiredState bool
  2573. )
  2574. for _, filter := range filters {
  2575. switch v := filter.By.(type) {
  2576. case *SelectBy_ID:
  2577. if m.ID != "" {
  2578. return nil, errConflictingFilters
  2579. }
  2580. m.ID = v.ID
  2581. checkFuncs = append(checkFuncs, TaskCheckID)
  2582. case *SelectBy_IDPrefix:
  2583. if m.ID != "" {
  2584. return nil, errConflictingFilters
  2585. }
  2586. m.ID = v.IDPrefix
  2587. checkFuncs = append(checkFuncs, TaskCheckIDPrefix)
  2588. case *SelectBy_Name:
  2589. if m.Annotations.Name != "" {
  2590. return nil, errConflictingFilters
  2591. }
  2592. m.Annotations.Name = v.Name
  2593. checkFuncs = append(checkFuncs, TaskCheckName)
  2594. case *SelectBy_NamePrefix:
  2595. if m.Annotations.Name != "" {
  2596. return nil, errConflictingFilters
  2597. }
  2598. m.Annotations.Name = v.NamePrefix
  2599. checkFuncs = append(checkFuncs, TaskCheckNamePrefix)
  2600. case *SelectBy_Custom:
  2601. if len(m.Annotations.Indices) != 0 {
  2602. return nil, errConflictingFilters
  2603. }
  2604. m.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}}
  2605. checkFuncs = append(checkFuncs, TaskCheckCustom)
  2606. case *SelectBy_CustomPrefix:
  2607. if len(m.Annotations.Indices) != 0 {
  2608. return nil, errConflictingFilters
  2609. }
  2610. m.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}}
  2611. checkFuncs = append(checkFuncs, TaskCheckCustomPrefix)
  2612. case *SelectBy_ServiceID:
  2613. if m.ServiceID != "" {
  2614. return nil, errConflictingFilters
  2615. }
  2616. m.ServiceID = v.ServiceID
  2617. checkFuncs = append(checkFuncs, TaskCheckServiceID)
  2618. case *SelectBy_NodeID:
  2619. if m.NodeID != "" {
  2620. return nil, errConflictingFilters
  2621. }
  2622. m.NodeID = v.NodeID
  2623. checkFuncs = append(checkFuncs, TaskCheckNodeID)
  2624. case *SelectBy_Slot:
  2625. if m.Slot != 0 || m.ServiceID != "" {
  2626. return nil, errConflictingFilters
  2627. }
  2628. m.ServiceID = v.Slot.ServiceID
  2629. m.Slot = v.Slot.Slot
  2630. checkFuncs = append(checkFuncs, TaskCheckNodeID, TaskCheckSlot)
  2631. case *SelectBy_DesiredState:
  2632. if hasDesiredState {
  2633. return nil, errConflictingFilters
  2634. }
  2635. hasDesiredState = true
  2636. m.DesiredState = v.DesiredState
  2637. checkFuncs = append(checkFuncs, TaskCheckDesiredState)
  2638. }
  2639. }
  2640. var events []Event
  2641. if (action & WatchActionKindCreate) != 0 {
  2642. events = append(events, EventCreateTask{Task: &m, Checks: checkFuncs})
  2643. }
  2644. if (action & WatchActionKindUpdate) != 0 {
  2645. events = append(events, EventUpdateTask{Task: &m, Checks: checkFuncs})
  2646. }
  2647. if (action & WatchActionKindRemove) != 0 {
  2648. events = append(events, EventDeleteTask{Task: &m, Checks: checkFuncs})
  2649. }
  2650. if len(events) == 0 {
  2651. return nil, errUnrecognizedAction
  2652. }
  2653. return events, nil
  2654. }
  2655. type TaskIndexerByID struct{}
  2656. func (indexer TaskIndexerByID) FromArgs(args ...interface{}) ([]byte, error) {
  2657. return fromArgs(args...)
  2658. }
  2659. func (indexer TaskIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2660. return prefixFromArgs(args...)
  2661. }
  2662. func (indexer TaskIndexerByID) FromObject(obj interface{}) (bool, []byte, error) {
  2663. m := obj.(*Task)
  2664. return true, []byte(m.ID + "\x00"), nil
  2665. }
  2666. type TaskIndexerByName struct{}
  2667. func (indexer TaskIndexerByName) FromArgs(args ...interface{}) ([]byte, error) {
  2668. return fromArgs(args...)
  2669. }
  2670. func (indexer TaskIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2671. return prefixFromArgs(args...)
  2672. }
  2673. func (indexer TaskIndexerByName) FromObject(obj interface{}) (bool, []byte, error) {
  2674. m := obj.(*Task)
  2675. val := m.Annotations.Name
  2676. return true, []byte(strings.ToLower(val) + "\x00"), nil
  2677. }
  2678. type TaskCustomIndexer struct{}
  2679. func (indexer TaskCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) {
  2680. return fromArgs(args...)
  2681. }
  2682. func (indexer TaskCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2683. return prefixFromArgs(args...)
  2684. }
  2685. func (indexer TaskCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) {
  2686. m := obj.(*Task)
  2687. return customIndexer("", &m.Annotations)
  2688. }
  2689. type NetworkCheckFunc func(t1, t2 *Network) bool
  2690. type EventNetwork interface {
  2691. IsEventNetwork() bool
  2692. }
  2693. type EventCreateNetwork struct {
  2694. Network *Network
  2695. Checks []NetworkCheckFunc
  2696. }
  2697. func (e EventCreateNetwork) Matches(apiEvent go_events.Event) bool {
  2698. typedEvent, ok := apiEvent.(EventCreateNetwork)
  2699. if !ok {
  2700. return false
  2701. }
  2702. for _, check := range e.Checks {
  2703. if !check(e.Network, typedEvent.Network) {
  2704. return false
  2705. }
  2706. }
  2707. return true
  2708. }
  2709. func (e EventCreateNetwork) IsEventCreate() bool {
  2710. return true
  2711. }
  2712. func (e EventCreateNetwork) IsEventNetwork() bool {
  2713. return true
  2714. }
  2715. type EventUpdateNetwork struct {
  2716. Network *Network
  2717. OldNetwork *Network
  2718. Checks []NetworkCheckFunc
  2719. }
  2720. func (e EventUpdateNetwork) Matches(apiEvent go_events.Event) bool {
  2721. typedEvent, ok := apiEvent.(EventUpdateNetwork)
  2722. if !ok {
  2723. return false
  2724. }
  2725. for _, check := range e.Checks {
  2726. if !check(e.Network, typedEvent.Network) {
  2727. return false
  2728. }
  2729. }
  2730. return true
  2731. }
  2732. func (e EventUpdateNetwork) IsEventUpdate() bool {
  2733. return true
  2734. }
  2735. func (e EventUpdateNetwork) IsEventNetwork() bool {
  2736. return true
  2737. }
  2738. type EventDeleteNetwork struct {
  2739. Network *Network
  2740. Checks []NetworkCheckFunc
  2741. }
  2742. func (e EventDeleteNetwork) Matches(apiEvent go_events.Event) bool {
  2743. typedEvent, ok := apiEvent.(EventDeleteNetwork)
  2744. if !ok {
  2745. return false
  2746. }
  2747. for _, check := range e.Checks {
  2748. if !check(e.Network, typedEvent.Network) {
  2749. return false
  2750. }
  2751. }
  2752. return true
  2753. }
  2754. func (e EventDeleteNetwork) IsEventDelete() bool {
  2755. return true
  2756. }
  2757. func (e EventDeleteNetwork) IsEventNetwork() bool {
  2758. return true
  2759. }
  2760. func (m *Network) CopyStoreObject() StoreObject {
  2761. return m.Copy()
  2762. }
  2763. func (m *Network) GetMeta() Meta {
  2764. return m.Meta
  2765. }
  2766. func (m *Network) SetMeta(meta Meta) {
  2767. m.Meta = meta
  2768. }
  2769. func (m *Network) GetID() string {
  2770. return m.ID
  2771. }
  2772. func (m *Network) EventCreate() Event {
  2773. return EventCreateNetwork{Network: m}
  2774. }
  2775. func (m *Network) EventUpdate(oldObject StoreObject) Event {
  2776. if oldObject != nil {
  2777. return EventUpdateNetwork{Network: m, OldNetwork: oldObject.(*Network)}
  2778. } else {
  2779. return EventUpdateNetwork{Network: m}
  2780. }
  2781. }
  2782. func (m *Network) EventDelete() Event {
  2783. return EventDeleteNetwork{Network: m}
  2784. }
  2785. func NetworkCheckID(v1, v2 *Network) bool {
  2786. return v1.ID == v2.ID
  2787. }
  2788. func NetworkCheckIDPrefix(v1, v2 *Network) bool {
  2789. return strings.HasPrefix(v2.ID, v1.ID)
  2790. }
  2791. func NetworkCheckName(v1, v2 *Network) bool {
  2792. return v1.Spec.Annotations.Name == v2.Spec.Annotations.Name
  2793. }
  2794. func NetworkCheckNamePrefix(v1, v2 *Network) bool {
  2795. return strings.HasPrefix(v2.Spec.Annotations.Name, v1.Spec.Annotations.Name)
  2796. }
  2797. func NetworkCheckCustom(v1, v2 *Network) bool {
  2798. return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations)
  2799. }
  2800. func NetworkCheckCustomPrefix(v1, v2 *Network) bool {
  2801. return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations)
  2802. }
  2803. func ConvertNetworkWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
  2804. var (
  2805. m Network
  2806. checkFuncs []NetworkCheckFunc
  2807. )
  2808. for _, filter := range filters {
  2809. switch v := filter.By.(type) {
  2810. case *SelectBy_ID:
  2811. if m.ID != "" {
  2812. return nil, errConflictingFilters
  2813. }
  2814. m.ID = v.ID
  2815. checkFuncs = append(checkFuncs, NetworkCheckID)
  2816. case *SelectBy_IDPrefix:
  2817. if m.ID != "" {
  2818. return nil, errConflictingFilters
  2819. }
  2820. m.ID = v.IDPrefix
  2821. checkFuncs = append(checkFuncs, NetworkCheckIDPrefix)
  2822. case *SelectBy_Name:
  2823. if m.Spec.Annotations.Name != "" {
  2824. return nil, errConflictingFilters
  2825. }
  2826. m.Spec.Annotations.Name = v.Name
  2827. checkFuncs = append(checkFuncs, NetworkCheckName)
  2828. case *SelectBy_NamePrefix:
  2829. if m.Spec.Annotations.Name != "" {
  2830. return nil, errConflictingFilters
  2831. }
  2832. m.Spec.Annotations.Name = v.NamePrefix
  2833. checkFuncs = append(checkFuncs, NetworkCheckNamePrefix)
  2834. case *SelectBy_Custom:
  2835. if len(m.Spec.Annotations.Indices) != 0 {
  2836. return nil, errConflictingFilters
  2837. }
  2838. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}}
  2839. checkFuncs = append(checkFuncs, NetworkCheckCustom)
  2840. case *SelectBy_CustomPrefix:
  2841. if len(m.Spec.Annotations.Indices) != 0 {
  2842. return nil, errConflictingFilters
  2843. }
  2844. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}}
  2845. checkFuncs = append(checkFuncs, NetworkCheckCustomPrefix)
  2846. }
  2847. }
  2848. var events []Event
  2849. if (action & WatchActionKindCreate) != 0 {
  2850. events = append(events, EventCreateNetwork{Network: &m, Checks: checkFuncs})
  2851. }
  2852. if (action & WatchActionKindUpdate) != 0 {
  2853. events = append(events, EventUpdateNetwork{Network: &m, Checks: checkFuncs})
  2854. }
  2855. if (action & WatchActionKindRemove) != 0 {
  2856. events = append(events, EventDeleteNetwork{Network: &m, Checks: checkFuncs})
  2857. }
  2858. if len(events) == 0 {
  2859. return nil, errUnrecognizedAction
  2860. }
  2861. return events, nil
  2862. }
  2863. type NetworkIndexerByID struct{}
  2864. func (indexer NetworkIndexerByID) FromArgs(args ...interface{}) ([]byte, error) {
  2865. return fromArgs(args...)
  2866. }
  2867. func (indexer NetworkIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2868. return prefixFromArgs(args...)
  2869. }
  2870. func (indexer NetworkIndexerByID) FromObject(obj interface{}) (bool, []byte, error) {
  2871. m := obj.(*Network)
  2872. return true, []byte(m.ID + "\x00"), nil
  2873. }
  2874. type NetworkIndexerByName struct{}
  2875. func (indexer NetworkIndexerByName) FromArgs(args ...interface{}) ([]byte, error) {
  2876. return fromArgs(args...)
  2877. }
  2878. func (indexer NetworkIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2879. return prefixFromArgs(args...)
  2880. }
  2881. func (indexer NetworkIndexerByName) FromObject(obj interface{}) (bool, []byte, error) {
  2882. m := obj.(*Network)
  2883. val := m.Spec.Annotations.Name
  2884. return true, []byte(strings.ToLower(val) + "\x00"), nil
  2885. }
  2886. type NetworkCustomIndexer struct{}
  2887. func (indexer NetworkCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) {
  2888. return fromArgs(args...)
  2889. }
  2890. func (indexer NetworkCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  2891. return prefixFromArgs(args...)
  2892. }
  2893. func (indexer NetworkCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) {
  2894. m := obj.(*Network)
  2895. return customIndexer("", &m.Spec.Annotations)
  2896. }
  2897. type ClusterCheckFunc func(t1, t2 *Cluster) bool
  2898. type EventCluster interface {
  2899. IsEventCluster() bool
  2900. }
  2901. type EventCreateCluster struct {
  2902. Cluster *Cluster
  2903. Checks []ClusterCheckFunc
  2904. }
  2905. func (e EventCreateCluster) Matches(apiEvent go_events.Event) bool {
  2906. typedEvent, ok := apiEvent.(EventCreateCluster)
  2907. if !ok {
  2908. return false
  2909. }
  2910. for _, check := range e.Checks {
  2911. if !check(e.Cluster, typedEvent.Cluster) {
  2912. return false
  2913. }
  2914. }
  2915. return true
  2916. }
  2917. func (e EventCreateCluster) IsEventCreate() bool {
  2918. return true
  2919. }
  2920. func (e EventCreateCluster) IsEventCluster() bool {
  2921. return true
  2922. }
  2923. type EventUpdateCluster struct {
  2924. Cluster *Cluster
  2925. OldCluster *Cluster
  2926. Checks []ClusterCheckFunc
  2927. }
  2928. func (e EventUpdateCluster) Matches(apiEvent go_events.Event) bool {
  2929. typedEvent, ok := apiEvent.(EventUpdateCluster)
  2930. if !ok {
  2931. return false
  2932. }
  2933. for _, check := range e.Checks {
  2934. if !check(e.Cluster, typedEvent.Cluster) {
  2935. return false
  2936. }
  2937. }
  2938. return true
  2939. }
  2940. func (e EventUpdateCluster) IsEventUpdate() bool {
  2941. return true
  2942. }
  2943. func (e EventUpdateCluster) IsEventCluster() bool {
  2944. return true
  2945. }
  2946. type EventDeleteCluster struct {
  2947. Cluster *Cluster
  2948. Checks []ClusterCheckFunc
  2949. }
  2950. func (e EventDeleteCluster) Matches(apiEvent go_events.Event) bool {
  2951. typedEvent, ok := apiEvent.(EventDeleteCluster)
  2952. if !ok {
  2953. return false
  2954. }
  2955. for _, check := range e.Checks {
  2956. if !check(e.Cluster, typedEvent.Cluster) {
  2957. return false
  2958. }
  2959. }
  2960. return true
  2961. }
  2962. func (e EventDeleteCluster) IsEventDelete() bool {
  2963. return true
  2964. }
  2965. func (e EventDeleteCluster) IsEventCluster() bool {
  2966. return true
  2967. }
  2968. func (m *Cluster) CopyStoreObject() StoreObject {
  2969. return m.Copy()
  2970. }
  2971. func (m *Cluster) GetMeta() Meta {
  2972. return m.Meta
  2973. }
  2974. func (m *Cluster) SetMeta(meta Meta) {
  2975. m.Meta = meta
  2976. }
  2977. func (m *Cluster) GetID() string {
  2978. return m.ID
  2979. }
  2980. func (m *Cluster) EventCreate() Event {
  2981. return EventCreateCluster{Cluster: m}
  2982. }
  2983. func (m *Cluster) EventUpdate(oldObject StoreObject) Event {
  2984. if oldObject != nil {
  2985. return EventUpdateCluster{Cluster: m, OldCluster: oldObject.(*Cluster)}
  2986. } else {
  2987. return EventUpdateCluster{Cluster: m}
  2988. }
  2989. }
  2990. func (m *Cluster) EventDelete() Event {
  2991. return EventDeleteCluster{Cluster: m}
  2992. }
  2993. func ClusterCheckID(v1, v2 *Cluster) bool {
  2994. return v1.ID == v2.ID
  2995. }
  2996. func ClusterCheckIDPrefix(v1, v2 *Cluster) bool {
  2997. return strings.HasPrefix(v2.ID, v1.ID)
  2998. }
  2999. func ClusterCheckName(v1, v2 *Cluster) bool {
  3000. return v1.Spec.Annotations.Name == v2.Spec.Annotations.Name
  3001. }
  3002. func ClusterCheckNamePrefix(v1, v2 *Cluster) bool {
  3003. return strings.HasPrefix(v2.Spec.Annotations.Name, v1.Spec.Annotations.Name)
  3004. }
  3005. func ClusterCheckCustom(v1, v2 *Cluster) bool {
  3006. return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations)
  3007. }
  3008. func ClusterCheckCustomPrefix(v1, v2 *Cluster) bool {
  3009. return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations)
  3010. }
  3011. func ConvertClusterWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
  3012. var (
  3013. m Cluster
  3014. checkFuncs []ClusterCheckFunc
  3015. )
  3016. for _, filter := range filters {
  3017. switch v := filter.By.(type) {
  3018. case *SelectBy_ID:
  3019. if m.ID != "" {
  3020. return nil, errConflictingFilters
  3021. }
  3022. m.ID = v.ID
  3023. checkFuncs = append(checkFuncs, ClusterCheckID)
  3024. case *SelectBy_IDPrefix:
  3025. if m.ID != "" {
  3026. return nil, errConflictingFilters
  3027. }
  3028. m.ID = v.IDPrefix
  3029. checkFuncs = append(checkFuncs, ClusterCheckIDPrefix)
  3030. case *SelectBy_Name:
  3031. if m.Spec.Annotations.Name != "" {
  3032. return nil, errConflictingFilters
  3033. }
  3034. m.Spec.Annotations.Name = v.Name
  3035. checkFuncs = append(checkFuncs, ClusterCheckName)
  3036. case *SelectBy_NamePrefix:
  3037. if m.Spec.Annotations.Name != "" {
  3038. return nil, errConflictingFilters
  3039. }
  3040. m.Spec.Annotations.Name = v.NamePrefix
  3041. checkFuncs = append(checkFuncs, ClusterCheckNamePrefix)
  3042. case *SelectBy_Custom:
  3043. if len(m.Spec.Annotations.Indices) != 0 {
  3044. return nil, errConflictingFilters
  3045. }
  3046. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}}
  3047. checkFuncs = append(checkFuncs, ClusterCheckCustom)
  3048. case *SelectBy_CustomPrefix:
  3049. if len(m.Spec.Annotations.Indices) != 0 {
  3050. return nil, errConflictingFilters
  3051. }
  3052. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}}
  3053. checkFuncs = append(checkFuncs, ClusterCheckCustomPrefix)
  3054. }
  3055. }
  3056. var events []Event
  3057. if (action & WatchActionKindCreate) != 0 {
  3058. events = append(events, EventCreateCluster{Cluster: &m, Checks: checkFuncs})
  3059. }
  3060. if (action & WatchActionKindUpdate) != 0 {
  3061. events = append(events, EventUpdateCluster{Cluster: &m, Checks: checkFuncs})
  3062. }
  3063. if (action & WatchActionKindRemove) != 0 {
  3064. events = append(events, EventDeleteCluster{Cluster: &m, Checks: checkFuncs})
  3065. }
  3066. if len(events) == 0 {
  3067. return nil, errUnrecognizedAction
  3068. }
  3069. return events, nil
  3070. }
  3071. type ClusterIndexerByID struct{}
  3072. func (indexer ClusterIndexerByID) FromArgs(args ...interface{}) ([]byte, error) {
  3073. return fromArgs(args...)
  3074. }
  3075. func (indexer ClusterIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3076. return prefixFromArgs(args...)
  3077. }
  3078. func (indexer ClusterIndexerByID) FromObject(obj interface{}) (bool, []byte, error) {
  3079. m := obj.(*Cluster)
  3080. return true, []byte(m.ID + "\x00"), nil
  3081. }
  3082. type ClusterIndexerByName struct{}
  3083. func (indexer ClusterIndexerByName) FromArgs(args ...interface{}) ([]byte, error) {
  3084. return fromArgs(args...)
  3085. }
  3086. func (indexer ClusterIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3087. return prefixFromArgs(args...)
  3088. }
  3089. func (indexer ClusterIndexerByName) FromObject(obj interface{}) (bool, []byte, error) {
  3090. m := obj.(*Cluster)
  3091. val := m.Spec.Annotations.Name
  3092. return true, []byte(strings.ToLower(val) + "\x00"), nil
  3093. }
  3094. type ClusterCustomIndexer struct{}
  3095. func (indexer ClusterCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) {
  3096. return fromArgs(args...)
  3097. }
  3098. func (indexer ClusterCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3099. return prefixFromArgs(args...)
  3100. }
  3101. func (indexer ClusterCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) {
  3102. m := obj.(*Cluster)
  3103. return customIndexer("", &m.Spec.Annotations)
  3104. }
  3105. type SecretCheckFunc func(t1, t2 *Secret) bool
  3106. type EventSecret interface {
  3107. IsEventSecret() bool
  3108. }
  3109. type EventCreateSecret struct {
  3110. Secret *Secret
  3111. Checks []SecretCheckFunc
  3112. }
  3113. func (e EventCreateSecret) Matches(apiEvent go_events.Event) bool {
  3114. typedEvent, ok := apiEvent.(EventCreateSecret)
  3115. if !ok {
  3116. return false
  3117. }
  3118. for _, check := range e.Checks {
  3119. if !check(e.Secret, typedEvent.Secret) {
  3120. return false
  3121. }
  3122. }
  3123. return true
  3124. }
  3125. func (e EventCreateSecret) IsEventCreate() bool {
  3126. return true
  3127. }
  3128. func (e EventCreateSecret) IsEventSecret() bool {
  3129. return true
  3130. }
  3131. type EventUpdateSecret struct {
  3132. Secret *Secret
  3133. OldSecret *Secret
  3134. Checks []SecretCheckFunc
  3135. }
  3136. func (e EventUpdateSecret) Matches(apiEvent go_events.Event) bool {
  3137. typedEvent, ok := apiEvent.(EventUpdateSecret)
  3138. if !ok {
  3139. return false
  3140. }
  3141. for _, check := range e.Checks {
  3142. if !check(e.Secret, typedEvent.Secret) {
  3143. return false
  3144. }
  3145. }
  3146. return true
  3147. }
  3148. func (e EventUpdateSecret) IsEventUpdate() bool {
  3149. return true
  3150. }
  3151. func (e EventUpdateSecret) IsEventSecret() bool {
  3152. return true
  3153. }
  3154. type EventDeleteSecret struct {
  3155. Secret *Secret
  3156. Checks []SecretCheckFunc
  3157. }
  3158. func (e EventDeleteSecret) Matches(apiEvent go_events.Event) bool {
  3159. typedEvent, ok := apiEvent.(EventDeleteSecret)
  3160. if !ok {
  3161. return false
  3162. }
  3163. for _, check := range e.Checks {
  3164. if !check(e.Secret, typedEvent.Secret) {
  3165. return false
  3166. }
  3167. }
  3168. return true
  3169. }
  3170. func (e EventDeleteSecret) IsEventDelete() bool {
  3171. return true
  3172. }
  3173. func (e EventDeleteSecret) IsEventSecret() bool {
  3174. return true
  3175. }
  3176. func (m *Secret) CopyStoreObject() StoreObject {
  3177. return m.Copy()
  3178. }
  3179. func (m *Secret) GetMeta() Meta {
  3180. return m.Meta
  3181. }
  3182. func (m *Secret) SetMeta(meta Meta) {
  3183. m.Meta = meta
  3184. }
  3185. func (m *Secret) GetID() string {
  3186. return m.ID
  3187. }
  3188. func (m *Secret) EventCreate() Event {
  3189. return EventCreateSecret{Secret: m}
  3190. }
  3191. func (m *Secret) EventUpdate(oldObject StoreObject) Event {
  3192. if oldObject != nil {
  3193. return EventUpdateSecret{Secret: m, OldSecret: oldObject.(*Secret)}
  3194. } else {
  3195. return EventUpdateSecret{Secret: m}
  3196. }
  3197. }
  3198. func (m *Secret) EventDelete() Event {
  3199. return EventDeleteSecret{Secret: m}
  3200. }
  3201. func SecretCheckID(v1, v2 *Secret) bool {
  3202. return v1.ID == v2.ID
  3203. }
  3204. func SecretCheckIDPrefix(v1, v2 *Secret) bool {
  3205. return strings.HasPrefix(v2.ID, v1.ID)
  3206. }
  3207. func SecretCheckName(v1, v2 *Secret) bool {
  3208. return v1.Spec.Annotations.Name == v2.Spec.Annotations.Name
  3209. }
  3210. func SecretCheckNamePrefix(v1, v2 *Secret) bool {
  3211. return strings.HasPrefix(v2.Spec.Annotations.Name, v1.Spec.Annotations.Name)
  3212. }
  3213. func SecretCheckCustom(v1, v2 *Secret) bool {
  3214. return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations)
  3215. }
  3216. func SecretCheckCustomPrefix(v1, v2 *Secret) bool {
  3217. return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations)
  3218. }
  3219. func ConvertSecretWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
  3220. var (
  3221. m Secret
  3222. checkFuncs []SecretCheckFunc
  3223. )
  3224. for _, filter := range filters {
  3225. switch v := filter.By.(type) {
  3226. case *SelectBy_ID:
  3227. if m.ID != "" {
  3228. return nil, errConflictingFilters
  3229. }
  3230. m.ID = v.ID
  3231. checkFuncs = append(checkFuncs, SecretCheckID)
  3232. case *SelectBy_IDPrefix:
  3233. if m.ID != "" {
  3234. return nil, errConflictingFilters
  3235. }
  3236. m.ID = v.IDPrefix
  3237. checkFuncs = append(checkFuncs, SecretCheckIDPrefix)
  3238. case *SelectBy_Name:
  3239. if m.Spec.Annotations.Name != "" {
  3240. return nil, errConflictingFilters
  3241. }
  3242. m.Spec.Annotations.Name = v.Name
  3243. checkFuncs = append(checkFuncs, SecretCheckName)
  3244. case *SelectBy_NamePrefix:
  3245. if m.Spec.Annotations.Name != "" {
  3246. return nil, errConflictingFilters
  3247. }
  3248. m.Spec.Annotations.Name = v.NamePrefix
  3249. checkFuncs = append(checkFuncs, SecretCheckNamePrefix)
  3250. case *SelectBy_Custom:
  3251. if len(m.Spec.Annotations.Indices) != 0 {
  3252. return nil, errConflictingFilters
  3253. }
  3254. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}}
  3255. checkFuncs = append(checkFuncs, SecretCheckCustom)
  3256. case *SelectBy_CustomPrefix:
  3257. if len(m.Spec.Annotations.Indices) != 0 {
  3258. return nil, errConflictingFilters
  3259. }
  3260. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}}
  3261. checkFuncs = append(checkFuncs, SecretCheckCustomPrefix)
  3262. }
  3263. }
  3264. var events []Event
  3265. if (action & WatchActionKindCreate) != 0 {
  3266. events = append(events, EventCreateSecret{Secret: &m, Checks: checkFuncs})
  3267. }
  3268. if (action & WatchActionKindUpdate) != 0 {
  3269. events = append(events, EventUpdateSecret{Secret: &m, Checks: checkFuncs})
  3270. }
  3271. if (action & WatchActionKindRemove) != 0 {
  3272. events = append(events, EventDeleteSecret{Secret: &m, Checks: checkFuncs})
  3273. }
  3274. if len(events) == 0 {
  3275. return nil, errUnrecognizedAction
  3276. }
  3277. return events, nil
  3278. }
  3279. type SecretIndexerByID struct{}
  3280. func (indexer SecretIndexerByID) FromArgs(args ...interface{}) ([]byte, error) {
  3281. return fromArgs(args...)
  3282. }
  3283. func (indexer SecretIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3284. return prefixFromArgs(args...)
  3285. }
  3286. func (indexer SecretIndexerByID) FromObject(obj interface{}) (bool, []byte, error) {
  3287. m := obj.(*Secret)
  3288. return true, []byte(m.ID + "\x00"), nil
  3289. }
  3290. type SecretIndexerByName struct{}
  3291. func (indexer SecretIndexerByName) FromArgs(args ...interface{}) ([]byte, error) {
  3292. return fromArgs(args...)
  3293. }
  3294. func (indexer SecretIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3295. return prefixFromArgs(args...)
  3296. }
  3297. func (indexer SecretIndexerByName) FromObject(obj interface{}) (bool, []byte, error) {
  3298. m := obj.(*Secret)
  3299. val := m.Spec.Annotations.Name
  3300. return true, []byte(strings.ToLower(val) + "\x00"), nil
  3301. }
  3302. type SecretCustomIndexer struct{}
  3303. func (indexer SecretCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) {
  3304. return fromArgs(args...)
  3305. }
  3306. func (indexer SecretCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3307. return prefixFromArgs(args...)
  3308. }
  3309. func (indexer SecretCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) {
  3310. m := obj.(*Secret)
  3311. return customIndexer("", &m.Spec.Annotations)
  3312. }
  3313. type ConfigCheckFunc func(t1, t2 *Config) bool
  3314. type EventConfig interface {
  3315. IsEventConfig() bool
  3316. }
  3317. type EventCreateConfig struct {
  3318. Config *Config
  3319. Checks []ConfigCheckFunc
  3320. }
  3321. func (e EventCreateConfig) Matches(apiEvent go_events.Event) bool {
  3322. typedEvent, ok := apiEvent.(EventCreateConfig)
  3323. if !ok {
  3324. return false
  3325. }
  3326. for _, check := range e.Checks {
  3327. if !check(e.Config, typedEvent.Config) {
  3328. return false
  3329. }
  3330. }
  3331. return true
  3332. }
  3333. func (e EventCreateConfig) IsEventCreate() bool {
  3334. return true
  3335. }
  3336. func (e EventCreateConfig) IsEventConfig() bool {
  3337. return true
  3338. }
  3339. type EventUpdateConfig struct {
  3340. Config *Config
  3341. OldConfig *Config
  3342. Checks []ConfigCheckFunc
  3343. }
  3344. func (e EventUpdateConfig) Matches(apiEvent go_events.Event) bool {
  3345. typedEvent, ok := apiEvent.(EventUpdateConfig)
  3346. if !ok {
  3347. return false
  3348. }
  3349. for _, check := range e.Checks {
  3350. if !check(e.Config, typedEvent.Config) {
  3351. return false
  3352. }
  3353. }
  3354. return true
  3355. }
  3356. func (e EventUpdateConfig) IsEventUpdate() bool {
  3357. return true
  3358. }
  3359. func (e EventUpdateConfig) IsEventConfig() bool {
  3360. return true
  3361. }
  3362. type EventDeleteConfig struct {
  3363. Config *Config
  3364. Checks []ConfigCheckFunc
  3365. }
  3366. func (e EventDeleteConfig) Matches(apiEvent go_events.Event) bool {
  3367. typedEvent, ok := apiEvent.(EventDeleteConfig)
  3368. if !ok {
  3369. return false
  3370. }
  3371. for _, check := range e.Checks {
  3372. if !check(e.Config, typedEvent.Config) {
  3373. return false
  3374. }
  3375. }
  3376. return true
  3377. }
  3378. func (e EventDeleteConfig) IsEventDelete() bool {
  3379. return true
  3380. }
  3381. func (e EventDeleteConfig) IsEventConfig() bool {
  3382. return true
  3383. }
  3384. func (m *Config) CopyStoreObject() StoreObject {
  3385. return m.Copy()
  3386. }
  3387. func (m *Config) GetMeta() Meta {
  3388. return m.Meta
  3389. }
  3390. func (m *Config) SetMeta(meta Meta) {
  3391. m.Meta = meta
  3392. }
  3393. func (m *Config) GetID() string {
  3394. return m.ID
  3395. }
  3396. func (m *Config) EventCreate() Event {
  3397. return EventCreateConfig{Config: m}
  3398. }
  3399. func (m *Config) EventUpdate(oldObject StoreObject) Event {
  3400. if oldObject != nil {
  3401. return EventUpdateConfig{Config: m, OldConfig: oldObject.(*Config)}
  3402. } else {
  3403. return EventUpdateConfig{Config: m}
  3404. }
  3405. }
  3406. func (m *Config) EventDelete() Event {
  3407. return EventDeleteConfig{Config: m}
  3408. }
  3409. func ConfigCheckID(v1, v2 *Config) bool {
  3410. return v1.ID == v2.ID
  3411. }
  3412. func ConfigCheckIDPrefix(v1, v2 *Config) bool {
  3413. return strings.HasPrefix(v2.ID, v1.ID)
  3414. }
  3415. func ConfigCheckName(v1, v2 *Config) bool {
  3416. return v1.Spec.Annotations.Name == v2.Spec.Annotations.Name
  3417. }
  3418. func ConfigCheckNamePrefix(v1, v2 *Config) bool {
  3419. return strings.HasPrefix(v2.Spec.Annotations.Name, v1.Spec.Annotations.Name)
  3420. }
  3421. func ConfigCheckCustom(v1, v2 *Config) bool {
  3422. return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations)
  3423. }
  3424. func ConfigCheckCustomPrefix(v1, v2 *Config) bool {
  3425. return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations)
  3426. }
  3427. func ConvertConfigWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
  3428. var (
  3429. m Config
  3430. checkFuncs []ConfigCheckFunc
  3431. )
  3432. for _, filter := range filters {
  3433. switch v := filter.By.(type) {
  3434. case *SelectBy_ID:
  3435. if m.ID != "" {
  3436. return nil, errConflictingFilters
  3437. }
  3438. m.ID = v.ID
  3439. checkFuncs = append(checkFuncs, ConfigCheckID)
  3440. case *SelectBy_IDPrefix:
  3441. if m.ID != "" {
  3442. return nil, errConflictingFilters
  3443. }
  3444. m.ID = v.IDPrefix
  3445. checkFuncs = append(checkFuncs, ConfigCheckIDPrefix)
  3446. case *SelectBy_Name:
  3447. if m.Spec.Annotations.Name != "" {
  3448. return nil, errConflictingFilters
  3449. }
  3450. m.Spec.Annotations.Name = v.Name
  3451. checkFuncs = append(checkFuncs, ConfigCheckName)
  3452. case *SelectBy_NamePrefix:
  3453. if m.Spec.Annotations.Name != "" {
  3454. return nil, errConflictingFilters
  3455. }
  3456. m.Spec.Annotations.Name = v.NamePrefix
  3457. checkFuncs = append(checkFuncs, ConfigCheckNamePrefix)
  3458. case *SelectBy_Custom:
  3459. if len(m.Spec.Annotations.Indices) != 0 {
  3460. return nil, errConflictingFilters
  3461. }
  3462. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}}
  3463. checkFuncs = append(checkFuncs, ConfigCheckCustom)
  3464. case *SelectBy_CustomPrefix:
  3465. if len(m.Spec.Annotations.Indices) != 0 {
  3466. return nil, errConflictingFilters
  3467. }
  3468. m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}}
  3469. checkFuncs = append(checkFuncs, ConfigCheckCustomPrefix)
  3470. }
  3471. }
  3472. var events []Event
  3473. if (action & WatchActionKindCreate) != 0 {
  3474. events = append(events, EventCreateConfig{Config: &m, Checks: checkFuncs})
  3475. }
  3476. if (action & WatchActionKindUpdate) != 0 {
  3477. events = append(events, EventUpdateConfig{Config: &m, Checks: checkFuncs})
  3478. }
  3479. if (action & WatchActionKindRemove) != 0 {
  3480. events = append(events, EventDeleteConfig{Config: &m, Checks: checkFuncs})
  3481. }
  3482. if len(events) == 0 {
  3483. return nil, errUnrecognizedAction
  3484. }
  3485. return events, nil
  3486. }
  3487. type ConfigIndexerByID struct{}
  3488. func (indexer ConfigIndexerByID) FromArgs(args ...interface{}) ([]byte, error) {
  3489. return fromArgs(args...)
  3490. }
  3491. func (indexer ConfigIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3492. return prefixFromArgs(args...)
  3493. }
  3494. func (indexer ConfigIndexerByID) FromObject(obj interface{}) (bool, []byte, error) {
  3495. m := obj.(*Config)
  3496. return true, []byte(m.ID + "\x00"), nil
  3497. }
  3498. type ConfigIndexerByName struct{}
  3499. func (indexer ConfigIndexerByName) FromArgs(args ...interface{}) ([]byte, error) {
  3500. return fromArgs(args...)
  3501. }
  3502. func (indexer ConfigIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3503. return prefixFromArgs(args...)
  3504. }
  3505. func (indexer ConfigIndexerByName) FromObject(obj interface{}) (bool, []byte, error) {
  3506. m := obj.(*Config)
  3507. val := m.Spec.Annotations.Name
  3508. return true, []byte(strings.ToLower(val) + "\x00"), nil
  3509. }
  3510. type ConfigCustomIndexer struct{}
  3511. func (indexer ConfigCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) {
  3512. return fromArgs(args...)
  3513. }
  3514. func (indexer ConfigCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3515. return prefixFromArgs(args...)
  3516. }
  3517. func (indexer ConfigCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) {
  3518. m := obj.(*Config)
  3519. return customIndexer("", &m.Spec.Annotations)
  3520. }
  3521. type ResourceCheckFunc func(t1, t2 *Resource) bool
  3522. type EventResource interface {
  3523. IsEventResource() bool
  3524. }
  3525. type EventCreateResource struct {
  3526. Resource *Resource
  3527. Checks []ResourceCheckFunc
  3528. }
  3529. func (e EventCreateResource) Matches(apiEvent go_events.Event) bool {
  3530. typedEvent, ok := apiEvent.(EventCreateResource)
  3531. if !ok {
  3532. return false
  3533. }
  3534. for _, check := range e.Checks {
  3535. if !check(e.Resource, typedEvent.Resource) {
  3536. return false
  3537. }
  3538. }
  3539. return true
  3540. }
  3541. func (e EventCreateResource) IsEventCreate() bool {
  3542. return true
  3543. }
  3544. func (e EventCreateResource) IsEventResource() bool {
  3545. return true
  3546. }
  3547. type EventUpdateResource struct {
  3548. Resource *Resource
  3549. OldResource *Resource
  3550. Checks []ResourceCheckFunc
  3551. }
  3552. func (e EventUpdateResource) Matches(apiEvent go_events.Event) bool {
  3553. typedEvent, ok := apiEvent.(EventUpdateResource)
  3554. if !ok {
  3555. return false
  3556. }
  3557. for _, check := range e.Checks {
  3558. if !check(e.Resource, typedEvent.Resource) {
  3559. return false
  3560. }
  3561. }
  3562. return true
  3563. }
  3564. func (e EventUpdateResource) IsEventUpdate() bool {
  3565. return true
  3566. }
  3567. func (e EventUpdateResource) IsEventResource() bool {
  3568. return true
  3569. }
  3570. type EventDeleteResource struct {
  3571. Resource *Resource
  3572. Checks []ResourceCheckFunc
  3573. }
  3574. func (e EventDeleteResource) Matches(apiEvent go_events.Event) bool {
  3575. typedEvent, ok := apiEvent.(EventDeleteResource)
  3576. if !ok {
  3577. return false
  3578. }
  3579. for _, check := range e.Checks {
  3580. if !check(e.Resource, typedEvent.Resource) {
  3581. return false
  3582. }
  3583. }
  3584. return true
  3585. }
  3586. func (e EventDeleteResource) IsEventDelete() bool {
  3587. return true
  3588. }
  3589. func (e EventDeleteResource) IsEventResource() bool {
  3590. return true
  3591. }
  3592. func (m *Resource) CopyStoreObject() StoreObject {
  3593. return m.Copy()
  3594. }
  3595. func (m *Resource) GetMeta() Meta {
  3596. return m.Meta
  3597. }
  3598. func (m *Resource) SetMeta(meta Meta) {
  3599. m.Meta = meta
  3600. }
  3601. func (m *Resource) GetID() string {
  3602. return m.ID
  3603. }
  3604. func (m *Resource) EventCreate() Event {
  3605. return EventCreateResource{Resource: m}
  3606. }
  3607. func (m *Resource) EventUpdate(oldObject StoreObject) Event {
  3608. if oldObject != nil {
  3609. return EventUpdateResource{Resource: m, OldResource: oldObject.(*Resource)}
  3610. } else {
  3611. return EventUpdateResource{Resource: m}
  3612. }
  3613. }
  3614. func (m *Resource) EventDelete() Event {
  3615. return EventDeleteResource{Resource: m}
  3616. }
  3617. func ResourceCheckID(v1, v2 *Resource) bool {
  3618. return v1.ID == v2.ID
  3619. }
  3620. func ResourceCheckIDPrefix(v1, v2 *Resource) bool {
  3621. return strings.HasPrefix(v2.ID, v1.ID)
  3622. }
  3623. func ResourceCheckName(v1, v2 *Resource) bool {
  3624. return v1.Annotations.Name == v2.Annotations.Name
  3625. }
  3626. func ResourceCheckNamePrefix(v1, v2 *Resource) bool {
  3627. return strings.HasPrefix(v2.Annotations.Name, v1.Annotations.Name)
  3628. }
  3629. func ResourceCheckCustom(v1, v2 *Resource) bool {
  3630. return checkCustom(v1.Annotations, v2.Annotations)
  3631. }
  3632. func ResourceCheckCustomPrefix(v1, v2 *Resource) bool {
  3633. return checkCustomPrefix(v1.Annotations, v2.Annotations)
  3634. }
  3635. func ResourceCheckKind(v1, v2 *Resource) bool {
  3636. return v1.Kind == v2.Kind
  3637. }
  3638. func ConvertResourceWatch(action WatchActionKind, filters []*SelectBy, kind string) ([]Event, error) {
  3639. var (
  3640. m Resource
  3641. checkFuncs []ResourceCheckFunc
  3642. )
  3643. m.Kind = kind
  3644. checkFuncs = append(checkFuncs, ResourceCheckKind)
  3645. for _, filter := range filters {
  3646. switch v := filter.By.(type) {
  3647. case *SelectBy_ID:
  3648. if m.ID != "" {
  3649. return nil, errConflictingFilters
  3650. }
  3651. m.ID = v.ID
  3652. checkFuncs = append(checkFuncs, ResourceCheckID)
  3653. case *SelectBy_IDPrefix:
  3654. if m.ID != "" {
  3655. return nil, errConflictingFilters
  3656. }
  3657. m.ID = v.IDPrefix
  3658. checkFuncs = append(checkFuncs, ResourceCheckIDPrefix)
  3659. case *SelectBy_Name:
  3660. if m.Annotations.Name != "" {
  3661. return nil, errConflictingFilters
  3662. }
  3663. m.Annotations.Name = v.Name
  3664. checkFuncs = append(checkFuncs, ResourceCheckName)
  3665. case *SelectBy_NamePrefix:
  3666. if m.Annotations.Name != "" {
  3667. return nil, errConflictingFilters
  3668. }
  3669. m.Annotations.Name = v.NamePrefix
  3670. checkFuncs = append(checkFuncs, ResourceCheckNamePrefix)
  3671. case *SelectBy_Custom:
  3672. if len(m.Annotations.Indices) != 0 {
  3673. return nil, errConflictingFilters
  3674. }
  3675. m.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}}
  3676. checkFuncs = append(checkFuncs, ResourceCheckCustom)
  3677. case *SelectBy_CustomPrefix:
  3678. if len(m.Annotations.Indices) != 0 {
  3679. return nil, errConflictingFilters
  3680. }
  3681. m.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}}
  3682. checkFuncs = append(checkFuncs, ResourceCheckCustomPrefix)
  3683. }
  3684. }
  3685. var events []Event
  3686. if (action & WatchActionKindCreate) != 0 {
  3687. events = append(events, EventCreateResource{Resource: &m, Checks: checkFuncs})
  3688. }
  3689. if (action & WatchActionKindUpdate) != 0 {
  3690. events = append(events, EventUpdateResource{Resource: &m, Checks: checkFuncs})
  3691. }
  3692. if (action & WatchActionKindRemove) != 0 {
  3693. events = append(events, EventDeleteResource{Resource: &m, Checks: checkFuncs})
  3694. }
  3695. if len(events) == 0 {
  3696. return nil, errUnrecognizedAction
  3697. }
  3698. return events, nil
  3699. }
  3700. type ResourceIndexerByID struct{}
  3701. func (indexer ResourceIndexerByID) FromArgs(args ...interface{}) ([]byte, error) {
  3702. return fromArgs(args...)
  3703. }
  3704. func (indexer ResourceIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3705. return prefixFromArgs(args...)
  3706. }
  3707. func (indexer ResourceIndexerByID) FromObject(obj interface{}) (bool, []byte, error) {
  3708. m := obj.(*Resource)
  3709. return true, []byte(m.ID + "\x00"), nil
  3710. }
  3711. type ResourceIndexerByName struct{}
  3712. func (indexer ResourceIndexerByName) FromArgs(args ...interface{}) ([]byte, error) {
  3713. return fromArgs(args...)
  3714. }
  3715. func (indexer ResourceIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3716. return prefixFromArgs(args...)
  3717. }
  3718. func (indexer ResourceIndexerByName) FromObject(obj interface{}) (bool, []byte, error) {
  3719. m := obj.(*Resource)
  3720. val := m.Annotations.Name
  3721. return true, []byte(strings.ToLower(val) + "\x00"), nil
  3722. }
  3723. type ResourceCustomIndexer struct{}
  3724. func (indexer ResourceCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) {
  3725. return fromArgs(args...)
  3726. }
  3727. func (indexer ResourceCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3728. return prefixFromArgs(args...)
  3729. }
  3730. func (indexer ResourceCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) {
  3731. m := obj.(*Resource)
  3732. return customIndexer("", &m.Annotations)
  3733. }
  3734. type ExtensionCheckFunc func(t1, t2 *Extension) bool
  3735. type EventExtension interface {
  3736. IsEventExtension() bool
  3737. }
  3738. type EventCreateExtension struct {
  3739. Extension *Extension
  3740. Checks []ExtensionCheckFunc
  3741. }
  3742. func (e EventCreateExtension) Matches(apiEvent go_events.Event) bool {
  3743. typedEvent, ok := apiEvent.(EventCreateExtension)
  3744. if !ok {
  3745. return false
  3746. }
  3747. for _, check := range e.Checks {
  3748. if !check(e.Extension, typedEvent.Extension) {
  3749. return false
  3750. }
  3751. }
  3752. return true
  3753. }
  3754. func (e EventCreateExtension) IsEventCreate() bool {
  3755. return true
  3756. }
  3757. func (e EventCreateExtension) IsEventExtension() bool {
  3758. return true
  3759. }
  3760. type EventUpdateExtension struct {
  3761. Extension *Extension
  3762. OldExtension *Extension
  3763. Checks []ExtensionCheckFunc
  3764. }
  3765. func (e EventUpdateExtension) Matches(apiEvent go_events.Event) bool {
  3766. typedEvent, ok := apiEvent.(EventUpdateExtension)
  3767. if !ok {
  3768. return false
  3769. }
  3770. for _, check := range e.Checks {
  3771. if !check(e.Extension, typedEvent.Extension) {
  3772. return false
  3773. }
  3774. }
  3775. return true
  3776. }
  3777. func (e EventUpdateExtension) IsEventUpdate() bool {
  3778. return true
  3779. }
  3780. func (e EventUpdateExtension) IsEventExtension() bool {
  3781. return true
  3782. }
  3783. type EventDeleteExtension struct {
  3784. Extension *Extension
  3785. Checks []ExtensionCheckFunc
  3786. }
  3787. func (e EventDeleteExtension) Matches(apiEvent go_events.Event) bool {
  3788. typedEvent, ok := apiEvent.(EventDeleteExtension)
  3789. if !ok {
  3790. return false
  3791. }
  3792. for _, check := range e.Checks {
  3793. if !check(e.Extension, typedEvent.Extension) {
  3794. return false
  3795. }
  3796. }
  3797. return true
  3798. }
  3799. func (e EventDeleteExtension) IsEventDelete() bool {
  3800. return true
  3801. }
  3802. func (e EventDeleteExtension) IsEventExtension() bool {
  3803. return true
  3804. }
  3805. func (m *Extension) CopyStoreObject() StoreObject {
  3806. return m.Copy()
  3807. }
  3808. func (m *Extension) GetMeta() Meta {
  3809. return m.Meta
  3810. }
  3811. func (m *Extension) SetMeta(meta Meta) {
  3812. m.Meta = meta
  3813. }
  3814. func (m *Extension) GetID() string {
  3815. return m.ID
  3816. }
  3817. func (m *Extension) EventCreate() Event {
  3818. return EventCreateExtension{Extension: m}
  3819. }
  3820. func (m *Extension) EventUpdate(oldObject StoreObject) Event {
  3821. if oldObject != nil {
  3822. return EventUpdateExtension{Extension: m, OldExtension: oldObject.(*Extension)}
  3823. } else {
  3824. return EventUpdateExtension{Extension: m}
  3825. }
  3826. }
  3827. func (m *Extension) EventDelete() Event {
  3828. return EventDeleteExtension{Extension: m}
  3829. }
  3830. func ExtensionCheckID(v1, v2 *Extension) bool {
  3831. return v1.ID == v2.ID
  3832. }
  3833. func ExtensionCheckIDPrefix(v1, v2 *Extension) bool {
  3834. return strings.HasPrefix(v2.ID, v1.ID)
  3835. }
  3836. func ExtensionCheckName(v1, v2 *Extension) bool {
  3837. return v1.Annotations.Name == v2.Annotations.Name
  3838. }
  3839. func ExtensionCheckNamePrefix(v1, v2 *Extension) bool {
  3840. return strings.HasPrefix(v2.Annotations.Name, v1.Annotations.Name)
  3841. }
  3842. func ExtensionCheckCustom(v1, v2 *Extension) bool {
  3843. return checkCustom(v1.Annotations, v2.Annotations)
  3844. }
  3845. func ExtensionCheckCustomPrefix(v1, v2 *Extension) bool {
  3846. return checkCustomPrefix(v1.Annotations, v2.Annotations)
  3847. }
  3848. func ConvertExtensionWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
  3849. var (
  3850. m Extension
  3851. checkFuncs []ExtensionCheckFunc
  3852. )
  3853. for _, filter := range filters {
  3854. switch v := filter.By.(type) {
  3855. case *SelectBy_ID:
  3856. if m.ID != "" {
  3857. return nil, errConflictingFilters
  3858. }
  3859. m.ID = v.ID
  3860. checkFuncs = append(checkFuncs, ExtensionCheckID)
  3861. case *SelectBy_IDPrefix:
  3862. if m.ID != "" {
  3863. return nil, errConflictingFilters
  3864. }
  3865. m.ID = v.IDPrefix
  3866. checkFuncs = append(checkFuncs, ExtensionCheckIDPrefix)
  3867. case *SelectBy_Name:
  3868. if m.Annotations.Name != "" {
  3869. return nil, errConflictingFilters
  3870. }
  3871. m.Annotations.Name = v.Name
  3872. checkFuncs = append(checkFuncs, ExtensionCheckName)
  3873. case *SelectBy_NamePrefix:
  3874. if m.Annotations.Name != "" {
  3875. return nil, errConflictingFilters
  3876. }
  3877. m.Annotations.Name = v.NamePrefix
  3878. checkFuncs = append(checkFuncs, ExtensionCheckNamePrefix)
  3879. case *SelectBy_Custom:
  3880. if len(m.Annotations.Indices) != 0 {
  3881. return nil, errConflictingFilters
  3882. }
  3883. m.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}}
  3884. checkFuncs = append(checkFuncs, ExtensionCheckCustom)
  3885. case *SelectBy_CustomPrefix:
  3886. if len(m.Annotations.Indices) != 0 {
  3887. return nil, errConflictingFilters
  3888. }
  3889. m.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}}
  3890. checkFuncs = append(checkFuncs, ExtensionCheckCustomPrefix)
  3891. }
  3892. }
  3893. var events []Event
  3894. if (action & WatchActionKindCreate) != 0 {
  3895. events = append(events, EventCreateExtension{Extension: &m, Checks: checkFuncs})
  3896. }
  3897. if (action & WatchActionKindUpdate) != 0 {
  3898. events = append(events, EventUpdateExtension{Extension: &m, Checks: checkFuncs})
  3899. }
  3900. if (action & WatchActionKindRemove) != 0 {
  3901. events = append(events, EventDeleteExtension{Extension: &m, Checks: checkFuncs})
  3902. }
  3903. if len(events) == 0 {
  3904. return nil, errUnrecognizedAction
  3905. }
  3906. return events, nil
  3907. }
  3908. type ExtensionIndexerByID struct{}
  3909. func (indexer ExtensionIndexerByID) FromArgs(args ...interface{}) ([]byte, error) {
  3910. return fromArgs(args...)
  3911. }
  3912. func (indexer ExtensionIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3913. return prefixFromArgs(args...)
  3914. }
  3915. func (indexer ExtensionIndexerByID) FromObject(obj interface{}) (bool, []byte, error) {
  3916. m := obj.(*Extension)
  3917. return true, []byte(m.ID + "\x00"), nil
  3918. }
  3919. type ExtensionIndexerByName struct{}
  3920. func (indexer ExtensionIndexerByName) FromArgs(args ...interface{}) ([]byte, error) {
  3921. return fromArgs(args...)
  3922. }
  3923. func (indexer ExtensionIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3924. return prefixFromArgs(args...)
  3925. }
  3926. func (indexer ExtensionIndexerByName) FromObject(obj interface{}) (bool, []byte, error) {
  3927. m := obj.(*Extension)
  3928. val := m.Annotations.Name
  3929. return true, []byte(strings.ToLower(val) + "\x00"), nil
  3930. }
  3931. type ExtensionCustomIndexer struct{}
  3932. func (indexer ExtensionCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) {
  3933. return fromArgs(args...)
  3934. }
  3935. func (indexer ExtensionCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) {
  3936. return prefixFromArgs(args...)
  3937. }
  3938. func (indexer ExtensionCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) {
  3939. m := obj.(*Extension)
  3940. return customIndexer("", &m.Annotations)
  3941. }
  3942. func NewStoreAction(c Event) (StoreAction, error) {
  3943. var sa StoreAction
  3944. switch v := c.(type) {
  3945. case EventCreateNode:
  3946. sa.Action = StoreActionKindCreate
  3947. sa.Target = &StoreAction_Node{Node: v.Node}
  3948. case EventUpdateNode:
  3949. sa.Action = StoreActionKindUpdate
  3950. sa.Target = &StoreAction_Node{Node: v.Node}
  3951. case EventDeleteNode:
  3952. sa.Action = StoreActionKindRemove
  3953. sa.Target = &StoreAction_Node{Node: v.Node}
  3954. case EventCreateService:
  3955. sa.Action = StoreActionKindCreate
  3956. sa.Target = &StoreAction_Service{Service: v.Service}
  3957. case EventUpdateService:
  3958. sa.Action = StoreActionKindUpdate
  3959. sa.Target = &StoreAction_Service{Service: v.Service}
  3960. case EventDeleteService:
  3961. sa.Action = StoreActionKindRemove
  3962. sa.Target = &StoreAction_Service{Service: v.Service}
  3963. case EventCreateTask:
  3964. sa.Action = StoreActionKindCreate
  3965. sa.Target = &StoreAction_Task{Task: v.Task}
  3966. case EventUpdateTask:
  3967. sa.Action = StoreActionKindUpdate
  3968. sa.Target = &StoreAction_Task{Task: v.Task}
  3969. case EventDeleteTask:
  3970. sa.Action = StoreActionKindRemove
  3971. sa.Target = &StoreAction_Task{Task: v.Task}
  3972. case EventCreateNetwork:
  3973. sa.Action = StoreActionKindCreate
  3974. sa.Target = &StoreAction_Network{Network: v.Network}
  3975. case EventUpdateNetwork:
  3976. sa.Action = StoreActionKindUpdate
  3977. sa.Target = &StoreAction_Network{Network: v.Network}
  3978. case EventDeleteNetwork:
  3979. sa.Action = StoreActionKindRemove
  3980. sa.Target = &StoreAction_Network{Network: v.Network}
  3981. case EventCreateCluster:
  3982. sa.Action = StoreActionKindCreate
  3983. sa.Target = &StoreAction_Cluster{Cluster: v.Cluster}
  3984. case EventUpdateCluster:
  3985. sa.Action = StoreActionKindUpdate
  3986. sa.Target = &StoreAction_Cluster{Cluster: v.Cluster}
  3987. case EventDeleteCluster:
  3988. sa.Action = StoreActionKindRemove
  3989. sa.Target = &StoreAction_Cluster{Cluster: v.Cluster}
  3990. case EventCreateSecret:
  3991. sa.Action = StoreActionKindCreate
  3992. sa.Target = &StoreAction_Secret{Secret: v.Secret}
  3993. case EventUpdateSecret:
  3994. sa.Action = StoreActionKindUpdate
  3995. sa.Target = &StoreAction_Secret{Secret: v.Secret}
  3996. case EventDeleteSecret:
  3997. sa.Action = StoreActionKindRemove
  3998. sa.Target = &StoreAction_Secret{Secret: v.Secret}
  3999. case EventCreateConfig:
  4000. sa.Action = StoreActionKindCreate
  4001. sa.Target = &StoreAction_Config{Config: v.Config}
  4002. case EventUpdateConfig:
  4003. sa.Action = StoreActionKindUpdate
  4004. sa.Target = &StoreAction_Config{Config: v.Config}
  4005. case EventDeleteConfig:
  4006. sa.Action = StoreActionKindRemove
  4007. sa.Target = &StoreAction_Config{Config: v.Config}
  4008. case EventCreateResource:
  4009. sa.Action = StoreActionKindCreate
  4010. sa.Target = &StoreAction_Resource{Resource: v.Resource}
  4011. case EventUpdateResource:
  4012. sa.Action = StoreActionKindUpdate
  4013. sa.Target = &StoreAction_Resource{Resource: v.Resource}
  4014. case EventDeleteResource:
  4015. sa.Action = StoreActionKindRemove
  4016. sa.Target = &StoreAction_Resource{Resource: v.Resource}
  4017. case EventCreateExtension:
  4018. sa.Action = StoreActionKindCreate
  4019. sa.Target = &StoreAction_Extension{Extension: v.Extension}
  4020. case EventUpdateExtension:
  4021. sa.Action = StoreActionKindUpdate
  4022. sa.Target = &StoreAction_Extension{Extension: v.Extension}
  4023. case EventDeleteExtension:
  4024. sa.Action = StoreActionKindRemove
  4025. sa.Target = &StoreAction_Extension{Extension: v.Extension}
  4026. default:
  4027. return StoreAction{}, errUnknownStoreAction
  4028. }
  4029. return sa, nil
  4030. }
  4031. func EventFromStoreAction(sa StoreAction, oldObject StoreObject) (Event, error) {
  4032. switch v := sa.Target.(type) {
  4033. case *StoreAction_Node:
  4034. switch sa.Action {
  4035. case StoreActionKindCreate:
  4036. return EventCreateNode{Node: v.Node}, nil
  4037. case StoreActionKindUpdate:
  4038. if oldObject != nil {
  4039. return EventUpdateNode{Node: v.Node, OldNode: oldObject.(*Node)}, nil
  4040. } else {
  4041. return EventUpdateNode{Node: v.Node}, nil
  4042. }
  4043. case StoreActionKindRemove:
  4044. return EventDeleteNode{Node: v.Node}, nil
  4045. }
  4046. case *StoreAction_Service:
  4047. switch sa.Action {
  4048. case StoreActionKindCreate:
  4049. return EventCreateService{Service: v.Service}, nil
  4050. case StoreActionKindUpdate:
  4051. if oldObject != nil {
  4052. return EventUpdateService{Service: v.Service, OldService: oldObject.(*Service)}, nil
  4053. } else {
  4054. return EventUpdateService{Service: v.Service}, nil
  4055. }
  4056. case StoreActionKindRemove:
  4057. return EventDeleteService{Service: v.Service}, nil
  4058. }
  4059. case *StoreAction_Task:
  4060. switch sa.Action {
  4061. case StoreActionKindCreate:
  4062. return EventCreateTask{Task: v.Task}, nil
  4063. case StoreActionKindUpdate:
  4064. if oldObject != nil {
  4065. return EventUpdateTask{Task: v.Task, OldTask: oldObject.(*Task)}, nil
  4066. } else {
  4067. return EventUpdateTask{Task: v.Task}, nil
  4068. }
  4069. case StoreActionKindRemove:
  4070. return EventDeleteTask{Task: v.Task}, nil
  4071. }
  4072. case *StoreAction_Network:
  4073. switch sa.Action {
  4074. case StoreActionKindCreate:
  4075. return EventCreateNetwork{Network: v.Network}, nil
  4076. case StoreActionKindUpdate:
  4077. if oldObject != nil {
  4078. return EventUpdateNetwork{Network: v.Network, OldNetwork: oldObject.(*Network)}, nil
  4079. } else {
  4080. return EventUpdateNetwork{Network: v.Network}, nil
  4081. }
  4082. case StoreActionKindRemove:
  4083. return EventDeleteNetwork{Network: v.Network}, nil
  4084. }
  4085. case *StoreAction_Cluster:
  4086. switch sa.Action {
  4087. case StoreActionKindCreate:
  4088. return EventCreateCluster{Cluster: v.Cluster}, nil
  4089. case StoreActionKindUpdate:
  4090. if oldObject != nil {
  4091. return EventUpdateCluster{Cluster: v.Cluster, OldCluster: oldObject.(*Cluster)}, nil
  4092. } else {
  4093. return EventUpdateCluster{Cluster: v.Cluster}, nil
  4094. }
  4095. case StoreActionKindRemove:
  4096. return EventDeleteCluster{Cluster: v.Cluster}, nil
  4097. }
  4098. case *StoreAction_Secret:
  4099. switch sa.Action {
  4100. case StoreActionKindCreate:
  4101. return EventCreateSecret{Secret: v.Secret}, nil
  4102. case StoreActionKindUpdate:
  4103. if oldObject != nil {
  4104. return EventUpdateSecret{Secret: v.Secret, OldSecret: oldObject.(*Secret)}, nil
  4105. } else {
  4106. return EventUpdateSecret{Secret: v.Secret}, nil
  4107. }
  4108. case StoreActionKindRemove:
  4109. return EventDeleteSecret{Secret: v.Secret}, nil
  4110. }
  4111. case *StoreAction_Config:
  4112. switch sa.Action {
  4113. case StoreActionKindCreate:
  4114. return EventCreateConfig{Config: v.Config}, nil
  4115. case StoreActionKindUpdate:
  4116. if oldObject != nil {
  4117. return EventUpdateConfig{Config: v.Config, OldConfig: oldObject.(*Config)}, nil
  4118. } else {
  4119. return EventUpdateConfig{Config: v.Config}, nil
  4120. }
  4121. case StoreActionKindRemove:
  4122. return EventDeleteConfig{Config: v.Config}, nil
  4123. }
  4124. case *StoreAction_Resource:
  4125. switch sa.Action {
  4126. case StoreActionKindCreate:
  4127. return EventCreateResource{Resource: v.Resource}, nil
  4128. case StoreActionKindUpdate:
  4129. if oldObject != nil {
  4130. return EventUpdateResource{Resource: v.Resource, OldResource: oldObject.(*Resource)}, nil
  4131. } else {
  4132. return EventUpdateResource{Resource: v.Resource}, nil
  4133. }
  4134. case StoreActionKindRemove:
  4135. return EventDeleteResource{Resource: v.Resource}, nil
  4136. }
  4137. case *StoreAction_Extension:
  4138. switch sa.Action {
  4139. case StoreActionKindCreate:
  4140. return EventCreateExtension{Extension: v.Extension}, nil
  4141. case StoreActionKindUpdate:
  4142. if oldObject != nil {
  4143. return EventUpdateExtension{Extension: v.Extension, OldExtension: oldObject.(*Extension)}, nil
  4144. } else {
  4145. return EventUpdateExtension{Extension: v.Extension}, nil
  4146. }
  4147. case StoreActionKindRemove:
  4148. return EventDeleteExtension{Extension: v.Extension}, nil
  4149. }
  4150. }
  4151. return nil, errUnknownStoreAction
  4152. }
  4153. func WatchMessageEvent(c Event) *WatchMessage_Event {
  4154. switch v := c.(type) {
  4155. case EventCreateNode:
  4156. return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Node{Node: v.Node}}}
  4157. case EventUpdateNode:
  4158. if v.OldNode != nil {
  4159. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Node{Node: v.Node}}, OldObject: &Object{Object: &Object_Node{Node: v.OldNode}}}
  4160. } else {
  4161. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Node{Node: v.Node}}}
  4162. }
  4163. case EventDeleteNode:
  4164. return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Node{Node: v.Node}}}
  4165. case EventCreateService:
  4166. return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Service{Service: v.Service}}}
  4167. case EventUpdateService:
  4168. if v.OldService != nil {
  4169. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Service{Service: v.Service}}, OldObject: &Object{Object: &Object_Service{Service: v.OldService}}}
  4170. } else {
  4171. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Service{Service: v.Service}}}
  4172. }
  4173. case EventDeleteService:
  4174. return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Service{Service: v.Service}}}
  4175. case EventCreateTask:
  4176. return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Task{Task: v.Task}}}
  4177. case EventUpdateTask:
  4178. if v.OldTask != nil {
  4179. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Task{Task: v.Task}}, OldObject: &Object{Object: &Object_Task{Task: v.OldTask}}}
  4180. } else {
  4181. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Task{Task: v.Task}}}
  4182. }
  4183. case EventDeleteTask:
  4184. return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Task{Task: v.Task}}}
  4185. case EventCreateNetwork:
  4186. return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Network{Network: v.Network}}}
  4187. case EventUpdateNetwork:
  4188. if v.OldNetwork != nil {
  4189. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Network{Network: v.Network}}, OldObject: &Object{Object: &Object_Network{Network: v.OldNetwork}}}
  4190. } else {
  4191. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Network{Network: v.Network}}}
  4192. }
  4193. case EventDeleteNetwork:
  4194. return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Network{Network: v.Network}}}
  4195. case EventCreateCluster:
  4196. return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Cluster{Cluster: v.Cluster}}}
  4197. case EventUpdateCluster:
  4198. if v.OldCluster != nil {
  4199. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Cluster{Cluster: v.Cluster}}, OldObject: &Object{Object: &Object_Cluster{Cluster: v.OldCluster}}}
  4200. } else {
  4201. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Cluster{Cluster: v.Cluster}}}
  4202. }
  4203. case EventDeleteCluster:
  4204. return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Cluster{Cluster: v.Cluster}}}
  4205. case EventCreateSecret:
  4206. return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Secret{Secret: v.Secret}}}
  4207. case EventUpdateSecret:
  4208. if v.OldSecret != nil {
  4209. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Secret{Secret: v.Secret}}, OldObject: &Object{Object: &Object_Secret{Secret: v.OldSecret}}}
  4210. } else {
  4211. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Secret{Secret: v.Secret}}}
  4212. }
  4213. case EventDeleteSecret:
  4214. return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Secret{Secret: v.Secret}}}
  4215. case EventCreateConfig:
  4216. return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Config{Config: v.Config}}}
  4217. case EventUpdateConfig:
  4218. if v.OldConfig != nil {
  4219. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Config{Config: v.Config}}, OldObject: &Object{Object: &Object_Config{Config: v.OldConfig}}}
  4220. } else {
  4221. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Config{Config: v.Config}}}
  4222. }
  4223. case EventDeleteConfig:
  4224. return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Config{Config: v.Config}}}
  4225. case EventCreateResource:
  4226. return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Resource{Resource: v.Resource}}}
  4227. case EventUpdateResource:
  4228. if v.OldResource != nil {
  4229. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Resource{Resource: v.Resource}}, OldObject: &Object{Object: &Object_Resource{Resource: v.OldResource}}}
  4230. } else {
  4231. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Resource{Resource: v.Resource}}}
  4232. }
  4233. case EventDeleteResource:
  4234. return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Resource{Resource: v.Resource}}}
  4235. case EventCreateExtension:
  4236. return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Extension{Extension: v.Extension}}}
  4237. case EventUpdateExtension:
  4238. if v.OldExtension != nil {
  4239. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Extension{Extension: v.Extension}}, OldObject: &Object{Object: &Object_Extension{Extension: v.OldExtension}}}
  4240. } else {
  4241. return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Extension{Extension: v.Extension}}}
  4242. }
  4243. case EventDeleteExtension:
  4244. return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Extension{Extension: v.Extension}}}
  4245. }
  4246. return nil
  4247. }
  4248. func ConvertWatchArgs(entries []*WatchRequest_WatchEntry) ([]Event, error) {
  4249. var events []Event
  4250. for _, entry := range entries {
  4251. var newEvents []Event
  4252. var err error
  4253. switch entry.Kind {
  4254. case "":
  4255. return nil, errNoKindSpecified
  4256. case "node":
  4257. newEvents, err = ConvertNodeWatch(entry.Action, entry.Filters)
  4258. case "service":
  4259. newEvents, err = ConvertServiceWatch(entry.Action, entry.Filters)
  4260. case "task":
  4261. newEvents, err = ConvertTaskWatch(entry.Action, entry.Filters)
  4262. case "network":
  4263. newEvents, err = ConvertNetworkWatch(entry.Action, entry.Filters)
  4264. case "cluster":
  4265. newEvents, err = ConvertClusterWatch(entry.Action, entry.Filters)
  4266. case "secret":
  4267. newEvents, err = ConvertSecretWatch(entry.Action, entry.Filters)
  4268. case "config":
  4269. newEvents, err = ConvertConfigWatch(entry.Action, entry.Filters)
  4270. default:
  4271. newEvents, err = ConvertResourceWatch(entry.Action, entry.Filters, entry.Kind)
  4272. case "extension":
  4273. newEvents, err = ConvertExtensionWatch(entry.Action, entry.Filters)
  4274. }
  4275. if err != nil {
  4276. return nil, err
  4277. }
  4278. events = append(events, newEvents...)
  4279. }
  4280. return events, nil
  4281. }
  4282. func (this *Meta) String() string {
  4283. if this == nil {
  4284. return "nil"
  4285. }
  4286. s := strings.Join([]string{`&Meta{`,
  4287. `Version:` + strings.Replace(strings.Replace(this.Version.String(), "Version", "Version", 1), `&`, ``, 1) + `,`,
  4288. `CreatedAt:` + strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "google_protobuf.Timestamp", 1) + `,`,
  4289. `UpdatedAt:` + strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "google_protobuf.Timestamp", 1) + `,`,
  4290. `}`,
  4291. }, "")
  4292. return s
  4293. }
  4294. func (this *Node) String() string {
  4295. if this == nil {
  4296. return "nil"
  4297. }
  4298. s := strings.Join([]string{`&Node{`,
  4299. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  4300. `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`,
  4301. `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "NodeSpec", "NodeSpec", 1), `&`, ``, 1) + `,`,
  4302. `Description:` + strings.Replace(fmt.Sprintf("%v", this.Description), "NodeDescription", "NodeDescription", 1) + `,`,
  4303. `Status:` + strings.Replace(strings.Replace(this.Status.String(), "NodeStatus", "NodeStatus", 1), `&`, ``, 1) + `,`,
  4304. `ManagerStatus:` + strings.Replace(fmt.Sprintf("%v", this.ManagerStatus), "ManagerStatus", "ManagerStatus", 1) + `,`,
  4305. `Attachment:` + strings.Replace(fmt.Sprintf("%v", this.Attachment), "NetworkAttachment", "NetworkAttachment", 1) + `,`,
  4306. `Certificate:` + strings.Replace(strings.Replace(this.Certificate.String(), "Certificate", "Certificate", 1), `&`, ``, 1) + `,`,
  4307. `Role:` + fmt.Sprintf("%v", this.Role) + `,`,
  4308. `Attachments:` + strings.Replace(fmt.Sprintf("%v", this.Attachments), "NetworkAttachment", "NetworkAttachment", 1) + `,`,
  4309. `VXLANUDPPort:` + fmt.Sprintf("%v", this.VXLANUDPPort) + `,`,
  4310. `}`,
  4311. }, "")
  4312. return s
  4313. }
  4314. func (this *Service) String() string {
  4315. if this == nil {
  4316. return "nil"
  4317. }
  4318. s := strings.Join([]string{`&Service{`,
  4319. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  4320. `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`,
  4321. `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ServiceSpec", "ServiceSpec", 1), `&`, ``, 1) + `,`,
  4322. `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "Endpoint", "Endpoint", 1) + `,`,
  4323. `UpdateStatus:` + strings.Replace(fmt.Sprintf("%v", this.UpdateStatus), "UpdateStatus", "UpdateStatus", 1) + `,`,
  4324. `PreviousSpec:` + strings.Replace(fmt.Sprintf("%v", this.PreviousSpec), "ServiceSpec", "ServiceSpec", 1) + `,`,
  4325. `PendingDelete:` + fmt.Sprintf("%v", this.PendingDelete) + `,`,
  4326. `SpecVersion:` + strings.Replace(fmt.Sprintf("%v", this.SpecVersion), "Version", "Version", 1) + `,`,
  4327. `PreviousSpecVersion:` + strings.Replace(fmt.Sprintf("%v", this.PreviousSpecVersion), "Version", "Version", 1) + `,`,
  4328. `}`,
  4329. }, "")
  4330. return s
  4331. }
  4332. func (this *Endpoint) String() string {
  4333. if this == nil {
  4334. return "nil"
  4335. }
  4336. s := strings.Join([]string{`&Endpoint{`,
  4337. `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "EndpointSpec", "EndpointSpec", 1) + `,`,
  4338. `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "PortConfig", "PortConfig", 1) + `,`,
  4339. `VirtualIPs:` + strings.Replace(fmt.Sprintf("%v", this.VirtualIPs), "Endpoint_VirtualIP", "Endpoint_VirtualIP", 1) + `,`,
  4340. `}`,
  4341. }, "")
  4342. return s
  4343. }
  4344. func (this *Endpoint_VirtualIP) String() string {
  4345. if this == nil {
  4346. return "nil"
  4347. }
  4348. s := strings.Join([]string{`&Endpoint_VirtualIP{`,
  4349. `NetworkID:` + fmt.Sprintf("%v", this.NetworkID) + `,`,
  4350. `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`,
  4351. `}`,
  4352. }, "")
  4353. return s
  4354. }
  4355. func (this *Task) String() string {
  4356. if this == nil {
  4357. return "nil"
  4358. }
  4359. s := strings.Join([]string{`&Task{`,
  4360. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  4361. `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`,
  4362. `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "TaskSpec", "TaskSpec", 1), `&`, ``, 1) + `,`,
  4363. `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`,
  4364. `Slot:` + fmt.Sprintf("%v", this.Slot) + `,`,
  4365. `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`,
  4366. `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`,
  4367. `ServiceAnnotations:` + strings.Replace(strings.Replace(this.ServiceAnnotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`,
  4368. `Status:` + strings.Replace(strings.Replace(this.Status.String(), "TaskStatus", "TaskStatus", 1), `&`, ``, 1) + `,`,
  4369. `DesiredState:` + fmt.Sprintf("%v", this.DesiredState) + `,`,
  4370. `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "NetworkAttachment", "NetworkAttachment", 1) + `,`,
  4371. `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "Endpoint", "Endpoint", 1) + `,`,
  4372. `LogDriver:` + strings.Replace(fmt.Sprintf("%v", this.LogDriver), "Driver", "Driver", 1) + `,`,
  4373. `SpecVersion:` + strings.Replace(fmt.Sprintf("%v", this.SpecVersion), "Version", "Version", 1) + `,`,
  4374. `AssignedGenericResources:` + strings.Replace(fmt.Sprintf("%v", this.AssignedGenericResources), "GenericResource", "GenericResource", 1) + `,`,
  4375. `}`,
  4376. }, "")
  4377. return s
  4378. }
  4379. func (this *NetworkAttachment) String() string {
  4380. if this == nil {
  4381. return "nil"
  4382. }
  4383. keysForDriverAttachmentOpts := make([]string, 0, len(this.DriverAttachmentOpts))
  4384. for k, _ := range this.DriverAttachmentOpts {
  4385. keysForDriverAttachmentOpts = append(keysForDriverAttachmentOpts, k)
  4386. }
  4387. sortkeys.Strings(keysForDriverAttachmentOpts)
  4388. mapStringForDriverAttachmentOpts := "map[string]string{"
  4389. for _, k := range keysForDriverAttachmentOpts {
  4390. mapStringForDriverAttachmentOpts += fmt.Sprintf("%v: %v,", k, this.DriverAttachmentOpts[k])
  4391. }
  4392. mapStringForDriverAttachmentOpts += "}"
  4393. s := strings.Join([]string{`&NetworkAttachment{`,
  4394. `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`,
  4395. `Addresses:` + fmt.Sprintf("%v", this.Addresses) + `,`,
  4396. `Aliases:` + fmt.Sprintf("%v", this.Aliases) + `,`,
  4397. `DriverAttachmentOpts:` + mapStringForDriverAttachmentOpts + `,`,
  4398. `}`,
  4399. }, "")
  4400. return s
  4401. }
  4402. func (this *Network) String() string {
  4403. if this == nil {
  4404. return "nil"
  4405. }
  4406. s := strings.Join([]string{`&Network{`,
  4407. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  4408. `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`,
  4409. `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "NetworkSpec", "NetworkSpec", 1), `&`, ``, 1) + `,`,
  4410. `DriverState:` + strings.Replace(fmt.Sprintf("%v", this.DriverState), "Driver", "Driver", 1) + `,`,
  4411. `IPAM:` + strings.Replace(fmt.Sprintf("%v", this.IPAM), "IPAMOptions", "IPAMOptions", 1) + `,`,
  4412. `PendingDelete:` + fmt.Sprintf("%v", this.PendingDelete) + `,`,
  4413. `}`,
  4414. }, "")
  4415. return s
  4416. }
  4417. func (this *Cluster) String() string {
  4418. if this == nil {
  4419. return "nil"
  4420. }
  4421. keysForBlacklistedCertificates := make([]string, 0, len(this.BlacklistedCertificates))
  4422. for k, _ := range this.BlacklistedCertificates {
  4423. keysForBlacklistedCertificates = append(keysForBlacklistedCertificates, k)
  4424. }
  4425. sortkeys.Strings(keysForBlacklistedCertificates)
  4426. mapStringForBlacklistedCertificates := "map[string]*BlacklistedCertificate{"
  4427. for _, k := range keysForBlacklistedCertificates {
  4428. mapStringForBlacklistedCertificates += fmt.Sprintf("%v: %v,", k, this.BlacklistedCertificates[k])
  4429. }
  4430. mapStringForBlacklistedCertificates += "}"
  4431. s := strings.Join([]string{`&Cluster{`,
  4432. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  4433. `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`,
  4434. `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ClusterSpec", "ClusterSpec", 1), `&`, ``, 1) + `,`,
  4435. `RootCA:` + strings.Replace(strings.Replace(this.RootCA.String(), "RootCA", "RootCA", 1), `&`, ``, 1) + `,`,
  4436. `NetworkBootstrapKeys:` + strings.Replace(fmt.Sprintf("%v", this.NetworkBootstrapKeys), "EncryptionKey", "EncryptionKey", 1) + `,`,
  4437. `EncryptionKeyLamportClock:` + fmt.Sprintf("%v", this.EncryptionKeyLamportClock) + `,`,
  4438. `BlacklistedCertificates:` + mapStringForBlacklistedCertificates + `,`,
  4439. `UnlockKeys:` + strings.Replace(fmt.Sprintf("%v", this.UnlockKeys), "EncryptionKey", "EncryptionKey", 1) + `,`,
  4440. `FIPS:` + fmt.Sprintf("%v", this.FIPS) + `,`,
  4441. `DefaultAddressPool:` + fmt.Sprintf("%v", this.DefaultAddressPool) + `,`,
  4442. `SubnetSize:` + fmt.Sprintf("%v", this.SubnetSize) + `,`,
  4443. `VXLANUDPPort:` + fmt.Sprintf("%v", this.VXLANUDPPort) + `,`,
  4444. `}`,
  4445. }, "")
  4446. return s
  4447. }
  4448. func (this *Secret) String() string {
  4449. if this == nil {
  4450. return "nil"
  4451. }
  4452. s := strings.Join([]string{`&Secret{`,
  4453. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  4454. `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`,
  4455. `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "SecretSpec", "SecretSpec", 1), `&`, ``, 1) + `,`,
  4456. `Internal:` + fmt.Sprintf("%v", this.Internal) + `,`,
  4457. `}`,
  4458. }, "")
  4459. return s
  4460. }
  4461. func (this *Config) String() string {
  4462. if this == nil {
  4463. return "nil"
  4464. }
  4465. s := strings.Join([]string{`&Config{`,
  4466. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  4467. `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`,
  4468. `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ConfigSpec", "ConfigSpec", 1), `&`, ``, 1) + `,`,
  4469. `}`,
  4470. }, "")
  4471. return s
  4472. }
  4473. func (this *Resource) String() string {
  4474. if this == nil {
  4475. return "nil"
  4476. }
  4477. s := strings.Join([]string{`&Resource{`,
  4478. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  4479. `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`,
  4480. `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`,
  4481. `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
  4482. `Payload:` + strings.Replace(fmt.Sprintf("%v", this.Payload), "Any", "google_protobuf4.Any", 1) + `,`,
  4483. `}`,
  4484. }, "")
  4485. return s
  4486. }
  4487. func (this *Extension) String() string {
  4488. if this == nil {
  4489. return "nil"
  4490. }
  4491. s := strings.Join([]string{`&Extension{`,
  4492. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  4493. `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`,
  4494. `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`,
  4495. `Description:` + fmt.Sprintf("%v", this.Description) + `,`,
  4496. `}`,
  4497. }, "")
  4498. return s
  4499. }
  4500. func valueToStringObjects(v interface{}) string {
  4501. rv := reflect.ValueOf(v)
  4502. if rv.IsNil() {
  4503. return "nil"
  4504. }
  4505. pv := reflect.Indirect(rv).Interface()
  4506. return fmt.Sprintf("*%v", pv)
  4507. }
  4508. func (m *Meta) Unmarshal(dAtA []byte) error {
  4509. l := len(dAtA)
  4510. iNdEx := 0
  4511. for iNdEx < l {
  4512. preIndex := iNdEx
  4513. var wire uint64
  4514. for shift := uint(0); ; shift += 7 {
  4515. if shift >= 64 {
  4516. return ErrIntOverflowObjects
  4517. }
  4518. if iNdEx >= l {
  4519. return io.ErrUnexpectedEOF
  4520. }
  4521. b := dAtA[iNdEx]
  4522. iNdEx++
  4523. wire |= (uint64(b) & 0x7F) << shift
  4524. if b < 0x80 {
  4525. break
  4526. }
  4527. }
  4528. fieldNum := int32(wire >> 3)
  4529. wireType := int(wire & 0x7)
  4530. if wireType == 4 {
  4531. return fmt.Errorf("proto: Meta: wiretype end group for non-group")
  4532. }
  4533. if fieldNum <= 0 {
  4534. return fmt.Errorf("proto: Meta: illegal tag %d (wire type %d)", fieldNum, wire)
  4535. }
  4536. switch fieldNum {
  4537. case 1:
  4538. if wireType != 2 {
  4539. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  4540. }
  4541. var msglen int
  4542. for shift := uint(0); ; shift += 7 {
  4543. if shift >= 64 {
  4544. return ErrIntOverflowObjects
  4545. }
  4546. if iNdEx >= l {
  4547. return io.ErrUnexpectedEOF
  4548. }
  4549. b := dAtA[iNdEx]
  4550. iNdEx++
  4551. msglen |= (int(b) & 0x7F) << shift
  4552. if b < 0x80 {
  4553. break
  4554. }
  4555. }
  4556. if msglen < 0 {
  4557. return ErrInvalidLengthObjects
  4558. }
  4559. postIndex := iNdEx + msglen
  4560. if postIndex > l {
  4561. return io.ErrUnexpectedEOF
  4562. }
  4563. if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4564. return err
  4565. }
  4566. iNdEx = postIndex
  4567. case 2:
  4568. if wireType != 2 {
  4569. return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
  4570. }
  4571. var msglen int
  4572. for shift := uint(0); ; shift += 7 {
  4573. if shift >= 64 {
  4574. return ErrIntOverflowObjects
  4575. }
  4576. if iNdEx >= l {
  4577. return io.ErrUnexpectedEOF
  4578. }
  4579. b := dAtA[iNdEx]
  4580. iNdEx++
  4581. msglen |= (int(b) & 0x7F) << shift
  4582. if b < 0x80 {
  4583. break
  4584. }
  4585. }
  4586. if msglen < 0 {
  4587. return ErrInvalidLengthObjects
  4588. }
  4589. postIndex := iNdEx + msglen
  4590. if postIndex > l {
  4591. return io.ErrUnexpectedEOF
  4592. }
  4593. if m.CreatedAt == nil {
  4594. m.CreatedAt = &google_protobuf.Timestamp{}
  4595. }
  4596. if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4597. return err
  4598. }
  4599. iNdEx = postIndex
  4600. case 3:
  4601. if wireType != 2 {
  4602. return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
  4603. }
  4604. var msglen int
  4605. for shift := uint(0); ; shift += 7 {
  4606. if shift >= 64 {
  4607. return ErrIntOverflowObjects
  4608. }
  4609. if iNdEx >= l {
  4610. return io.ErrUnexpectedEOF
  4611. }
  4612. b := dAtA[iNdEx]
  4613. iNdEx++
  4614. msglen |= (int(b) & 0x7F) << shift
  4615. if b < 0x80 {
  4616. break
  4617. }
  4618. }
  4619. if msglen < 0 {
  4620. return ErrInvalidLengthObjects
  4621. }
  4622. postIndex := iNdEx + msglen
  4623. if postIndex > l {
  4624. return io.ErrUnexpectedEOF
  4625. }
  4626. if m.UpdatedAt == nil {
  4627. m.UpdatedAt = &google_protobuf.Timestamp{}
  4628. }
  4629. if err := m.UpdatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4630. return err
  4631. }
  4632. iNdEx = postIndex
  4633. default:
  4634. iNdEx = preIndex
  4635. skippy, err := skipObjects(dAtA[iNdEx:])
  4636. if err != nil {
  4637. return err
  4638. }
  4639. if skippy < 0 {
  4640. return ErrInvalidLengthObjects
  4641. }
  4642. if (iNdEx + skippy) > l {
  4643. return io.ErrUnexpectedEOF
  4644. }
  4645. iNdEx += skippy
  4646. }
  4647. }
  4648. if iNdEx > l {
  4649. return io.ErrUnexpectedEOF
  4650. }
  4651. return nil
  4652. }
  4653. func (m *Node) Unmarshal(dAtA []byte) error {
  4654. l := len(dAtA)
  4655. iNdEx := 0
  4656. for iNdEx < l {
  4657. preIndex := iNdEx
  4658. var wire uint64
  4659. for shift := uint(0); ; shift += 7 {
  4660. if shift >= 64 {
  4661. return ErrIntOverflowObjects
  4662. }
  4663. if iNdEx >= l {
  4664. return io.ErrUnexpectedEOF
  4665. }
  4666. b := dAtA[iNdEx]
  4667. iNdEx++
  4668. wire |= (uint64(b) & 0x7F) << shift
  4669. if b < 0x80 {
  4670. break
  4671. }
  4672. }
  4673. fieldNum := int32(wire >> 3)
  4674. wireType := int(wire & 0x7)
  4675. if wireType == 4 {
  4676. return fmt.Errorf("proto: Node: wiretype end group for non-group")
  4677. }
  4678. if fieldNum <= 0 {
  4679. return fmt.Errorf("proto: Node: illegal tag %d (wire type %d)", fieldNum, wire)
  4680. }
  4681. switch fieldNum {
  4682. case 1:
  4683. if wireType != 2 {
  4684. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  4685. }
  4686. var stringLen uint64
  4687. for shift := uint(0); ; shift += 7 {
  4688. if shift >= 64 {
  4689. return ErrIntOverflowObjects
  4690. }
  4691. if iNdEx >= l {
  4692. return io.ErrUnexpectedEOF
  4693. }
  4694. b := dAtA[iNdEx]
  4695. iNdEx++
  4696. stringLen |= (uint64(b) & 0x7F) << shift
  4697. if b < 0x80 {
  4698. break
  4699. }
  4700. }
  4701. intStringLen := int(stringLen)
  4702. if intStringLen < 0 {
  4703. return ErrInvalidLengthObjects
  4704. }
  4705. postIndex := iNdEx + intStringLen
  4706. if postIndex > l {
  4707. return io.ErrUnexpectedEOF
  4708. }
  4709. m.ID = string(dAtA[iNdEx:postIndex])
  4710. iNdEx = postIndex
  4711. case 2:
  4712. if wireType != 2 {
  4713. return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType)
  4714. }
  4715. var msglen int
  4716. for shift := uint(0); ; shift += 7 {
  4717. if shift >= 64 {
  4718. return ErrIntOverflowObjects
  4719. }
  4720. if iNdEx >= l {
  4721. return io.ErrUnexpectedEOF
  4722. }
  4723. b := dAtA[iNdEx]
  4724. iNdEx++
  4725. msglen |= (int(b) & 0x7F) << shift
  4726. if b < 0x80 {
  4727. break
  4728. }
  4729. }
  4730. if msglen < 0 {
  4731. return ErrInvalidLengthObjects
  4732. }
  4733. postIndex := iNdEx + msglen
  4734. if postIndex > l {
  4735. return io.ErrUnexpectedEOF
  4736. }
  4737. if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4738. return err
  4739. }
  4740. iNdEx = postIndex
  4741. case 3:
  4742. if wireType != 2 {
  4743. return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
  4744. }
  4745. var msglen int
  4746. for shift := uint(0); ; shift += 7 {
  4747. if shift >= 64 {
  4748. return ErrIntOverflowObjects
  4749. }
  4750. if iNdEx >= l {
  4751. return io.ErrUnexpectedEOF
  4752. }
  4753. b := dAtA[iNdEx]
  4754. iNdEx++
  4755. msglen |= (int(b) & 0x7F) << shift
  4756. if b < 0x80 {
  4757. break
  4758. }
  4759. }
  4760. if msglen < 0 {
  4761. return ErrInvalidLengthObjects
  4762. }
  4763. postIndex := iNdEx + msglen
  4764. if postIndex > l {
  4765. return io.ErrUnexpectedEOF
  4766. }
  4767. if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4768. return err
  4769. }
  4770. iNdEx = postIndex
  4771. case 4:
  4772. if wireType != 2 {
  4773. return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
  4774. }
  4775. var msglen int
  4776. for shift := uint(0); ; shift += 7 {
  4777. if shift >= 64 {
  4778. return ErrIntOverflowObjects
  4779. }
  4780. if iNdEx >= l {
  4781. return io.ErrUnexpectedEOF
  4782. }
  4783. b := dAtA[iNdEx]
  4784. iNdEx++
  4785. msglen |= (int(b) & 0x7F) << shift
  4786. if b < 0x80 {
  4787. break
  4788. }
  4789. }
  4790. if msglen < 0 {
  4791. return ErrInvalidLengthObjects
  4792. }
  4793. postIndex := iNdEx + msglen
  4794. if postIndex > l {
  4795. return io.ErrUnexpectedEOF
  4796. }
  4797. if m.Description == nil {
  4798. m.Description = &NodeDescription{}
  4799. }
  4800. if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4801. return err
  4802. }
  4803. iNdEx = postIndex
  4804. case 5:
  4805. if wireType != 2 {
  4806. return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
  4807. }
  4808. var msglen int
  4809. for shift := uint(0); ; shift += 7 {
  4810. if shift >= 64 {
  4811. return ErrIntOverflowObjects
  4812. }
  4813. if iNdEx >= l {
  4814. return io.ErrUnexpectedEOF
  4815. }
  4816. b := dAtA[iNdEx]
  4817. iNdEx++
  4818. msglen |= (int(b) & 0x7F) << shift
  4819. if b < 0x80 {
  4820. break
  4821. }
  4822. }
  4823. if msglen < 0 {
  4824. return ErrInvalidLengthObjects
  4825. }
  4826. postIndex := iNdEx + msglen
  4827. if postIndex > l {
  4828. return io.ErrUnexpectedEOF
  4829. }
  4830. if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4831. return err
  4832. }
  4833. iNdEx = postIndex
  4834. case 6:
  4835. if wireType != 2 {
  4836. return fmt.Errorf("proto: wrong wireType = %d for field ManagerStatus", wireType)
  4837. }
  4838. var msglen int
  4839. for shift := uint(0); ; shift += 7 {
  4840. if shift >= 64 {
  4841. return ErrIntOverflowObjects
  4842. }
  4843. if iNdEx >= l {
  4844. return io.ErrUnexpectedEOF
  4845. }
  4846. b := dAtA[iNdEx]
  4847. iNdEx++
  4848. msglen |= (int(b) & 0x7F) << shift
  4849. if b < 0x80 {
  4850. break
  4851. }
  4852. }
  4853. if msglen < 0 {
  4854. return ErrInvalidLengthObjects
  4855. }
  4856. postIndex := iNdEx + msglen
  4857. if postIndex > l {
  4858. return io.ErrUnexpectedEOF
  4859. }
  4860. if m.ManagerStatus == nil {
  4861. m.ManagerStatus = &ManagerStatus{}
  4862. }
  4863. if err := m.ManagerStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4864. return err
  4865. }
  4866. iNdEx = postIndex
  4867. case 7:
  4868. if wireType != 2 {
  4869. return fmt.Errorf("proto: wrong wireType = %d for field Attachment", wireType)
  4870. }
  4871. var msglen int
  4872. for shift := uint(0); ; shift += 7 {
  4873. if shift >= 64 {
  4874. return ErrIntOverflowObjects
  4875. }
  4876. if iNdEx >= l {
  4877. return io.ErrUnexpectedEOF
  4878. }
  4879. b := dAtA[iNdEx]
  4880. iNdEx++
  4881. msglen |= (int(b) & 0x7F) << shift
  4882. if b < 0x80 {
  4883. break
  4884. }
  4885. }
  4886. if msglen < 0 {
  4887. return ErrInvalidLengthObjects
  4888. }
  4889. postIndex := iNdEx + msglen
  4890. if postIndex > l {
  4891. return io.ErrUnexpectedEOF
  4892. }
  4893. if m.Attachment == nil {
  4894. m.Attachment = &NetworkAttachment{}
  4895. }
  4896. if err := m.Attachment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4897. return err
  4898. }
  4899. iNdEx = postIndex
  4900. case 8:
  4901. if wireType != 2 {
  4902. return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType)
  4903. }
  4904. var msglen int
  4905. for shift := uint(0); ; shift += 7 {
  4906. if shift >= 64 {
  4907. return ErrIntOverflowObjects
  4908. }
  4909. if iNdEx >= l {
  4910. return io.ErrUnexpectedEOF
  4911. }
  4912. b := dAtA[iNdEx]
  4913. iNdEx++
  4914. msglen |= (int(b) & 0x7F) << shift
  4915. if b < 0x80 {
  4916. break
  4917. }
  4918. }
  4919. if msglen < 0 {
  4920. return ErrInvalidLengthObjects
  4921. }
  4922. postIndex := iNdEx + msglen
  4923. if postIndex > l {
  4924. return io.ErrUnexpectedEOF
  4925. }
  4926. if err := m.Certificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4927. return err
  4928. }
  4929. iNdEx = postIndex
  4930. case 9:
  4931. if wireType != 0 {
  4932. return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
  4933. }
  4934. m.Role = 0
  4935. for shift := uint(0); ; shift += 7 {
  4936. if shift >= 64 {
  4937. return ErrIntOverflowObjects
  4938. }
  4939. if iNdEx >= l {
  4940. return io.ErrUnexpectedEOF
  4941. }
  4942. b := dAtA[iNdEx]
  4943. iNdEx++
  4944. m.Role |= (NodeRole(b) & 0x7F) << shift
  4945. if b < 0x80 {
  4946. break
  4947. }
  4948. }
  4949. case 10:
  4950. if wireType != 2 {
  4951. return fmt.Errorf("proto: wrong wireType = %d for field Attachments", wireType)
  4952. }
  4953. var msglen int
  4954. for shift := uint(0); ; shift += 7 {
  4955. if shift >= 64 {
  4956. return ErrIntOverflowObjects
  4957. }
  4958. if iNdEx >= l {
  4959. return io.ErrUnexpectedEOF
  4960. }
  4961. b := dAtA[iNdEx]
  4962. iNdEx++
  4963. msglen |= (int(b) & 0x7F) << shift
  4964. if b < 0x80 {
  4965. break
  4966. }
  4967. }
  4968. if msglen < 0 {
  4969. return ErrInvalidLengthObjects
  4970. }
  4971. postIndex := iNdEx + msglen
  4972. if postIndex > l {
  4973. return io.ErrUnexpectedEOF
  4974. }
  4975. m.Attachments = append(m.Attachments, &NetworkAttachment{})
  4976. if err := m.Attachments[len(m.Attachments)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4977. return err
  4978. }
  4979. iNdEx = postIndex
  4980. case 11:
  4981. if wireType != 0 {
  4982. return fmt.Errorf("proto: wrong wireType = %d for field VXLANUDPPort", wireType)
  4983. }
  4984. m.VXLANUDPPort = 0
  4985. for shift := uint(0); ; shift += 7 {
  4986. if shift >= 64 {
  4987. return ErrIntOverflowObjects
  4988. }
  4989. if iNdEx >= l {
  4990. return io.ErrUnexpectedEOF
  4991. }
  4992. b := dAtA[iNdEx]
  4993. iNdEx++
  4994. m.VXLANUDPPort |= (uint32(b) & 0x7F) << shift
  4995. if b < 0x80 {
  4996. break
  4997. }
  4998. }
  4999. default:
  5000. iNdEx = preIndex
  5001. skippy, err := skipObjects(dAtA[iNdEx:])
  5002. if err != nil {
  5003. return err
  5004. }
  5005. if skippy < 0 {
  5006. return ErrInvalidLengthObjects
  5007. }
  5008. if (iNdEx + skippy) > l {
  5009. return io.ErrUnexpectedEOF
  5010. }
  5011. iNdEx += skippy
  5012. }
  5013. }
  5014. if iNdEx > l {
  5015. return io.ErrUnexpectedEOF
  5016. }
  5017. return nil
  5018. }
  5019. func (m *Service) Unmarshal(dAtA []byte) error {
  5020. l := len(dAtA)
  5021. iNdEx := 0
  5022. for iNdEx < l {
  5023. preIndex := iNdEx
  5024. var wire uint64
  5025. for shift := uint(0); ; shift += 7 {
  5026. if shift >= 64 {
  5027. return ErrIntOverflowObjects
  5028. }
  5029. if iNdEx >= l {
  5030. return io.ErrUnexpectedEOF
  5031. }
  5032. b := dAtA[iNdEx]
  5033. iNdEx++
  5034. wire |= (uint64(b) & 0x7F) << shift
  5035. if b < 0x80 {
  5036. break
  5037. }
  5038. }
  5039. fieldNum := int32(wire >> 3)
  5040. wireType := int(wire & 0x7)
  5041. if wireType == 4 {
  5042. return fmt.Errorf("proto: Service: wiretype end group for non-group")
  5043. }
  5044. if fieldNum <= 0 {
  5045. return fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire)
  5046. }
  5047. switch fieldNum {
  5048. case 1:
  5049. if wireType != 2 {
  5050. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  5051. }
  5052. var stringLen uint64
  5053. for shift := uint(0); ; shift += 7 {
  5054. if shift >= 64 {
  5055. return ErrIntOverflowObjects
  5056. }
  5057. if iNdEx >= l {
  5058. return io.ErrUnexpectedEOF
  5059. }
  5060. b := dAtA[iNdEx]
  5061. iNdEx++
  5062. stringLen |= (uint64(b) & 0x7F) << shift
  5063. if b < 0x80 {
  5064. break
  5065. }
  5066. }
  5067. intStringLen := int(stringLen)
  5068. if intStringLen < 0 {
  5069. return ErrInvalidLengthObjects
  5070. }
  5071. postIndex := iNdEx + intStringLen
  5072. if postIndex > l {
  5073. return io.ErrUnexpectedEOF
  5074. }
  5075. m.ID = string(dAtA[iNdEx:postIndex])
  5076. iNdEx = postIndex
  5077. case 2:
  5078. if wireType != 2 {
  5079. return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType)
  5080. }
  5081. var msglen int
  5082. for shift := uint(0); ; shift += 7 {
  5083. if shift >= 64 {
  5084. return ErrIntOverflowObjects
  5085. }
  5086. if iNdEx >= l {
  5087. return io.ErrUnexpectedEOF
  5088. }
  5089. b := dAtA[iNdEx]
  5090. iNdEx++
  5091. msglen |= (int(b) & 0x7F) << shift
  5092. if b < 0x80 {
  5093. break
  5094. }
  5095. }
  5096. if msglen < 0 {
  5097. return ErrInvalidLengthObjects
  5098. }
  5099. postIndex := iNdEx + msglen
  5100. if postIndex > l {
  5101. return io.ErrUnexpectedEOF
  5102. }
  5103. if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5104. return err
  5105. }
  5106. iNdEx = postIndex
  5107. case 3:
  5108. if wireType != 2 {
  5109. return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
  5110. }
  5111. var msglen int
  5112. for shift := uint(0); ; shift += 7 {
  5113. if shift >= 64 {
  5114. return ErrIntOverflowObjects
  5115. }
  5116. if iNdEx >= l {
  5117. return io.ErrUnexpectedEOF
  5118. }
  5119. b := dAtA[iNdEx]
  5120. iNdEx++
  5121. msglen |= (int(b) & 0x7F) << shift
  5122. if b < 0x80 {
  5123. break
  5124. }
  5125. }
  5126. if msglen < 0 {
  5127. return ErrInvalidLengthObjects
  5128. }
  5129. postIndex := iNdEx + msglen
  5130. if postIndex > l {
  5131. return io.ErrUnexpectedEOF
  5132. }
  5133. if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5134. return err
  5135. }
  5136. iNdEx = postIndex
  5137. case 4:
  5138. if wireType != 2 {
  5139. return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType)
  5140. }
  5141. var msglen int
  5142. for shift := uint(0); ; shift += 7 {
  5143. if shift >= 64 {
  5144. return ErrIntOverflowObjects
  5145. }
  5146. if iNdEx >= l {
  5147. return io.ErrUnexpectedEOF
  5148. }
  5149. b := dAtA[iNdEx]
  5150. iNdEx++
  5151. msglen |= (int(b) & 0x7F) << shift
  5152. if b < 0x80 {
  5153. break
  5154. }
  5155. }
  5156. if msglen < 0 {
  5157. return ErrInvalidLengthObjects
  5158. }
  5159. postIndex := iNdEx + msglen
  5160. if postIndex > l {
  5161. return io.ErrUnexpectedEOF
  5162. }
  5163. if m.Endpoint == nil {
  5164. m.Endpoint = &Endpoint{}
  5165. }
  5166. if err := m.Endpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5167. return err
  5168. }
  5169. iNdEx = postIndex
  5170. case 5:
  5171. if wireType != 2 {
  5172. return fmt.Errorf("proto: wrong wireType = %d for field UpdateStatus", wireType)
  5173. }
  5174. var msglen int
  5175. for shift := uint(0); ; shift += 7 {
  5176. if shift >= 64 {
  5177. return ErrIntOverflowObjects
  5178. }
  5179. if iNdEx >= l {
  5180. return io.ErrUnexpectedEOF
  5181. }
  5182. b := dAtA[iNdEx]
  5183. iNdEx++
  5184. msglen |= (int(b) & 0x7F) << shift
  5185. if b < 0x80 {
  5186. break
  5187. }
  5188. }
  5189. if msglen < 0 {
  5190. return ErrInvalidLengthObjects
  5191. }
  5192. postIndex := iNdEx + msglen
  5193. if postIndex > l {
  5194. return io.ErrUnexpectedEOF
  5195. }
  5196. if m.UpdateStatus == nil {
  5197. m.UpdateStatus = &UpdateStatus{}
  5198. }
  5199. if err := m.UpdateStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5200. return err
  5201. }
  5202. iNdEx = postIndex
  5203. case 6:
  5204. if wireType != 2 {
  5205. return fmt.Errorf("proto: wrong wireType = %d for field PreviousSpec", wireType)
  5206. }
  5207. var msglen int
  5208. for shift := uint(0); ; shift += 7 {
  5209. if shift >= 64 {
  5210. return ErrIntOverflowObjects
  5211. }
  5212. if iNdEx >= l {
  5213. return io.ErrUnexpectedEOF
  5214. }
  5215. b := dAtA[iNdEx]
  5216. iNdEx++
  5217. msglen |= (int(b) & 0x7F) << shift
  5218. if b < 0x80 {
  5219. break
  5220. }
  5221. }
  5222. if msglen < 0 {
  5223. return ErrInvalidLengthObjects
  5224. }
  5225. postIndex := iNdEx + msglen
  5226. if postIndex > l {
  5227. return io.ErrUnexpectedEOF
  5228. }
  5229. if m.PreviousSpec == nil {
  5230. m.PreviousSpec = &ServiceSpec{}
  5231. }
  5232. if err := m.PreviousSpec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5233. return err
  5234. }
  5235. iNdEx = postIndex
  5236. case 7:
  5237. if wireType != 0 {
  5238. return fmt.Errorf("proto: wrong wireType = %d for field PendingDelete", wireType)
  5239. }
  5240. var v int
  5241. for shift := uint(0); ; shift += 7 {
  5242. if shift >= 64 {
  5243. return ErrIntOverflowObjects
  5244. }
  5245. if iNdEx >= l {
  5246. return io.ErrUnexpectedEOF
  5247. }
  5248. b := dAtA[iNdEx]
  5249. iNdEx++
  5250. v |= (int(b) & 0x7F) << shift
  5251. if b < 0x80 {
  5252. break
  5253. }
  5254. }
  5255. m.PendingDelete = bool(v != 0)
  5256. case 10:
  5257. if wireType != 2 {
  5258. return fmt.Errorf("proto: wrong wireType = %d for field SpecVersion", wireType)
  5259. }
  5260. var msglen int
  5261. for shift := uint(0); ; shift += 7 {
  5262. if shift >= 64 {
  5263. return ErrIntOverflowObjects
  5264. }
  5265. if iNdEx >= l {
  5266. return io.ErrUnexpectedEOF
  5267. }
  5268. b := dAtA[iNdEx]
  5269. iNdEx++
  5270. msglen |= (int(b) & 0x7F) << shift
  5271. if b < 0x80 {
  5272. break
  5273. }
  5274. }
  5275. if msglen < 0 {
  5276. return ErrInvalidLengthObjects
  5277. }
  5278. postIndex := iNdEx + msglen
  5279. if postIndex > l {
  5280. return io.ErrUnexpectedEOF
  5281. }
  5282. if m.SpecVersion == nil {
  5283. m.SpecVersion = &Version{}
  5284. }
  5285. if err := m.SpecVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5286. return err
  5287. }
  5288. iNdEx = postIndex
  5289. case 11:
  5290. if wireType != 2 {
  5291. return fmt.Errorf("proto: wrong wireType = %d for field PreviousSpecVersion", wireType)
  5292. }
  5293. var msglen int
  5294. for shift := uint(0); ; shift += 7 {
  5295. if shift >= 64 {
  5296. return ErrIntOverflowObjects
  5297. }
  5298. if iNdEx >= l {
  5299. return io.ErrUnexpectedEOF
  5300. }
  5301. b := dAtA[iNdEx]
  5302. iNdEx++
  5303. msglen |= (int(b) & 0x7F) << shift
  5304. if b < 0x80 {
  5305. break
  5306. }
  5307. }
  5308. if msglen < 0 {
  5309. return ErrInvalidLengthObjects
  5310. }
  5311. postIndex := iNdEx + msglen
  5312. if postIndex > l {
  5313. return io.ErrUnexpectedEOF
  5314. }
  5315. if m.PreviousSpecVersion == nil {
  5316. m.PreviousSpecVersion = &Version{}
  5317. }
  5318. if err := m.PreviousSpecVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5319. return err
  5320. }
  5321. iNdEx = postIndex
  5322. default:
  5323. iNdEx = preIndex
  5324. skippy, err := skipObjects(dAtA[iNdEx:])
  5325. if err != nil {
  5326. return err
  5327. }
  5328. if skippy < 0 {
  5329. return ErrInvalidLengthObjects
  5330. }
  5331. if (iNdEx + skippy) > l {
  5332. return io.ErrUnexpectedEOF
  5333. }
  5334. iNdEx += skippy
  5335. }
  5336. }
  5337. if iNdEx > l {
  5338. return io.ErrUnexpectedEOF
  5339. }
  5340. return nil
  5341. }
  5342. func (m *Endpoint) Unmarshal(dAtA []byte) error {
  5343. l := len(dAtA)
  5344. iNdEx := 0
  5345. for iNdEx < l {
  5346. preIndex := iNdEx
  5347. var wire uint64
  5348. for shift := uint(0); ; shift += 7 {
  5349. if shift >= 64 {
  5350. return ErrIntOverflowObjects
  5351. }
  5352. if iNdEx >= l {
  5353. return io.ErrUnexpectedEOF
  5354. }
  5355. b := dAtA[iNdEx]
  5356. iNdEx++
  5357. wire |= (uint64(b) & 0x7F) << shift
  5358. if b < 0x80 {
  5359. break
  5360. }
  5361. }
  5362. fieldNum := int32(wire >> 3)
  5363. wireType := int(wire & 0x7)
  5364. if wireType == 4 {
  5365. return fmt.Errorf("proto: Endpoint: wiretype end group for non-group")
  5366. }
  5367. if fieldNum <= 0 {
  5368. return fmt.Errorf("proto: Endpoint: illegal tag %d (wire type %d)", fieldNum, wire)
  5369. }
  5370. switch fieldNum {
  5371. case 1:
  5372. if wireType != 2 {
  5373. return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
  5374. }
  5375. var msglen int
  5376. for shift := uint(0); ; shift += 7 {
  5377. if shift >= 64 {
  5378. return ErrIntOverflowObjects
  5379. }
  5380. if iNdEx >= l {
  5381. return io.ErrUnexpectedEOF
  5382. }
  5383. b := dAtA[iNdEx]
  5384. iNdEx++
  5385. msglen |= (int(b) & 0x7F) << shift
  5386. if b < 0x80 {
  5387. break
  5388. }
  5389. }
  5390. if msglen < 0 {
  5391. return ErrInvalidLengthObjects
  5392. }
  5393. postIndex := iNdEx + msglen
  5394. if postIndex > l {
  5395. return io.ErrUnexpectedEOF
  5396. }
  5397. if m.Spec == nil {
  5398. m.Spec = &EndpointSpec{}
  5399. }
  5400. if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5401. return err
  5402. }
  5403. iNdEx = postIndex
  5404. case 2:
  5405. if wireType != 2 {
  5406. return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType)
  5407. }
  5408. var msglen int
  5409. for shift := uint(0); ; shift += 7 {
  5410. if shift >= 64 {
  5411. return ErrIntOverflowObjects
  5412. }
  5413. if iNdEx >= l {
  5414. return io.ErrUnexpectedEOF
  5415. }
  5416. b := dAtA[iNdEx]
  5417. iNdEx++
  5418. msglen |= (int(b) & 0x7F) << shift
  5419. if b < 0x80 {
  5420. break
  5421. }
  5422. }
  5423. if msglen < 0 {
  5424. return ErrInvalidLengthObjects
  5425. }
  5426. postIndex := iNdEx + msglen
  5427. if postIndex > l {
  5428. return io.ErrUnexpectedEOF
  5429. }
  5430. m.Ports = append(m.Ports, &PortConfig{})
  5431. if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5432. return err
  5433. }
  5434. iNdEx = postIndex
  5435. case 3:
  5436. if wireType != 2 {
  5437. return fmt.Errorf("proto: wrong wireType = %d for field VirtualIPs", wireType)
  5438. }
  5439. var msglen int
  5440. for shift := uint(0); ; shift += 7 {
  5441. if shift >= 64 {
  5442. return ErrIntOverflowObjects
  5443. }
  5444. if iNdEx >= l {
  5445. return io.ErrUnexpectedEOF
  5446. }
  5447. b := dAtA[iNdEx]
  5448. iNdEx++
  5449. msglen |= (int(b) & 0x7F) << shift
  5450. if b < 0x80 {
  5451. break
  5452. }
  5453. }
  5454. if msglen < 0 {
  5455. return ErrInvalidLengthObjects
  5456. }
  5457. postIndex := iNdEx + msglen
  5458. if postIndex > l {
  5459. return io.ErrUnexpectedEOF
  5460. }
  5461. m.VirtualIPs = append(m.VirtualIPs, &Endpoint_VirtualIP{})
  5462. if err := m.VirtualIPs[len(m.VirtualIPs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5463. return err
  5464. }
  5465. iNdEx = postIndex
  5466. default:
  5467. iNdEx = preIndex
  5468. skippy, err := skipObjects(dAtA[iNdEx:])
  5469. if err != nil {
  5470. return err
  5471. }
  5472. if skippy < 0 {
  5473. return ErrInvalidLengthObjects
  5474. }
  5475. if (iNdEx + skippy) > l {
  5476. return io.ErrUnexpectedEOF
  5477. }
  5478. iNdEx += skippy
  5479. }
  5480. }
  5481. if iNdEx > l {
  5482. return io.ErrUnexpectedEOF
  5483. }
  5484. return nil
  5485. }
  5486. func (m *Endpoint_VirtualIP) Unmarshal(dAtA []byte) error {
  5487. l := len(dAtA)
  5488. iNdEx := 0
  5489. for iNdEx < l {
  5490. preIndex := iNdEx
  5491. var wire uint64
  5492. for shift := uint(0); ; shift += 7 {
  5493. if shift >= 64 {
  5494. return ErrIntOverflowObjects
  5495. }
  5496. if iNdEx >= l {
  5497. return io.ErrUnexpectedEOF
  5498. }
  5499. b := dAtA[iNdEx]
  5500. iNdEx++
  5501. wire |= (uint64(b) & 0x7F) << shift
  5502. if b < 0x80 {
  5503. break
  5504. }
  5505. }
  5506. fieldNum := int32(wire >> 3)
  5507. wireType := int(wire & 0x7)
  5508. if wireType == 4 {
  5509. return fmt.Errorf("proto: VirtualIP: wiretype end group for non-group")
  5510. }
  5511. if fieldNum <= 0 {
  5512. return fmt.Errorf("proto: VirtualIP: illegal tag %d (wire type %d)", fieldNum, wire)
  5513. }
  5514. switch fieldNum {
  5515. case 1:
  5516. if wireType != 2 {
  5517. return fmt.Errorf("proto: wrong wireType = %d for field NetworkID", wireType)
  5518. }
  5519. var stringLen uint64
  5520. for shift := uint(0); ; shift += 7 {
  5521. if shift >= 64 {
  5522. return ErrIntOverflowObjects
  5523. }
  5524. if iNdEx >= l {
  5525. return io.ErrUnexpectedEOF
  5526. }
  5527. b := dAtA[iNdEx]
  5528. iNdEx++
  5529. stringLen |= (uint64(b) & 0x7F) << shift
  5530. if b < 0x80 {
  5531. break
  5532. }
  5533. }
  5534. intStringLen := int(stringLen)
  5535. if intStringLen < 0 {
  5536. return ErrInvalidLengthObjects
  5537. }
  5538. postIndex := iNdEx + intStringLen
  5539. if postIndex > l {
  5540. return io.ErrUnexpectedEOF
  5541. }
  5542. m.NetworkID = string(dAtA[iNdEx:postIndex])
  5543. iNdEx = postIndex
  5544. case 2:
  5545. if wireType != 2 {
  5546. return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType)
  5547. }
  5548. var stringLen uint64
  5549. for shift := uint(0); ; shift += 7 {
  5550. if shift >= 64 {
  5551. return ErrIntOverflowObjects
  5552. }
  5553. if iNdEx >= l {
  5554. return io.ErrUnexpectedEOF
  5555. }
  5556. b := dAtA[iNdEx]
  5557. iNdEx++
  5558. stringLen |= (uint64(b) & 0x7F) << shift
  5559. if b < 0x80 {
  5560. break
  5561. }
  5562. }
  5563. intStringLen := int(stringLen)
  5564. if intStringLen < 0 {
  5565. return ErrInvalidLengthObjects
  5566. }
  5567. postIndex := iNdEx + intStringLen
  5568. if postIndex > l {
  5569. return io.ErrUnexpectedEOF
  5570. }
  5571. m.Addr = string(dAtA[iNdEx:postIndex])
  5572. iNdEx = postIndex
  5573. default:
  5574. iNdEx = preIndex
  5575. skippy, err := skipObjects(dAtA[iNdEx:])
  5576. if err != nil {
  5577. return err
  5578. }
  5579. if skippy < 0 {
  5580. return ErrInvalidLengthObjects
  5581. }
  5582. if (iNdEx + skippy) > l {
  5583. return io.ErrUnexpectedEOF
  5584. }
  5585. iNdEx += skippy
  5586. }
  5587. }
  5588. if iNdEx > l {
  5589. return io.ErrUnexpectedEOF
  5590. }
  5591. return nil
  5592. }
  5593. func (m *Task) Unmarshal(dAtA []byte) error {
  5594. l := len(dAtA)
  5595. iNdEx := 0
  5596. for iNdEx < l {
  5597. preIndex := iNdEx
  5598. var wire uint64
  5599. for shift := uint(0); ; shift += 7 {
  5600. if shift >= 64 {
  5601. return ErrIntOverflowObjects
  5602. }
  5603. if iNdEx >= l {
  5604. return io.ErrUnexpectedEOF
  5605. }
  5606. b := dAtA[iNdEx]
  5607. iNdEx++
  5608. wire |= (uint64(b) & 0x7F) << shift
  5609. if b < 0x80 {
  5610. break
  5611. }
  5612. }
  5613. fieldNum := int32(wire >> 3)
  5614. wireType := int(wire & 0x7)
  5615. if wireType == 4 {
  5616. return fmt.Errorf("proto: Task: wiretype end group for non-group")
  5617. }
  5618. if fieldNum <= 0 {
  5619. return fmt.Errorf("proto: Task: illegal tag %d (wire type %d)", fieldNum, wire)
  5620. }
  5621. switch fieldNum {
  5622. case 1:
  5623. if wireType != 2 {
  5624. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  5625. }
  5626. var stringLen uint64
  5627. for shift := uint(0); ; shift += 7 {
  5628. if shift >= 64 {
  5629. return ErrIntOverflowObjects
  5630. }
  5631. if iNdEx >= l {
  5632. return io.ErrUnexpectedEOF
  5633. }
  5634. b := dAtA[iNdEx]
  5635. iNdEx++
  5636. stringLen |= (uint64(b) & 0x7F) << shift
  5637. if b < 0x80 {
  5638. break
  5639. }
  5640. }
  5641. intStringLen := int(stringLen)
  5642. if intStringLen < 0 {
  5643. return ErrInvalidLengthObjects
  5644. }
  5645. postIndex := iNdEx + intStringLen
  5646. if postIndex > l {
  5647. return io.ErrUnexpectedEOF
  5648. }
  5649. m.ID = string(dAtA[iNdEx:postIndex])
  5650. iNdEx = postIndex
  5651. case 2:
  5652. if wireType != 2 {
  5653. return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType)
  5654. }
  5655. var msglen int
  5656. for shift := uint(0); ; shift += 7 {
  5657. if shift >= 64 {
  5658. return ErrIntOverflowObjects
  5659. }
  5660. if iNdEx >= l {
  5661. return io.ErrUnexpectedEOF
  5662. }
  5663. b := dAtA[iNdEx]
  5664. iNdEx++
  5665. msglen |= (int(b) & 0x7F) << shift
  5666. if b < 0x80 {
  5667. break
  5668. }
  5669. }
  5670. if msglen < 0 {
  5671. return ErrInvalidLengthObjects
  5672. }
  5673. postIndex := iNdEx + msglen
  5674. if postIndex > l {
  5675. return io.ErrUnexpectedEOF
  5676. }
  5677. if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5678. return err
  5679. }
  5680. iNdEx = postIndex
  5681. case 3:
  5682. if wireType != 2 {
  5683. return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
  5684. }
  5685. var msglen int
  5686. for shift := uint(0); ; shift += 7 {
  5687. if shift >= 64 {
  5688. return ErrIntOverflowObjects
  5689. }
  5690. if iNdEx >= l {
  5691. return io.ErrUnexpectedEOF
  5692. }
  5693. b := dAtA[iNdEx]
  5694. iNdEx++
  5695. msglen |= (int(b) & 0x7F) << shift
  5696. if b < 0x80 {
  5697. break
  5698. }
  5699. }
  5700. if msglen < 0 {
  5701. return ErrInvalidLengthObjects
  5702. }
  5703. postIndex := iNdEx + msglen
  5704. if postIndex > l {
  5705. return io.ErrUnexpectedEOF
  5706. }
  5707. if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5708. return err
  5709. }
  5710. iNdEx = postIndex
  5711. case 4:
  5712. if wireType != 2 {
  5713. return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType)
  5714. }
  5715. var stringLen uint64
  5716. for shift := uint(0); ; shift += 7 {
  5717. if shift >= 64 {
  5718. return ErrIntOverflowObjects
  5719. }
  5720. if iNdEx >= l {
  5721. return io.ErrUnexpectedEOF
  5722. }
  5723. b := dAtA[iNdEx]
  5724. iNdEx++
  5725. stringLen |= (uint64(b) & 0x7F) << shift
  5726. if b < 0x80 {
  5727. break
  5728. }
  5729. }
  5730. intStringLen := int(stringLen)
  5731. if intStringLen < 0 {
  5732. return ErrInvalidLengthObjects
  5733. }
  5734. postIndex := iNdEx + intStringLen
  5735. if postIndex > l {
  5736. return io.ErrUnexpectedEOF
  5737. }
  5738. m.ServiceID = string(dAtA[iNdEx:postIndex])
  5739. iNdEx = postIndex
  5740. case 5:
  5741. if wireType != 0 {
  5742. return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType)
  5743. }
  5744. m.Slot = 0
  5745. for shift := uint(0); ; shift += 7 {
  5746. if shift >= 64 {
  5747. return ErrIntOverflowObjects
  5748. }
  5749. if iNdEx >= l {
  5750. return io.ErrUnexpectedEOF
  5751. }
  5752. b := dAtA[iNdEx]
  5753. iNdEx++
  5754. m.Slot |= (uint64(b) & 0x7F) << shift
  5755. if b < 0x80 {
  5756. break
  5757. }
  5758. }
  5759. case 6:
  5760. if wireType != 2 {
  5761. return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  5762. }
  5763. var stringLen uint64
  5764. for shift := uint(0); ; shift += 7 {
  5765. if shift >= 64 {
  5766. return ErrIntOverflowObjects
  5767. }
  5768. if iNdEx >= l {
  5769. return io.ErrUnexpectedEOF
  5770. }
  5771. b := dAtA[iNdEx]
  5772. iNdEx++
  5773. stringLen |= (uint64(b) & 0x7F) << shift
  5774. if b < 0x80 {
  5775. break
  5776. }
  5777. }
  5778. intStringLen := int(stringLen)
  5779. if intStringLen < 0 {
  5780. return ErrInvalidLengthObjects
  5781. }
  5782. postIndex := iNdEx + intStringLen
  5783. if postIndex > l {
  5784. return io.ErrUnexpectedEOF
  5785. }
  5786. m.NodeID = string(dAtA[iNdEx:postIndex])
  5787. iNdEx = postIndex
  5788. case 7:
  5789. if wireType != 2 {
  5790. return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType)
  5791. }
  5792. var msglen int
  5793. for shift := uint(0); ; shift += 7 {
  5794. if shift >= 64 {
  5795. return ErrIntOverflowObjects
  5796. }
  5797. if iNdEx >= l {
  5798. return io.ErrUnexpectedEOF
  5799. }
  5800. b := dAtA[iNdEx]
  5801. iNdEx++
  5802. msglen |= (int(b) & 0x7F) << shift
  5803. if b < 0x80 {
  5804. break
  5805. }
  5806. }
  5807. if msglen < 0 {
  5808. return ErrInvalidLengthObjects
  5809. }
  5810. postIndex := iNdEx + msglen
  5811. if postIndex > l {
  5812. return io.ErrUnexpectedEOF
  5813. }
  5814. if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5815. return err
  5816. }
  5817. iNdEx = postIndex
  5818. case 8:
  5819. if wireType != 2 {
  5820. return fmt.Errorf("proto: wrong wireType = %d for field ServiceAnnotations", wireType)
  5821. }
  5822. var msglen int
  5823. for shift := uint(0); ; shift += 7 {
  5824. if shift >= 64 {
  5825. return ErrIntOverflowObjects
  5826. }
  5827. if iNdEx >= l {
  5828. return io.ErrUnexpectedEOF
  5829. }
  5830. b := dAtA[iNdEx]
  5831. iNdEx++
  5832. msglen |= (int(b) & 0x7F) << shift
  5833. if b < 0x80 {
  5834. break
  5835. }
  5836. }
  5837. if msglen < 0 {
  5838. return ErrInvalidLengthObjects
  5839. }
  5840. postIndex := iNdEx + msglen
  5841. if postIndex > l {
  5842. return io.ErrUnexpectedEOF
  5843. }
  5844. if err := m.ServiceAnnotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5845. return err
  5846. }
  5847. iNdEx = postIndex
  5848. case 9:
  5849. if wireType != 2 {
  5850. return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
  5851. }
  5852. var msglen int
  5853. for shift := uint(0); ; shift += 7 {
  5854. if shift >= 64 {
  5855. return ErrIntOverflowObjects
  5856. }
  5857. if iNdEx >= l {
  5858. return io.ErrUnexpectedEOF
  5859. }
  5860. b := dAtA[iNdEx]
  5861. iNdEx++
  5862. msglen |= (int(b) & 0x7F) << shift
  5863. if b < 0x80 {
  5864. break
  5865. }
  5866. }
  5867. if msglen < 0 {
  5868. return ErrInvalidLengthObjects
  5869. }
  5870. postIndex := iNdEx + msglen
  5871. if postIndex > l {
  5872. return io.ErrUnexpectedEOF
  5873. }
  5874. if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5875. return err
  5876. }
  5877. iNdEx = postIndex
  5878. case 10:
  5879. if wireType != 0 {
  5880. return fmt.Errorf("proto: wrong wireType = %d for field DesiredState", wireType)
  5881. }
  5882. m.DesiredState = 0
  5883. for shift := uint(0); ; shift += 7 {
  5884. if shift >= 64 {
  5885. return ErrIntOverflowObjects
  5886. }
  5887. if iNdEx >= l {
  5888. return io.ErrUnexpectedEOF
  5889. }
  5890. b := dAtA[iNdEx]
  5891. iNdEx++
  5892. m.DesiredState |= (TaskState(b) & 0x7F) << shift
  5893. if b < 0x80 {
  5894. break
  5895. }
  5896. }
  5897. case 11:
  5898. if wireType != 2 {
  5899. return fmt.Errorf("proto: wrong wireType = %d for field Networks", wireType)
  5900. }
  5901. var msglen int
  5902. for shift := uint(0); ; shift += 7 {
  5903. if shift >= 64 {
  5904. return ErrIntOverflowObjects
  5905. }
  5906. if iNdEx >= l {
  5907. return io.ErrUnexpectedEOF
  5908. }
  5909. b := dAtA[iNdEx]
  5910. iNdEx++
  5911. msglen |= (int(b) & 0x7F) << shift
  5912. if b < 0x80 {
  5913. break
  5914. }
  5915. }
  5916. if msglen < 0 {
  5917. return ErrInvalidLengthObjects
  5918. }
  5919. postIndex := iNdEx + msglen
  5920. if postIndex > l {
  5921. return io.ErrUnexpectedEOF
  5922. }
  5923. m.Networks = append(m.Networks, &NetworkAttachment{})
  5924. if err := m.Networks[len(m.Networks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5925. return err
  5926. }
  5927. iNdEx = postIndex
  5928. case 12:
  5929. if wireType != 2 {
  5930. return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType)
  5931. }
  5932. var msglen int
  5933. for shift := uint(0); ; shift += 7 {
  5934. if shift >= 64 {
  5935. return ErrIntOverflowObjects
  5936. }
  5937. if iNdEx >= l {
  5938. return io.ErrUnexpectedEOF
  5939. }
  5940. b := dAtA[iNdEx]
  5941. iNdEx++
  5942. msglen |= (int(b) & 0x7F) << shift
  5943. if b < 0x80 {
  5944. break
  5945. }
  5946. }
  5947. if msglen < 0 {
  5948. return ErrInvalidLengthObjects
  5949. }
  5950. postIndex := iNdEx + msglen
  5951. if postIndex > l {
  5952. return io.ErrUnexpectedEOF
  5953. }
  5954. if m.Endpoint == nil {
  5955. m.Endpoint = &Endpoint{}
  5956. }
  5957. if err := m.Endpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5958. return err
  5959. }
  5960. iNdEx = postIndex
  5961. case 13:
  5962. if wireType != 2 {
  5963. return fmt.Errorf("proto: wrong wireType = %d for field LogDriver", wireType)
  5964. }
  5965. var msglen int
  5966. for shift := uint(0); ; shift += 7 {
  5967. if shift >= 64 {
  5968. return ErrIntOverflowObjects
  5969. }
  5970. if iNdEx >= l {
  5971. return io.ErrUnexpectedEOF
  5972. }
  5973. b := dAtA[iNdEx]
  5974. iNdEx++
  5975. msglen |= (int(b) & 0x7F) << shift
  5976. if b < 0x80 {
  5977. break
  5978. }
  5979. }
  5980. if msglen < 0 {
  5981. return ErrInvalidLengthObjects
  5982. }
  5983. postIndex := iNdEx + msglen
  5984. if postIndex > l {
  5985. return io.ErrUnexpectedEOF
  5986. }
  5987. if m.LogDriver == nil {
  5988. m.LogDriver = &Driver{}
  5989. }
  5990. if err := m.LogDriver.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  5991. return err
  5992. }
  5993. iNdEx = postIndex
  5994. case 14:
  5995. if wireType != 2 {
  5996. return fmt.Errorf("proto: wrong wireType = %d for field SpecVersion", wireType)
  5997. }
  5998. var msglen int
  5999. for shift := uint(0); ; shift += 7 {
  6000. if shift >= 64 {
  6001. return ErrIntOverflowObjects
  6002. }
  6003. if iNdEx >= l {
  6004. return io.ErrUnexpectedEOF
  6005. }
  6006. b := dAtA[iNdEx]
  6007. iNdEx++
  6008. msglen |= (int(b) & 0x7F) << shift
  6009. if b < 0x80 {
  6010. break
  6011. }
  6012. }
  6013. if msglen < 0 {
  6014. return ErrInvalidLengthObjects
  6015. }
  6016. postIndex := iNdEx + msglen
  6017. if postIndex > l {
  6018. return io.ErrUnexpectedEOF
  6019. }
  6020. if m.SpecVersion == nil {
  6021. m.SpecVersion = &Version{}
  6022. }
  6023. if err := m.SpecVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6024. return err
  6025. }
  6026. iNdEx = postIndex
  6027. case 15:
  6028. if wireType != 2 {
  6029. return fmt.Errorf("proto: wrong wireType = %d for field AssignedGenericResources", wireType)
  6030. }
  6031. var msglen int
  6032. for shift := uint(0); ; shift += 7 {
  6033. if shift >= 64 {
  6034. return ErrIntOverflowObjects
  6035. }
  6036. if iNdEx >= l {
  6037. return io.ErrUnexpectedEOF
  6038. }
  6039. b := dAtA[iNdEx]
  6040. iNdEx++
  6041. msglen |= (int(b) & 0x7F) << shift
  6042. if b < 0x80 {
  6043. break
  6044. }
  6045. }
  6046. if msglen < 0 {
  6047. return ErrInvalidLengthObjects
  6048. }
  6049. postIndex := iNdEx + msglen
  6050. if postIndex > l {
  6051. return io.ErrUnexpectedEOF
  6052. }
  6053. m.AssignedGenericResources = append(m.AssignedGenericResources, &GenericResource{})
  6054. if err := m.AssignedGenericResources[len(m.AssignedGenericResources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6055. return err
  6056. }
  6057. iNdEx = postIndex
  6058. default:
  6059. iNdEx = preIndex
  6060. skippy, err := skipObjects(dAtA[iNdEx:])
  6061. if err != nil {
  6062. return err
  6063. }
  6064. if skippy < 0 {
  6065. return ErrInvalidLengthObjects
  6066. }
  6067. if (iNdEx + skippy) > l {
  6068. return io.ErrUnexpectedEOF
  6069. }
  6070. iNdEx += skippy
  6071. }
  6072. }
  6073. if iNdEx > l {
  6074. return io.ErrUnexpectedEOF
  6075. }
  6076. return nil
  6077. }
  6078. func (m *NetworkAttachment) Unmarshal(dAtA []byte) error {
  6079. l := len(dAtA)
  6080. iNdEx := 0
  6081. for iNdEx < l {
  6082. preIndex := iNdEx
  6083. var wire uint64
  6084. for shift := uint(0); ; shift += 7 {
  6085. if shift >= 64 {
  6086. return ErrIntOverflowObjects
  6087. }
  6088. if iNdEx >= l {
  6089. return io.ErrUnexpectedEOF
  6090. }
  6091. b := dAtA[iNdEx]
  6092. iNdEx++
  6093. wire |= (uint64(b) & 0x7F) << shift
  6094. if b < 0x80 {
  6095. break
  6096. }
  6097. }
  6098. fieldNum := int32(wire >> 3)
  6099. wireType := int(wire & 0x7)
  6100. if wireType == 4 {
  6101. return fmt.Errorf("proto: NetworkAttachment: wiretype end group for non-group")
  6102. }
  6103. if fieldNum <= 0 {
  6104. return fmt.Errorf("proto: NetworkAttachment: illegal tag %d (wire type %d)", fieldNum, wire)
  6105. }
  6106. switch fieldNum {
  6107. case 1:
  6108. if wireType != 2 {
  6109. return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType)
  6110. }
  6111. var msglen int
  6112. for shift := uint(0); ; shift += 7 {
  6113. if shift >= 64 {
  6114. return ErrIntOverflowObjects
  6115. }
  6116. if iNdEx >= l {
  6117. return io.ErrUnexpectedEOF
  6118. }
  6119. b := dAtA[iNdEx]
  6120. iNdEx++
  6121. msglen |= (int(b) & 0x7F) << shift
  6122. if b < 0x80 {
  6123. break
  6124. }
  6125. }
  6126. if msglen < 0 {
  6127. return ErrInvalidLengthObjects
  6128. }
  6129. postIndex := iNdEx + msglen
  6130. if postIndex > l {
  6131. return io.ErrUnexpectedEOF
  6132. }
  6133. if m.Network == nil {
  6134. m.Network = &Network{}
  6135. }
  6136. if err := m.Network.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6137. return err
  6138. }
  6139. iNdEx = postIndex
  6140. case 2:
  6141. if wireType != 2 {
  6142. return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType)
  6143. }
  6144. var stringLen uint64
  6145. for shift := uint(0); ; shift += 7 {
  6146. if shift >= 64 {
  6147. return ErrIntOverflowObjects
  6148. }
  6149. if iNdEx >= l {
  6150. return io.ErrUnexpectedEOF
  6151. }
  6152. b := dAtA[iNdEx]
  6153. iNdEx++
  6154. stringLen |= (uint64(b) & 0x7F) << shift
  6155. if b < 0x80 {
  6156. break
  6157. }
  6158. }
  6159. intStringLen := int(stringLen)
  6160. if intStringLen < 0 {
  6161. return ErrInvalidLengthObjects
  6162. }
  6163. postIndex := iNdEx + intStringLen
  6164. if postIndex > l {
  6165. return io.ErrUnexpectedEOF
  6166. }
  6167. m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex]))
  6168. iNdEx = postIndex
  6169. case 3:
  6170. if wireType != 2 {
  6171. return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType)
  6172. }
  6173. var stringLen uint64
  6174. for shift := uint(0); ; shift += 7 {
  6175. if shift >= 64 {
  6176. return ErrIntOverflowObjects
  6177. }
  6178. if iNdEx >= l {
  6179. return io.ErrUnexpectedEOF
  6180. }
  6181. b := dAtA[iNdEx]
  6182. iNdEx++
  6183. stringLen |= (uint64(b) & 0x7F) << shift
  6184. if b < 0x80 {
  6185. break
  6186. }
  6187. }
  6188. intStringLen := int(stringLen)
  6189. if intStringLen < 0 {
  6190. return ErrInvalidLengthObjects
  6191. }
  6192. postIndex := iNdEx + intStringLen
  6193. if postIndex > l {
  6194. return io.ErrUnexpectedEOF
  6195. }
  6196. m.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex]))
  6197. iNdEx = postIndex
  6198. case 4:
  6199. if wireType != 2 {
  6200. return fmt.Errorf("proto: wrong wireType = %d for field DriverAttachmentOpts", wireType)
  6201. }
  6202. var msglen int
  6203. for shift := uint(0); ; shift += 7 {
  6204. if shift >= 64 {
  6205. return ErrIntOverflowObjects
  6206. }
  6207. if iNdEx >= l {
  6208. return io.ErrUnexpectedEOF
  6209. }
  6210. b := dAtA[iNdEx]
  6211. iNdEx++
  6212. msglen |= (int(b) & 0x7F) << shift
  6213. if b < 0x80 {
  6214. break
  6215. }
  6216. }
  6217. if msglen < 0 {
  6218. return ErrInvalidLengthObjects
  6219. }
  6220. postIndex := iNdEx + msglen
  6221. if postIndex > l {
  6222. return io.ErrUnexpectedEOF
  6223. }
  6224. if m.DriverAttachmentOpts == nil {
  6225. m.DriverAttachmentOpts = make(map[string]string)
  6226. }
  6227. var mapkey string
  6228. var mapvalue string
  6229. for iNdEx < postIndex {
  6230. entryPreIndex := iNdEx
  6231. var wire uint64
  6232. for shift := uint(0); ; shift += 7 {
  6233. if shift >= 64 {
  6234. return ErrIntOverflowObjects
  6235. }
  6236. if iNdEx >= l {
  6237. return io.ErrUnexpectedEOF
  6238. }
  6239. b := dAtA[iNdEx]
  6240. iNdEx++
  6241. wire |= (uint64(b) & 0x7F) << shift
  6242. if b < 0x80 {
  6243. break
  6244. }
  6245. }
  6246. fieldNum := int32(wire >> 3)
  6247. if fieldNum == 1 {
  6248. var stringLenmapkey uint64
  6249. for shift := uint(0); ; shift += 7 {
  6250. if shift >= 64 {
  6251. return ErrIntOverflowObjects
  6252. }
  6253. if iNdEx >= l {
  6254. return io.ErrUnexpectedEOF
  6255. }
  6256. b := dAtA[iNdEx]
  6257. iNdEx++
  6258. stringLenmapkey |= (uint64(b) & 0x7F) << shift
  6259. if b < 0x80 {
  6260. break
  6261. }
  6262. }
  6263. intStringLenmapkey := int(stringLenmapkey)
  6264. if intStringLenmapkey < 0 {
  6265. return ErrInvalidLengthObjects
  6266. }
  6267. postStringIndexmapkey := iNdEx + intStringLenmapkey
  6268. if postStringIndexmapkey > l {
  6269. return io.ErrUnexpectedEOF
  6270. }
  6271. mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
  6272. iNdEx = postStringIndexmapkey
  6273. } else if fieldNum == 2 {
  6274. var stringLenmapvalue uint64
  6275. for shift := uint(0); ; shift += 7 {
  6276. if shift >= 64 {
  6277. return ErrIntOverflowObjects
  6278. }
  6279. if iNdEx >= l {
  6280. return io.ErrUnexpectedEOF
  6281. }
  6282. b := dAtA[iNdEx]
  6283. iNdEx++
  6284. stringLenmapvalue |= (uint64(b) & 0x7F) << shift
  6285. if b < 0x80 {
  6286. break
  6287. }
  6288. }
  6289. intStringLenmapvalue := int(stringLenmapvalue)
  6290. if intStringLenmapvalue < 0 {
  6291. return ErrInvalidLengthObjects
  6292. }
  6293. postStringIndexmapvalue := iNdEx + intStringLenmapvalue
  6294. if postStringIndexmapvalue > l {
  6295. return io.ErrUnexpectedEOF
  6296. }
  6297. mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
  6298. iNdEx = postStringIndexmapvalue
  6299. } else {
  6300. iNdEx = entryPreIndex
  6301. skippy, err := skipObjects(dAtA[iNdEx:])
  6302. if err != nil {
  6303. return err
  6304. }
  6305. if skippy < 0 {
  6306. return ErrInvalidLengthObjects
  6307. }
  6308. if (iNdEx + skippy) > postIndex {
  6309. return io.ErrUnexpectedEOF
  6310. }
  6311. iNdEx += skippy
  6312. }
  6313. }
  6314. m.DriverAttachmentOpts[mapkey] = mapvalue
  6315. iNdEx = postIndex
  6316. default:
  6317. iNdEx = preIndex
  6318. skippy, err := skipObjects(dAtA[iNdEx:])
  6319. if err != nil {
  6320. return err
  6321. }
  6322. if skippy < 0 {
  6323. return ErrInvalidLengthObjects
  6324. }
  6325. if (iNdEx + skippy) > l {
  6326. return io.ErrUnexpectedEOF
  6327. }
  6328. iNdEx += skippy
  6329. }
  6330. }
  6331. if iNdEx > l {
  6332. return io.ErrUnexpectedEOF
  6333. }
  6334. return nil
  6335. }
  6336. func (m *Network) Unmarshal(dAtA []byte) error {
  6337. l := len(dAtA)
  6338. iNdEx := 0
  6339. for iNdEx < l {
  6340. preIndex := iNdEx
  6341. var wire uint64
  6342. for shift := uint(0); ; shift += 7 {
  6343. if shift >= 64 {
  6344. return ErrIntOverflowObjects
  6345. }
  6346. if iNdEx >= l {
  6347. return io.ErrUnexpectedEOF
  6348. }
  6349. b := dAtA[iNdEx]
  6350. iNdEx++
  6351. wire |= (uint64(b) & 0x7F) << shift
  6352. if b < 0x80 {
  6353. break
  6354. }
  6355. }
  6356. fieldNum := int32(wire >> 3)
  6357. wireType := int(wire & 0x7)
  6358. if wireType == 4 {
  6359. return fmt.Errorf("proto: Network: wiretype end group for non-group")
  6360. }
  6361. if fieldNum <= 0 {
  6362. return fmt.Errorf("proto: Network: illegal tag %d (wire type %d)", fieldNum, wire)
  6363. }
  6364. switch fieldNum {
  6365. case 1:
  6366. if wireType != 2 {
  6367. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  6368. }
  6369. var stringLen uint64
  6370. for shift := uint(0); ; shift += 7 {
  6371. if shift >= 64 {
  6372. return ErrIntOverflowObjects
  6373. }
  6374. if iNdEx >= l {
  6375. return io.ErrUnexpectedEOF
  6376. }
  6377. b := dAtA[iNdEx]
  6378. iNdEx++
  6379. stringLen |= (uint64(b) & 0x7F) << shift
  6380. if b < 0x80 {
  6381. break
  6382. }
  6383. }
  6384. intStringLen := int(stringLen)
  6385. if intStringLen < 0 {
  6386. return ErrInvalidLengthObjects
  6387. }
  6388. postIndex := iNdEx + intStringLen
  6389. if postIndex > l {
  6390. return io.ErrUnexpectedEOF
  6391. }
  6392. m.ID = string(dAtA[iNdEx:postIndex])
  6393. iNdEx = postIndex
  6394. case 2:
  6395. if wireType != 2 {
  6396. return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType)
  6397. }
  6398. var msglen int
  6399. for shift := uint(0); ; shift += 7 {
  6400. if shift >= 64 {
  6401. return ErrIntOverflowObjects
  6402. }
  6403. if iNdEx >= l {
  6404. return io.ErrUnexpectedEOF
  6405. }
  6406. b := dAtA[iNdEx]
  6407. iNdEx++
  6408. msglen |= (int(b) & 0x7F) << shift
  6409. if b < 0x80 {
  6410. break
  6411. }
  6412. }
  6413. if msglen < 0 {
  6414. return ErrInvalidLengthObjects
  6415. }
  6416. postIndex := iNdEx + msglen
  6417. if postIndex > l {
  6418. return io.ErrUnexpectedEOF
  6419. }
  6420. if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6421. return err
  6422. }
  6423. iNdEx = postIndex
  6424. case 3:
  6425. if wireType != 2 {
  6426. return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
  6427. }
  6428. var msglen int
  6429. for shift := uint(0); ; shift += 7 {
  6430. if shift >= 64 {
  6431. return ErrIntOverflowObjects
  6432. }
  6433. if iNdEx >= l {
  6434. return io.ErrUnexpectedEOF
  6435. }
  6436. b := dAtA[iNdEx]
  6437. iNdEx++
  6438. msglen |= (int(b) & 0x7F) << shift
  6439. if b < 0x80 {
  6440. break
  6441. }
  6442. }
  6443. if msglen < 0 {
  6444. return ErrInvalidLengthObjects
  6445. }
  6446. postIndex := iNdEx + msglen
  6447. if postIndex > l {
  6448. return io.ErrUnexpectedEOF
  6449. }
  6450. if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6451. return err
  6452. }
  6453. iNdEx = postIndex
  6454. case 4:
  6455. if wireType != 2 {
  6456. return fmt.Errorf("proto: wrong wireType = %d for field DriverState", wireType)
  6457. }
  6458. var msglen int
  6459. for shift := uint(0); ; shift += 7 {
  6460. if shift >= 64 {
  6461. return ErrIntOverflowObjects
  6462. }
  6463. if iNdEx >= l {
  6464. return io.ErrUnexpectedEOF
  6465. }
  6466. b := dAtA[iNdEx]
  6467. iNdEx++
  6468. msglen |= (int(b) & 0x7F) << shift
  6469. if b < 0x80 {
  6470. break
  6471. }
  6472. }
  6473. if msglen < 0 {
  6474. return ErrInvalidLengthObjects
  6475. }
  6476. postIndex := iNdEx + msglen
  6477. if postIndex > l {
  6478. return io.ErrUnexpectedEOF
  6479. }
  6480. if m.DriverState == nil {
  6481. m.DriverState = &Driver{}
  6482. }
  6483. if err := m.DriverState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6484. return err
  6485. }
  6486. iNdEx = postIndex
  6487. case 5:
  6488. if wireType != 2 {
  6489. return fmt.Errorf("proto: wrong wireType = %d for field IPAM", wireType)
  6490. }
  6491. var msglen int
  6492. for shift := uint(0); ; shift += 7 {
  6493. if shift >= 64 {
  6494. return ErrIntOverflowObjects
  6495. }
  6496. if iNdEx >= l {
  6497. return io.ErrUnexpectedEOF
  6498. }
  6499. b := dAtA[iNdEx]
  6500. iNdEx++
  6501. msglen |= (int(b) & 0x7F) << shift
  6502. if b < 0x80 {
  6503. break
  6504. }
  6505. }
  6506. if msglen < 0 {
  6507. return ErrInvalidLengthObjects
  6508. }
  6509. postIndex := iNdEx + msglen
  6510. if postIndex > l {
  6511. return io.ErrUnexpectedEOF
  6512. }
  6513. if m.IPAM == nil {
  6514. m.IPAM = &IPAMOptions{}
  6515. }
  6516. if err := m.IPAM.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6517. return err
  6518. }
  6519. iNdEx = postIndex
  6520. case 6:
  6521. if wireType != 0 {
  6522. return fmt.Errorf("proto: wrong wireType = %d for field PendingDelete", wireType)
  6523. }
  6524. var v int
  6525. for shift := uint(0); ; shift += 7 {
  6526. if shift >= 64 {
  6527. return ErrIntOverflowObjects
  6528. }
  6529. if iNdEx >= l {
  6530. return io.ErrUnexpectedEOF
  6531. }
  6532. b := dAtA[iNdEx]
  6533. iNdEx++
  6534. v |= (int(b) & 0x7F) << shift
  6535. if b < 0x80 {
  6536. break
  6537. }
  6538. }
  6539. m.PendingDelete = bool(v != 0)
  6540. default:
  6541. iNdEx = preIndex
  6542. skippy, err := skipObjects(dAtA[iNdEx:])
  6543. if err != nil {
  6544. return err
  6545. }
  6546. if skippy < 0 {
  6547. return ErrInvalidLengthObjects
  6548. }
  6549. if (iNdEx + skippy) > l {
  6550. return io.ErrUnexpectedEOF
  6551. }
  6552. iNdEx += skippy
  6553. }
  6554. }
  6555. if iNdEx > l {
  6556. return io.ErrUnexpectedEOF
  6557. }
  6558. return nil
  6559. }
  6560. func (m *Cluster) Unmarshal(dAtA []byte) error {
  6561. l := len(dAtA)
  6562. iNdEx := 0
  6563. for iNdEx < l {
  6564. preIndex := iNdEx
  6565. var wire uint64
  6566. for shift := uint(0); ; shift += 7 {
  6567. if shift >= 64 {
  6568. return ErrIntOverflowObjects
  6569. }
  6570. if iNdEx >= l {
  6571. return io.ErrUnexpectedEOF
  6572. }
  6573. b := dAtA[iNdEx]
  6574. iNdEx++
  6575. wire |= (uint64(b) & 0x7F) << shift
  6576. if b < 0x80 {
  6577. break
  6578. }
  6579. }
  6580. fieldNum := int32(wire >> 3)
  6581. wireType := int(wire & 0x7)
  6582. if wireType == 4 {
  6583. return fmt.Errorf("proto: Cluster: wiretype end group for non-group")
  6584. }
  6585. if fieldNum <= 0 {
  6586. return fmt.Errorf("proto: Cluster: illegal tag %d (wire type %d)", fieldNum, wire)
  6587. }
  6588. switch fieldNum {
  6589. case 1:
  6590. if wireType != 2 {
  6591. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  6592. }
  6593. var stringLen uint64
  6594. for shift := uint(0); ; shift += 7 {
  6595. if shift >= 64 {
  6596. return ErrIntOverflowObjects
  6597. }
  6598. if iNdEx >= l {
  6599. return io.ErrUnexpectedEOF
  6600. }
  6601. b := dAtA[iNdEx]
  6602. iNdEx++
  6603. stringLen |= (uint64(b) & 0x7F) << shift
  6604. if b < 0x80 {
  6605. break
  6606. }
  6607. }
  6608. intStringLen := int(stringLen)
  6609. if intStringLen < 0 {
  6610. return ErrInvalidLengthObjects
  6611. }
  6612. postIndex := iNdEx + intStringLen
  6613. if postIndex > l {
  6614. return io.ErrUnexpectedEOF
  6615. }
  6616. m.ID = string(dAtA[iNdEx:postIndex])
  6617. iNdEx = postIndex
  6618. case 2:
  6619. if wireType != 2 {
  6620. return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType)
  6621. }
  6622. var msglen int
  6623. for shift := uint(0); ; shift += 7 {
  6624. if shift >= 64 {
  6625. return ErrIntOverflowObjects
  6626. }
  6627. if iNdEx >= l {
  6628. return io.ErrUnexpectedEOF
  6629. }
  6630. b := dAtA[iNdEx]
  6631. iNdEx++
  6632. msglen |= (int(b) & 0x7F) << shift
  6633. if b < 0x80 {
  6634. break
  6635. }
  6636. }
  6637. if msglen < 0 {
  6638. return ErrInvalidLengthObjects
  6639. }
  6640. postIndex := iNdEx + msglen
  6641. if postIndex > l {
  6642. return io.ErrUnexpectedEOF
  6643. }
  6644. if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6645. return err
  6646. }
  6647. iNdEx = postIndex
  6648. case 3:
  6649. if wireType != 2 {
  6650. return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
  6651. }
  6652. var msglen int
  6653. for shift := uint(0); ; shift += 7 {
  6654. if shift >= 64 {
  6655. return ErrIntOverflowObjects
  6656. }
  6657. if iNdEx >= l {
  6658. return io.ErrUnexpectedEOF
  6659. }
  6660. b := dAtA[iNdEx]
  6661. iNdEx++
  6662. msglen |= (int(b) & 0x7F) << shift
  6663. if b < 0x80 {
  6664. break
  6665. }
  6666. }
  6667. if msglen < 0 {
  6668. return ErrInvalidLengthObjects
  6669. }
  6670. postIndex := iNdEx + msglen
  6671. if postIndex > l {
  6672. return io.ErrUnexpectedEOF
  6673. }
  6674. if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6675. return err
  6676. }
  6677. iNdEx = postIndex
  6678. case 4:
  6679. if wireType != 2 {
  6680. return fmt.Errorf("proto: wrong wireType = %d for field RootCA", wireType)
  6681. }
  6682. var msglen int
  6683. for shift := uint(0); ; shift += 7 {
  6684. if shift >= 64 {
  6685. return ErrIntOverflowObjects
  6686. }
  6687. if iNdEx >= l {
  6688. return io.ErrUnexpectedEOF
  6689. }
  6690. b := dAtA[iNdEx]
  6691. iNdEx++
  6692. msglen |= (int(b) & 0x7F) << shift
  6693. if b < 0x80 {
  6694. break
  6695. }
  6696. }
  6697. if msglen < 0 {
  6698. return ErrInvalidLengthObjects
  6699. }
  6700. postIndex := iNdEx + msglen
  6701. if postIndex > l {
  6702. return io.ErrUnexpectedEOF
  6703. }
  6704. if err := m.RootCA.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6705. return err
  6706. }
  6707. iNdEx = postIndex
  6708. case 5:
  6709. if wireType != 2 {
  6710. return fmt.Errorf("proto: wrong wireType = %d for field NetworkBootstrapKeys", wireType)
  6711. }
  6712. var msglen int
  6713. for shift := uint(0); ; shift += 7 {
  6714. if shift >= 64 {
  6715. return ErrIntOverflowObjects
  6716. }
  6717. if iNdEx >= l {
  6718. return io.ErrUnexpectedEOF
  6719. }
  6720. b := dAtA[iNdEx]
  6721. iNdEx++
  6722. msglen |= (int(b) & 0x7F) << shift
  6723. if b < 0x80 {
  6724. break
  6725. }
  6726. }
  6727. if msglen < 0 {
  6728. return ErrInvalidLengthObjects
  6729. }
  6730. postIndex := iNdEx + msglen
  6731. if postIndex > l {
  6732. return io.ErrUnexpectedEOF
  6733. }
  6734. m.NetworkBootstrapKeys = append(m.NetworkBootstrapKeys, &EncryptionKey{})
  6735. if err := m.NetworkBootstrapKeys[len(m.NetworkBootstrapKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6736. return err
  6737. }
  6738. iNdEx = postIndex
  6739. case 6:
  6740. if wireType != 0 {
  6741. return fmt.Errorf("proto: wrong wireType = %d for field EncryptionKeyLamportClock", wireType)
  6742. }
  6743. m.EncryptionKeyLamportClock = 0
  6744. for shift := uint(0); ; shift += 7 {
  6745. if shift >= 64 {
  6746. return ErrIntOverflowObjects
  6747. }
  6748. if iNdEx >= l {
  6749. return io.ErrUnexpectedEOF
  6750. }
  6751. b := dAtA[iNdEx]
  6752. iNdEx++
  6753. m.EncryptionKeyLamportClock |= (uint64(b) & 0x7F) << shift
  6754. if b < 0x80 {
  6755. break
  6756. }
  6757. }
  6758. case 8:
  6759. if wireType != 2 {
  6760. return fmt.Errorf("proto: wrong wireType = %d for field BlacklistedCertificates", wireType)
  6761. }
  6762. var msglen int
  6763. for shift := uint(0); ; shift += 7 {
  6764. if shift >= 64 {
  6765. return ErrIntOverflowObjects
  6766. }
  6767. if iNdEx >= l {
  6768. return io.ErrUnexpectedEOF
  6769. }
  6770. b := dAtA[iNdEx]
  6771. iNdEx++
  6772. msglen |= (int(b) & 0x7F) << shift
  6773. if b < 0x80 {
  6774. break
  6775. }
  6776. }
  6777. if msglen < 0 {
  6778. return ErrInvalidLengthObjects
  6779. }
  6780. postIndex := iNdEx + msglen
  6781. if postIndex > l {
  6782. return io.ErrUnexpectedEOF
  6783. }
  6784. if m.BlacklistedCertificates == nil {
  6785. m.BlacklistedCertificates = make(map[string]*BlacklistedCertificate)
  6786. }
  6787. var mapkey string
  6788. var mapvalue *BlacklistedCertificate
  6789. for iNdEx < postIndex {
  6790. entryPreIndex := iNdEx
  6791. var wire uint64
  6792. for shift := uint(0); ; shift += 7 {
  6793. if shift >= 64 {
  6794. return ErrIntOverflowObjects
  6795. }
  6796. if iNdEx >= l {
  6797. return io.ErrUnexpectedEOF
  6798. }
  6799. b := dAtA[iNdEx]
  6800. iNdEx++
  6801. wire |= (uint64(b) & 0x7F) << shift
  6802. if b < 0x80 {
  6803. break
  6804. }
  6805. }
  6806. fieldNum := int32(wire >> 3)
  6807. if fieldNum == 1 {
  6808. var stringLenmapkey uint64
  6809. for shift := uint(0); ; shift += 7 {
  6810. if shift >= 64 {
  6811. return ErrIntOverflowObjects
  6812. }
  6813. if iNdEx >= l {
  6814. return io.ErrUnexpectedEOF
  6815. }
  6816. b := dAtA[iNdEx]
  6817. iNdEx++
  6818. stringLenmapkey |= (uint64(b) & 0x7F) << shift
  6819. if b < 0x80 {
  6820. break
  6821. }
  6822. }
  6823. intStringLenmapkey := int(stringLenmapkey)
  6824. if intStringLenmapkey < 0 {
  6825. return ErrInvalidLengthObjects
  6826. }
  6827. postStringIndexmapkey := iNdEx + intStringLenmapkey
  6828. if postStringIndexmapkey > l {
  6829. return io.ErrUnexpectedEOF
  6830. }
  6831. mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
  6832. iNdEx = postStringIndexmapkey
  6833. } else if fieldNum == 2 {
  6834. var mapmsglen int
  6835. for shift := uint(0); ; shift += 7 {
  6836. if shift >= 64 {
  6837. return ErrIntOverflowObjects
  6838. }
  6839. if iNdEx >= l {
  6840. return io.ErrUnexpectedEOF
  6841. }
  6842. b := dAtA[iNdEx]
  6843. iNdEx++
  6844. mapmsglen |= (int(b) & 0x7F) << shift
  6845. if b < 0x80 {
  6846. break
  6847. }
  6848. }
  6849. if mapmsglen < 0 {
  6850. return ErrInvalidLengthObjects
  6851. }
  6852. postmsgIndex := iNdEx + mapmsglen
  6853. if mapmsglen < 0 {
  6854. return ErrInvalidLengthObjects
  6855. }
  6856. if postmsgIndex > l {
  6857. return io.ErrUnexpectedEOF
  6858. }
  6859. mapvalue = &BlacklistedCertificate{}
  6860. if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
  6861. return err
  6862. }
  6863. iNdEx = postmsgIndex
  6864. } else {
  6865. iNdEx = entryPreIndex
  6866. skippy, err := skipObjects(dAtA[iNdEx:])
  6867. if err != nil {
  6868. return err
  6869. }
  6870. if skippy < 0 {
  6871. return ErrInvalidLengthObjects
  6872. }
  6873. if (iNdEx + skippy) > postIndex {
  6874. return io.ErrUnexpectedEOF
  6875. }
  6876. iNdEx += skippy
  6877. }
  6878. }
  6879. m.BlacklistedCertificates[mapkey] = mapvalue
  6880. iNdEx = postIndex
  6881. case 9:
  6882. if wireType != 2 {
  6883. return fmt.Errorf("proto: wrong wireType = %d for field UnlockKeys", wireType)
  6884. }
  6885. var msglen int
  6886. for shift := uint(0); ; shift += 7 {
  6887. if shift >= 64 {
  6888. return ErrIntOverflowObjects
  6889. }
  6890. if iNdEx >= l {
  6891. return io.ErrUnexpectedEOF
  6892. }
  6893. b := dAtA[iNdEx]
  6894. iNdEx++
  6895. msglen |= (int(b) & 0x7F) << shift
  6896. if b < 0x80 {
  6897. break
  6898. }
  6899. }
  6900. if msglen < 0 {
  6901. return ErrInvalidLengthObjects
  6902. }
  6903. postIndex := iNdEx + msglen
  6904. if postIndex > l {
  6905. return io.ErrUnexpectedEOF
  6906. }
  6907. m.UnlockKeys = append(m.UnlockKeys, &EncryptionKey{})
  6908. if err := m.UnlockKeys[len(m.UnlockKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  6909. return err
  6910. }
  6911. iNdEx = postIndex
  6912. case 10:
  6913. if wireType != 0 {
  6914. return fmt.Errorf("proto: wrong wireType = %d for field FIPS", wireType)
  6915. }
  6916. var v int
  6917. for shift := uint(0); ; shift += 7 {
  6918. if shift >= 64 {
  6919. return ErrIntOverflowObjects
  6920. }
  6921. if iNdEx >= l {
  6922. return io.ErrUnexpectedEOF
  6923. }
  6924. b := dAtA[iNdEx]
  6925. iNdEx++
  6926. v |= (int(b) & 0x7F) << shift
  6927. if b < 0x80 {
  6928. break
  6929. }
  6930. }
  6931. m.FIPS = bool(v != 0)
  6932. case 11:
  6933. if wireType != 2 {
  6934. return fmt.Errorf("proto: wrong wireType = %d for field DefaultAddressPool", wireType)
  6935. }
  6936. var stringLen uint64
  6937. for shift := uint(0); ; shift += 7 {
  6938. if shift >= 64 {
  6939. return ErrIntOverflowObjects
  6940. }
  6941. if iNdEx >= l {
  6942. return io.ErrUnexpectedEOF
  6943. }
  6944. b := dAtA[iNdEx]
  6945. iNdEx++
  6946. stringLen |= (uint64(b) & 0x7F) << shift
  6947. if b < 0x80 {
  6948. break
  6949. }
  6950. }
  6951. intStringLen := int(stringLen)
  6952. if intStringLen < 0 {
  6953. return ErrInvalidLengthObjects
  6954. }
  6955. postIndex := iNdEx + intStringLen
  6956. if postIndex > l {
  6957. return io.ErrUnexpectedEOF
  6958. }
  6959. m.DefaultAddressPool = append(m.DefaultAddressPool, string(dAtA[iNdEx:postIndex]))
  6960. iNdEx = postIndex
  6961. case 12:
  6962. if wireType != 0 {
  6963. return fmt.Errorf("proto: wrong wireType = %d for field SubnetSize", wireType)
  6964. }
  6965. m.SubnetSize = 0
  6966. for shift := uint(0); ; shift += 7 {
  6967. if shift >= 64 {
  6968. return ErrIntOverflowObjects
  6969. }
  6970. if iNdEx >= l {
  6971. return io.ErrUnexpectedEOF
  6972. }
  6973. b := dAtA[iNdEx]
  6974. iNdEx++
  6975. m.SubnetSize |= (uint32(b) & 0x7F) << shift
  6976. if b < 0x80 {
  6977. break
  6978. }
  6979. }
  6980. case 13:
  6981. if wireType != 0 {
  6982. return fmt.Errorf("proto: wrong wireType = %d for field VXLANUDPPort", wireType)
  6983. }
  6984. m.VXLANUDPPort = 0
  6985. for shift := uint(0); ; shift += 7 {
  6986. if shift >= 64 {
  6987. return ErrIntOverflowObjects
  6988. }
  6989. if iNdEx >= l {
  6990. return io.ErrUnexpectedEOF
  6991. }
  6992. b := dAtA[iNdEx]
  6993. iNdEx++
  6994. m.VXLANUDPPort |= (uint32(b) & 0x7F) << shift
  6995. if b < 0x80 {
  6996. break
  6997. }
  6998. }
  6999. default:
  7000. iNdEx = preIndex
  7001. skippy, err := skipObjects(dAtA[iNdEx:])
  7002. if err != nil {
  7003. return err
  7004. }
  7005. if skippy < 0 {
  7006. return ErrInvalidLengthObjects
  7007. }
  7008. if (iNdEx + skippy) > l {
  7009. return io.ErrUnexpectedEOF
  7010. }
  7011. iNdEx += skippy
  7012. }
  7013. }
  7014. if iNdEx > l {
  7015. return io.ErrUnexpectedEOF
  7016. }
  7017. return nil
  7018. }
  7019. func (m *Secret) Unmarshal(dAtA []byte) error {
  7020. l := len(dAtA)
  7021. iNdEx := 0
  7022. for iNdEx < l {
  7023. preIndex := iNdEx
  7024. var wire uint64
  7025. for shift := uint(0); ; shift += 7 {
  7026. if shift >= 64 {
  7027. return ErrIntOverflowObjects
  7028. }
  7029. if iNdEx >= l {
  7030. return io.ErrUnexpectedEOF
  7031. }
  7032. b := dAtA[iNdEx]
  7033. iNdEx++
  7034. wire |= (uint64(b) & 0x7F) << shift
  7035. if b < 0x80 {
  7036. break
  7037. }
  7038. }
  7039. fieldNum := int32(wire >> 3)
  7040. wireType := int(wire & 0x7)
  7041. if wireType == 4 {
  7042. return fmt.Errorf("proto: Secret: wiretype end group for non-group")
  7043. }
  7044. if fieldNum <= 0 {
  7045. return fmt.Errorf("proto: Secret: illegal tag %d (wire type %d)", fieldNum, wire)
  7046. }
  7047. switch fieldNum {
  7048. case 1:
  7049. if wireType != 2 {
  7050. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  7051. }
  7052. var stringLen uint64
  7053. for shift := uint(0); ; shift += 7 {
  7054. if shift >= 64 {
  7055. return ErrIntOverflowObjects
  7056. }
  7057. if iNdEx >= l {
  7058. return io.ErrUnexpectedEOF
  7059. }
  7060. b := dAtA[iNdEx]
  7061. iNdEx++
  7062. stringLen |= (uint64(b) & 0x7F) << shift
  7063. if b < 0x80 {
  7064. break
  7065. }
  7066. }
  7067. intStringLen := int(stringLen)
  7068. if intStringLen < 0 {
  7069. return ErrInvalidLengthObjects
  7070. }
  7071. postIndex := iNdEx + intStringLen
  7072. if postIndex > l {
  7073. return io.ErrUnexpectedEOF
  7074. }
  7075. m.ID = string(dAtA[iNdEx:postIndex])
  7076. iNdEx = postIndex
  7077. case 2:
  7078. if wireType != 2 {
  7079. return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType)
  7080. }
  7081. var msglen int
  7082. for shift := uint(0); ; shift += 7 {
  7083. if shift >= 64 {
  7084. return ErrIntOverflowObjects
  7085. }
  7086. if iNdEx >= l {
  7087. return io.ErrUnexpectedEOF
  7088. }
  7089. b := dAtA[iNdEx]
  7090. iNdEx++
  7091. msglen |= (int(b) & 0x7F) << shift
  7092. if b < 0x80 {
  7093. break
  7094. }
  7095. }
  7096. if msglen < 0 {
  7097. return ErrInvalidLengthObjects
  7098. }
  7099. postIndex := iNdEx + msglen
  7100. if postIndex > l {
  7101. return io.ErrUnexpectedEOF
  7102. }
  7103. if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  7104. return err
  7105. }
  7106. iNdEx = postIndex
  7107. case 3:
  7108. if wireType != 2 {
  7109. return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
  7110. }
  7111. var msglen int
  7112. for shift := uint(0); ; shift += 7 {
  7113. if shift >= 64 {
  7114. return ErrIntOverflowObjects
  7115. }
  7116. if iNdEx >= l {
  7117. return io.ErrUnexpectedEOF
  7118. }
  7119. b := dAtA[iNdEx]
  7120. iNdEx++
  7121. msglen |= (int(b) & 0x7F) << shift
  7122. if b < 0x80 {
  7123. break
  7124. }
  7125. }
  7126. if msglen < 0 {
  7127. return ErrInvalidLengthObjects
  7128. }
  7129. postIndex := iNdEx + msglen
  7130. if postIndex > l {
  7131. return io.ErrUnexpectedEOF
  7132. }
  7133. if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  7134. return err
  7135. }
  7136. iNdEx = postIndex
  7137. case 4:
  7138. if wireType != 0 {
  7139. return fmt.Errorf("proto: wrong wireType = %d for field Internal", wireType)
  7140. }
  7141. var v int
  7142. for shift := uint(0); ; shift += 7 {
  7143. if shift >= 64 {
  7144. return ErrIntOverflowObjects
  7145. }
  7146. if iNdEx >= l {
  7147. return io.ErrUnexpectedEOF
  7148. }
  7149. b := dAtA[iNdEx]
  7150. iNdEx++
  7151. v |= (int(b) & 0x7F) << shift
  7152. if b < 0x80 {
  7153. break
  7154. }
  7155. }
  7156. m.Internal = bool(v != 0)
  7157. default:
  7158. iNdEx = preIndex
  7159. skippy, err := skipObjects(dAtA[iNdEx:])
  7160. if err != nil {
  7161. return err
  7162. }
  7163. if skippy < 0 {
  7164. return ErrInvalidLengthObjects
  7165. }
  7166. if (iNdEx + skippy) > l {
  7167. return io.ErrUnexpectedEOF
  7168. }
  7169. iNdEx += skippy
  7170. }
  7171. }
  7172. if iNdEx > l {
  7173. return io.ErrUnexpectedEOF
  7174. }
  7175. return nil
  7176. }
  7177. func (m *Config) Unmarshal(dAtA []byte) error {
  7178. l := len(dAtA)
  7179. iNdEx := 0
  7180. for iNdEx < l {
  7181. preIndex := iNdEx
  7182. var wire uint64
  7183. for shift := uint(0); ; shift += 7 {
  7184. if shift >= 64 {
  7185. return ErrIntOverflowObjects
  7186. }
  7187. if iNdEx >= l {
  7188. return io.ErrUnexpectedEOF
  7189. }
  7190. b := dAtA[iNdEx]
  7191. iNdEx++
  7192. wire |= (uint64(b) & 0x7F) << shift
  7193. if b < 0x80 {
  7194. break
  7195. }
  7196. }
  7197. fieldNum := int32(wire >> 3)
  7198. wireType := int(wire & 0x7)
  7199. if wireType == 4 {
  7200. return fmt.Errorf("proto: Config: wiretype end group for non-group")
  7201. }
  7202. if fieldNum <= 0 {
  7203. return fmt.Errorf("proto: Config: illegal tag %d (wire type %d)", fieldNum, wire)
  7204. }
  7205. switch fieldNum {
  7206. case 1:
  7207. if wireType != 2 {
  7208. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  7209. }
  7210. var stringLen uint64
  7211. for shift := uint(0); ; shift += 7 {
  7212. if shift >= 64 {
  7213. return ErrIntOverflowObjects
  7214. }
  7215. if iNdEx >= l {
  7216. return io.ErrUnexpectedEOF
  7217. }
  7218. b := dAtA[iNdEx]
  7219. iNdEx++
  7220. stringLen |= (uint64(b) & 0x7F) << shift
  7221. if b < 0x80 {
  7222. break
  7223. }
  7224. }
  7225. intStringLen := int(stringLen)
  7226. if intStringLen < 0 {
  7227. return ErrInvalidLengthObjects
  7228. }
  7229. postIndex := iNdEx + intStringLen
  7230. if postIndex > l {
  7231. return io.ErrUnexpectedEOF
  7232. }
  7233. m.ID = string(dAtA[iNdEx:postIndex])
  7234. iNdEx = postIndex
  7235. case 2:
  7236. if wireType != 2 {
  7237. return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType)
  7238. }
  7239. var msglen int
  7240. for shift := uint(0); ; shift += 7 {
  7241. if shift >= 64 {
  7242. return ErrIntOverflowObjects
  7243. }
  7244. if iNdEx >= l {
  7245. return io.ErrUnexpectedEOF
  7246. }
  7247. b := dAtA[iNdEx]
  7248. iNdEx++
  7249. msglen |= (int(b) & 0x7F) << shift
  7250. if b < 0x80 {
  7251. break
  7252. }
  7253. }
  7254. if msglen < 0 {
  7255. return ErrInvalidLengthObjects
  7256. }
  7257. postIndex := iNdEx + msglen
  7258. if postIndex > l {
  7259. return io.ErrUnexpectedEOF
  7260. }
  7261. if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  7262. return err
  7263. }
  7264. iNdEx = postIndex
  7265. case 3:
  7266. if wireType != 2 {
  7267. return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
  7268. }
  7269. var msglen int
  7270. for shift := uint(0); ; shift += 7 {
  7271. if shift >= 64 {
  7272. return ErrIntOverflowObjects
  7273. }
  7274. if iNdEx >= l {
  7275. return io.ErrUnexpectedEOF
  7276. }
  7277. b := dAtA[iNdEx]
  7278. iNdEx++
  7279. msglen |= (int(b) & 0x7F) << shift
  7280. if b < 0x80 {
  7281. break
  7282. }
  7283. }
  7284. if msglen < 0 {
  7285. return ErrInvalidLengthObjects
  7286. }
  7287. postIndex := iNdEx + msglen
  7288. if postIndex > l {
  7289. return io.ErrUnexpectedEOF
  7290. }
  7291. if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  7292. return err
  7293. }
  7294. iNdEx = postIndex
  7295. default:
  7296. iNdEx = preIndex
  7297. skippy, err := skipObjects(dAtA[iNdEx:])
  7298. if err != nil {
  7299. return err
  7300. }
  7301. if skippy < 0 {
  7302. return ErrInvalidLengthObjects
  7303. }
  7304. if (iNdEx + skippy) > l {
  7305. return io.ErrUnexpectedEOF
  7306. }
  7307. iNdEx += skippy
  7308. }
  7309. }
  7310. if iNdEx > l {
  7311. return io.ErrUnexpectedEOF
  7312. }
  7313. return nil
  7314. }
  7315. func (m *Resource) Unmarshal(dAtA []byte) error {
  7316. l := len(dAtA)
  7317. iNdEx := 0
  7318. for iNdEx < l {
  7319. preIndex := iNdEx
  7320. var wire uint64
  7321. for shift := uint(0); ; shift += 7 {
  7322. if shift >= 64 {
  7323. return ErrIntOverflowObjects
  7324. }
  7325. if iNdEx >= l {
  7326. return io.ErrUnexpectedEOF
  7327. }
  7328. b := dAtA[iNdEx]
  7329. iNdEx++
  7330. wire |= (uint64(b) & 0x7F) << shift
  7331. if b < 0x80 {
  7332. break
  7333. }
  7334. }
  7335. fieldNum := int32(wire >> 3)
  7336. wireType := int(wire & 0x7)
  7337. if wireType == 4 {
  7338. return fmt.Errorf("proto: Resource: wiretype end group for non-group")
  7339. }
  7340. if fieldNum <= 0 {
  7341. return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire)
  7342. }
  7343. switch fieldNum {
  7344. case 1:
  7345. if wireType != 2 {
  7346. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  7347. }
  7348. var stringLen uint64
  7349. for shift := uint(0); ; shift += 7 {
  7350. if shift >= 64 {
  7351. return ErrIntOverflowObjects
  7352. }
  7353. if iNdEx >= l {
  7354. return io.ErrUnexpectedEOF
  7355. }
  7356. b := dAtA[iNdEx]
  7357. iNdEx++
  7358. stringLen |= (uint64(b) & 0x7F) << shift
  7359. if b < 0x80 {
  7360. break
  7361. }
  7362. }
  7363. intStringLen := int(stringLen)
  7364. if intStringLen < 0 {
  7365. return ErrInvalidLengthObjects
  7366. }
  7367. postIndex := iNdEx + intStringLen
  7368. if postIndex > l {
  7369. return io.ErrUnexpectedEOF
  7370. }
  7371. m.ID = string(dAtA[iNdEx:postIndex])
  7372. iNdEx = postIndex
  7373. case 2:
  7374. if wireType != 2 {
  7375. return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType)
  7376. }
  7377. var msglen int
  7378. for shift := uint(0); ; shift += 7 {
  7379. if shift >= 64 {
  7380. return ErrIntOverflowObjects
  7381. }
  7382. if iNdEx >= l {
  7383. return io.ErrUnexpectedEOF
  7384. }
  7385. b := dAtA[iNdEx]
  7386. iNdEx++
  7387. msglen |= (int(b) & 0x7F) << shift
  7388. if b < 0x80 {
  7389. break
  7390. }
  7391. }
  7392. if msglen < 0 {
  7393. return ErrInvalidLengthObjects
  7394. }
  7395. postIndex := iNdEx + msglen
  7396. if postIndex > l {
  7397. return io.ErrUnexpectedEOF
  7398. }
  7399. if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  7400. return err
  7401. }
  7402. iNdEx = postIndex
  7403. case 3:
  7404. if wireType != 2 {
  7405. return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType)
  7406. }
  7407. var msglen int
  7408. for shift := uint(0); ; shift += 7 {
  7409. if shift >= 64 {
  7410. return ErrIntOverflowObjects
  7411. }
  7412. if iNdEx >= l {
  7413. return io.ErrUnexpectedEOF
  7414. }
  7415. b := dAtA[iNdEx]
  7416. iNdEx++
  7417. msglen |= (int(b) & 0x7F) << shift
  7418. if b < 0x80 {
  7419. break
  7420. }
  7421. }
  7422. if msglen < 0 {
  7423. return ErrInvalidLengthObjects
  7424. }
  7425. postIndex := iNdEx + msglen
  7426. if postIndex > l {
  7427. return io.ErrUnexpectedEOF
  7428. }
  7429. if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  7430. return err
  7431. }
  7432. iNdEx = postIndex
  7433. case 4:
  7434. if wireType != 2 {
  7435. return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
  7436. }
  7437. var stringLen uint64
  7438. for shift := uint(0); ; shift += 7 {
  7439. if shift >= 64 {
  7440. return ErrIntOverflowObjects
  7441. }
  7442. if iNdEx >= l {
  7443. return io.ErrUnexpectedEOF
  7444. }
  7445. b := dAtA[iNdEx]
  7446. iNdEx++
  7447. stringLen |= (uint64(b) & 0x7F) << shift
  7448. if b < 0x80 {
  7449. break
  7450. }
  7451. }
  7452. intStringLen := int(stringLen)
  7453. if intStringLen < 0 {
  7454. return ErrInvalidLengthObjects
  7455. }
  7456. postIndex := iNdEx + intStringLen
  7457. if postIndex > l {
  7458. return io.ErrUnexpectedEOF
  7459. }
  7460. m.Kind = string(dAtA[iNdEx:postIndex])
  7461. iNdEx = postIndex
  7462. case 5:
  7463. if wireType != 2 {
  7464. return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType)
  7465. }
  7466. var msglen int
  7467. for shift := uint(0); ; shift += 7 {
  7468. if shift >= 64 {
  7469. return ErrIntOverflowObjects
  7470. }
  7471. if iNdEx >= l {
  7472. return io.ErrUnexpectedEOF
  7473. }
  7474. b := dAtA[iNdEx]
  7475. iNdEx++
  7476. msglen |= (int(b) & 0x7F) << shift
  7477. if b < 0x80 {
  7478. break
  7479. }
  7480. }
  7481. if msglen < 0 {
  7482. return ErrInvalidLengthObjects
  7483. }
  7484. postIndex := iNdEx + msglen
  7485. if postIndex > l {
  7486. return io.ErrUnexpectedEOF
  7487. }
  7488. if m.Payload == nil {
  7489. m.Payload = &google_protobuf4.Any{}
  7490. }
  7491. if err := m.Payload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  7492. return err
  7493. }
  7494. iNdEx = postIndex
  7495. default:
  7496. iNdEx = preIndex
  7497. skippy, err := skipObjects(dAtA[iNdEx:])
  7498. if err != nil {
  7499. return err
  7500. }
  7501. if skippy < 0 {
  7502. return ErrInvalidLengthObjects
  7503. }
  7504. if (iNdEx + skippy) > l {
  7505. return io.ErrUnexpectedEOF
  7506. }
  7507. iNdEx += skippy
  7508. }
  7509. }
  7510. if iNdEx > l {
  7511. return io.ErrUnexpectedEOF
  7512. }
  7513. return nil
  7514. }
  7515. func (m *Extension) Unmarshal(dAtA []byte) error {
  7516. l := len(dAtA)
  7517. iNdEx := 0
  7518. for iNdEx < l {
  7519. preIndex := iNdEx
  7520. var wire uint64
  7521. for shift := uint(0); ; shift += 7 {
  7522. if shift >= 64 {
  7523. return ErrIntOverflowObjects
  7524. }
  7525. if iNdEx >= l {
  7526. return io.ErrUnexpectedEOF
  7527. }
  7528. b := dAtA[iNdEx]
  7529. iNdEx++
  7530. wire |= (uint64(b) & 0x7F) << shift
  7531. if b < 0x80 {
  7532. break
  7533. }
  7534. }
  7535. fieldNum := int32(wire >> 3)
  7536. wireType := int(wire & 0x7)
  7537. if wireType == 4 {
  7538. return fmt.Errorf("proto: Extension: wiretype end group for non-group")
  7539. }
  7540. if fieldNum <= 0 {
  7541. return fmt.Errorf("proto: Extension: illegal tag %d (wire type %d)", fieldNum, wire)
  7542. }
  7543. switch fieldNum {
  7544. case 1:
  7545. if wireType != 2 {
  7546. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  7547. }
  7548. var stringLen uint64
  7549. for shift := uint(0); ; shift += 7 {
  7550. if shift >= 64 {
  7551. return ErrIntOverflowObjects
  7552. }
  7553. if iNdEx >= l {
  7554. return io.ErrUnexpectedEOF
  7555. }
  7556. b := dAtA[iNdEx]
  7557. iNdEx++
  7558. stringLen |= (uint64(b) & 0x7F) << shift
  7559. if b < 0x80 {
  7560. break
  7561. }
  7562. }
  7563. intStringLen := int(stringLen)
  7564. if intStringLen < 0 {
  7565. return ErrInvalidLengthObjects
  7566. }
  7567. postIndex := iNdEx + intStringLen
  7568. if postIndex > l {
  7569. return io.ErrUnexpectedEOF
  7570. }
  7571. m.ID = string(dAtA[iNdEx:postIndex])
  7572. iNdEx = postIndex
  7573. case 2:
  7574. if wireType != 2 {
  7575. return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType)
  7576. }
  7577. var msglen int
  7578. for shift := uint(0); ; shift += 7 {
  7579. if shift >= 64 {
  7580. return ErrIntOverflowObjects
  7581. }
  7582. if iNdEx >= l {
  7583. return io.ErrUnexpectedEOF
  7584. }
  7585. b := dAtA[iNdEx]
  7586. iNdEx++
  7587. msglen |= (int(b) & 0x7F) << shift
  7588. if b < 0x80 {
  7589. break
  7590. }
  7591. }
  7592. if msglen < 0 {
  7593. return ErrInvalidLengthObjects
  7594. }
  7595. postIndex := iNdEx + msglen
  7596. if postIndex > l {
  7597. return io.ErrUnexpectedEOF
  7598. }
  7599. if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  7600. return err
  7601. }
  7602. iNdEx = postIndex
  7603. case 3:
  7604. if wireType != 2 {
  7605. return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType)
  7606. }
  7607. var msglen int
  7608. for shift := uint(0); ; shift += 7 {
  7609. if shift >= 64 {
  7610. return ErrIntOverflowObjects
  7611. }
  7612. if iNdEx >= l {
  7613. return io.ErrUnexpectedEOF
  7614. }
  7615. b := dAtA[iNdEx]
  7616. iNdEx++
  7617. msglen |= (int(b) & 0x7F) << shift
  7618. if b < 0x80 {
  7619. break
  7620. }
  7621. }
  7622. if msglen < 0 {
  7623. return ErrInvalidLengthObjects
  7624. }
  7625. postIndex := iNdEx + msglen
  7626. if postIndex > l {
  7627. return io.ErrUnexpectedEOF
  7628. }
  7629. if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  7630. return err
  7631. }
  7632. iNdEx = postIndex
  7633. case 4:
  7634. if wireType != 2 {
  7635. return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
  7636. }
  7637. var stringLen uint64
  7638. for shift := uint(0); ; shift += 7 {
  7639. if shift >= 64 {
  7640. return ErrIntOverflowObjects
  7641. }
  7642. if iNdEx >= l {
  7643. return io.ErrUnexpectedEOF
  7644. }
  7645. b := dAtA[iNdEx]
  7646. iNdEx++
  7647. stringLen |= (uint64(b) & 0x7F) << shift
  7648. if b < 0x80 {
  7649. break
  7650. }
  7651. }
  7652. intStringLen := int(stringLen)
  7653. if intStringLen < 0 {
  7654. return ErrInvalidLengthObjects
  7655. }
  7656. postIndex := iNdEx + intStringLen
  7657. if postIndex > l {
  7658. return io.ErrUnexpectedEOF
  7659. }
  7660. m.Description = string(dAtA[iNdEx:postIndex])
  7661. iNdEx = postIndex
  7662. default:
  7663. iNdEx = preIndex
  7664. skippy, err := skipObjects(dAtA[iNdEx:])
  7665. if err != nil {
  7666. return err
  7667. }
  7668. if skippy < 0 {
  7669. return ErrInvalidLengthObjects
  7670. }
  7671. if (iNdEx + skippy) > l {
  7672. return io.ErrUnexpectedEOF
  7673. }
  7674. iNdEx += skippy
  7675. }
  7676. }
  7677. if iNdEx > l {
  7678. return io.ErrUnexpectedEOF
  7679. }
  7680. return nil
  7681. }
  7682. func skipObjects(dAtA []byte) (n int, err error) {
  7683. l := len(dAtA)
  7684. iNdEx := 0
  7685. for iNdEx < l {
  7686. var wire uint64
  7687. for shift := uint(0); ; shift += 7 {
  7688. if shift >= 64 {
  7689. return 0, ErrIntOverflowObjects
  7690. }
  7691. if iNdEx >= l {
  7692. return 0, io.ErrUnexpectedEOF
  7693. }
  7694. b := dAtA[iNdEx]
  7695. iNdEx++
  7696. wire |= (uint64(b) & 0x7F) << shift
  7697. if b < 0x80 {
  7698. break
  7699. }
  7700. }
  7701. wireType := int(wire & 0x7)
  7702. switch wireType {
  7703. case 0:
  7704. for shift := uint(0); ; shift += 7 {
  7705. if shift >= 64 {
  7706. return 0, ErrIntOverflowObjects
  7707. }
  7708. if iNdEx >= l {
  7709. return 0, io.ErrUnexpectedEOF
  7710. }
  7711. iNdEx++
  7712. if dAtA[iNdEx-1] < 0x80 {
  7713. break
  7714. }
  7715. }
  7716. return iNdEx, nil
  7717. case 1:
  7718. iNdEx += 8
  7719. return iNdEx, nil
  7720. case 2:
  7721. var length int
  7722. for shift := uint(0); ; shift += 7 {
  7723. if shift >= 64 {
  7724. return 0, ErrIntOverflowObjects
  7725. }
  7726. if iNdEx >= l {
  7727. return 0, io.ErrUnexpectedEOF
  7728. }
  7729. b := dAtA[iNdEx]
  7730. iNdEx++
  7731. length |= (int(b) & 0x7F) << shift
  7732. if b < 0x80 {
  7733. break
  7734. }
  7735. }
  7736. iNdEx += length
  7737. if length < 0 {
  7738. return 0, ErrInvalidLengthObjects
  7739. }
  7740. return iNdEx, nil
  7741. case 3:
  7742. for {
  7743. var innerWire uint64
  7744. var start int = iNdEx
  7745. for shift := uint(0); ; shift += 7 {
  7746. if shift >= 64 {
  7747. return 0, ErrIntOverflowObjects
  7748. }
  7749. if iNdEx >= l {
  7750. return 0, io.ErrUnexpectedEOF
  7751. }
  7752. b := dAtA[iNdEx]
  7753. iNdEx++
  7754. innerWire |= (uint64(b) & 0x7F) << shift
  7755. if b < 0x80 {
  7756. break
  7757. }
  7758. }
  7759. innerWireType := int(innerWire & 0x7)
  7760. if innerWireType == 4 {
  7761. break
  7762. }
  7763. next, err := skipObjects(dAtA[start:])
  7764. if err != nil {
  7765. return 0, err
  7766. }
  7767. iNdEx = start + next
  7768. }
  7769. return iNdEx, nil
  7770. case 4:
  7771. return iNdEx, nil
  7772. case 5:
  7773. iNdEx += 4
  7774. return iNdEx, nil
  7775. default:
  7776. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  7777. }
  7778. }
  7779. panic("unreachable")
  7780. }
  7781. var (
  7782. ErrInvalidLengthObjects = fmt.Errorf("proto: negative length found during unmarshaling")
  7783. ErrIntOverflowObjects = fmt.Errorf("proto: integer overflow")
  7784. )
  7785. func init() { proto.RegisterFile("github.com/docker/swarmkit/api/objects.proto", fileDescriptorObjects) }
  7786. var fileDescriptorObjects = []byte{
  7787. // 1643 bytes of a gzipped FileDescriptorProto
  7788. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x73, 0x23, 0x47,
  7789. 0x15, 0xdf, 0x91, 0x67, 0xf5, 0xf1, 0xf4, 0xc1, 0xd2, 0x31, 0x66, 0x56, 0x18, 0xc9, 0x28, 0x15,
  7790. 0x6a, 0x2b, 0xb5, 0x25, 0x87, 0x25, 0x80, 0xd7, 0x10, 0x12, 0xc9, 0x32, 0x1b, 0x55, 0xb2, 0x59,
  7791. 0x57, 0x3b, 0x71, 0x72, 0x1b, 0x5a, 0x33, 0x6d, 0xed, 0xa0, 0xd1, 0xf4, 0xd4, 0x74, 0x4b, 0x41,
  7792. 0x9c, 0x38, 0x9b, 0x3f, 0xc0, 0x37, 0x0e, 0xc0, 0x3f, 0xc1, 0x85, 0x03, 0x07, 0x6a, 0xb9, 0x71,
  7793. 0xa2, 0x38, 0xb9, 0x58, 0xfd, 0x17, 0xdc, 0xa8, 0xee, 0xe9, 0x91, 0xc6, 0xd6, 0xf8, 0x8b, 0xda,
  7794. 0x72, 0x71, 0x72, 0x7f, 0xfc, 0x7e, 0xaf, 0xdf, 0x7b, 0xf3, 0xbe, 0x2c, 0x78, 0x3c, 0xf4, 0xc4,
  7795. 0xcb, 0xc9, 0xa0, 0xed, 0xb0, 0xf1, 0xb6, 0xcb, 0x9c, 0x11, 0x8d, 0xb6, 0xf9, 0xd7, 0x24, 0x1a,
  7796. 0x8f, 0x3c, 0xb1, 0x4d, 0x42, 0x6f, 0x9b, 0x0d, 0x7e, 0x45, 0x1d, 0xc1, 0xdb, 0x61, 0xc4, 0x04,
  7797. 0x43, 0x28, 0x86, 0xb4, 0x13, 0x48, 0x7b, 0xfa, 0x83, 0xfa, 0xbb, 0xd7, 0x48, 0x10, 0xb3, 0x90,
  7798. 0x6a, 0xfe, 0xb5, 0x58, 0x1e, 0x52, 0x27, 0xc1, 0x36, 0x87, 0x8c, 0x0d, 0x7d, 0xba, 0xad, 0x76,
  7799. 0x83, 0xc9, 0xf1, 0xb6, 0xf0, 0xc6, 0x94, 0x0b, 0x32, 0x0e, 0x35, 0x60, 0x7d, 0xc8, 0x86, 0x4c,
  7800. 0x2d, 0xb7, 0xe5, 0x4a, 0x9f, 0x3e, 0xbc, 0x48, 0x23, 0xc1, 0x4c, 0x5f, 0xfd, 0xe4, 0x8a, 0xd7,
  7801. 0x17, 0xf0, 0xd0, 0x9f, 0x0c, 0xbd, 0x40, 0xff, 0x89, 0x89, 0xad, 0x3f, 0x1b, 0x60, 0x3e, 0xa7,
  7802. 0x82, 0xa0, 0x9f, 0x42, 0x61, 0x4a, 0x23, 0xee, 0xb1, 0xc0, 0x32, 0xb6, 0x8c, 0x47, 0xe5, 0x27,
  7803. 0xdf, 0x69, 0xaf, 0x7a, 0xa4, 0x7d, 0x14, 0x43, 0xba, 0xe6, 0xab, 0xb3, 0xe6, 0x3d, 0x9c, 0x30,
  7804. 0xd0, 0x53, 0x00, 0x27, 0xa2, 0x44, 0x50, 0xd7, 0x26, 0xc2, 0xca, 0x29, 0x7e, 0xbd, 0x1d, 0xab,
  7805. 0xdb, 0x4e, 0xde, 0x6f, 0x7f, 0x9e, 0x58, 0x89, 0x4b, 0x1a, 0xdd, 0x11, 0x92, 0x3a, 0x09, 0xdd,
  7806. 0x84, 0xba, 0x76, 0x3d, 0x55, 0xa3, 0x3b, 0xa2, 0xf5, 0xa7, 0xfb, 0x60, 0x7e, 0xc6, 0x5c, 0x8a,
  7807. 0x36, 0x20, 0xe7, 0xb9, 0x4a, 0xed, 0x52, 0x37, 0x3f, 0x3f, 0x6b, 0xe6, 0xfa, 0x3d, 0x9c, 0xf3,
  7808. 0x5c, 0xf4, 0x04, 0xcc, 0x31, 0x15, 0x44, 0x2b, 0x64, 0x65, 0x19, 0x24, 0x6d, 0xd7, 0xd6, 0x28,
  7809. 0x2c, 0xfa, 0x31, 0x98, 0xf2, 0x53, 0x69, 0x4d, 0x36, 0xb3, 0x38, 0xf2, 0xcd, 0xc3, 0x90, 0x3a,
  7810. 0x09, 0x4f, 0xe2, 0xd1, 0x3e, 0x94, 0x5d, 0xca, 0x9d, 0xc8, 0x0b, 0x85, 0xf4, 0xa1, 0xa9, 0xe8,
  7811. 0x6f, 0x5f, 0x46, 0xef, 0x2d, 0xa1, 0x38, 0xcd, 0x43, 0x3f, 0x83, 0x3c, 0x17, 0x44, 0x4c, 0xb8,
  7812. 0x75, 0x5f, 0x49, 0x68, 0x5c, 0xaa, 0x80, 0x42, 0x69, 0x15, 0x34, 0x07, 0x7d, 0x0c, 0xb5, 0x31,
  7813. 0x09, 0xc8, 0x90, 0x46, 0xb6, 0x96, 0x92, 0x57, 0x52, 0xbe, 0x97, 0x69, 0x7a, 0x8c, 0x8c, 0x05,
  7814. 0xe1, 0xea, 0x38, 0xbd, 0x45, 0x7d, 0x00, 0x22, 0x04, 0x71, 0x5e, 0x8e, 0x69, 0x20, 0xac, 0x82,
  7815. 0x92, 0xf2, 0x4e, 0xa6, 0x2e, 0x54, 0x7c, 0xcd, 0xa2, 0x51, 0x67, 0x01, 0xee, 0xe6, 0x2c, 0x03,
  7816. 0xa7, 0xc8, 0xe8, 0x19, 0x94, 0x1d, 0x1a, 0x09, 0xef, 0xd8, 0x73, 0x88, 0xa0, 0x56, 0x51, 0xc9,
  7817. 0x6a, 0x66, 0xc9, 0xda, 0x5b, 0xc2, 0xb4, 0x61, 0x69, 0x26, 0x7a, 0x0f, 0xcc, 0x88, 0xf9, 0xd4,
  7818. 0x2a, 0x6d, 0x19, 0x8f, 0x6a, 0x97, 0x7f, 0x1a, 0xcc, 0x7c, 0x8a, 0x15, 0x52, 0x3e, 0xbd, 0x54,
  7819. 0x84, 0x5b, 0xb0, 0xb5, 0x76, 0x63, 0x33, 0x70, 0x9a, 0x89, 0x5a, 0x50, 0x39, 0xfa, 0xea, 0xd3,
  7820. 0xce, 0x67, 0x5f, 0xf4, 0x0e, 0x0e, 0x58, 0x24, 0xac, 0xf2, 0x96, 0xf1, 0xa8, 0x8a, 0xcf, 0x9d,
  7821. 0xed, 0x6e, 0x9c, 0x9c, 0xb6, 0x10, 0x3c, 0x28, 0x1a, 0x0f, 0x0c, 0x15, 0x8b, 0xc6, 0x7b, 0xc6,
  7822. 0x57, 0xc6, 0x2f, 0x8d, 0xd6, 0x1f, 0x4d, 0x28, 0x1c, 0xd2, 0x68, 0xea, 0x39, 0x6f, 0x36, 0x52,
  7823. 0x9f, 0x9e, 0x8b, 0xd4, 0x4c, 0x87, 0xea, 0x67, 0x57, 0x82, 0x75, 0x07, 0x8a, 0x34, 0x70, 0x43,
  7824. 0xe6, 0x05, 0x42, 0x47, 0x6a, 0xa6, 0x37, 0xf7, 0x35, 0x06, 0x2f, 0xd0, 0x68, 0x1f, 0xaa, 0x71,
  7825. 0x02, 0xda, 0xe7, 0xc2, 0x74, 0x2b, 0x8b, 0xfe, 0x85, 0x02, 0xea, 0xf8, 0xaa, 0x4c, 0x52, 0x3b,
  7826. 0xd4, 0x83, 0x6a, 0x18, 0xd1, 0xa9, 0xc7, 0x26, 0xdc, 0x56, 0x46, 0xe4, 0x6f, 0x64, 0x04, 0xae,
  7827. 0x24, 0x2c, 0xb9, 0x43, 0xef, 0x40, 0x2d, 0xa4, 0x81, 0xeb, 0x05, 0x43, 0xdb, 0xa5, 0x3e, 0x15,
  7828. 0x54, 0x05, 0x6a, 0x11, 0x57, 0xf5, 0x69, 0x4f, 0x1d, 0xa2, 0x9f, 0x43, 0x45, 0xbe, 0x61, 0x27,
  7829. 0xf5, 0x0d, 0xae, 0xad, 0x6f, 0xb8, 0x2c, 0x09, 0x7a, 0x83, 0x5e, 0xc0, 0xb7, 0xce, 0x29, 0xbb,
  7830. 0x10, 0x54, 0xbe, 0x5e, 0xd0, 0x5b, 0x69, 0x85, 0xf5, 0xe1, 0x2e, 0x3a, 0x39, 0x6d, 0xd5, 0xa0,
  7831. 0x92, 0x8e, 0x94, 0xd6, 0xef, 0x73, 0x50, 0x4c, 0xfc, 0x8d, 0xde, 0xd7, 0x9f, 0xd6, 0xb8, 0xdc,
  7832. 0xb9, 0x09, 0x56, 0xb9, 0x25, 0xfe, 0xaa, 0xef, 0xc3, 0xfd, 0x90, 0x45, 0x82, 0x5b, 0x39, 0x15,
  7833. 0xe7, 0x99, 0xa5, 0x43, 0x46, 0xea, 0x1e, 0x0b, 0x8e, 0xbd, 0x21, 0x8e, 0xc1, 0xe8, 0x4b, 0x28,
  7834. 0x4f, 0xbd, 0x48, 0x4c, 0x88, 0x6f, 0x7b, 0x21, 0xb7, 0xd6, 0x14, 0xf7, 0xfb, 0x57, 0x3d, 0xd9,
  7835. 0x3e, 0x8a, 0xf1, 0xfd, 0x83, 0x6e, 0x6d, 0x7e, 0xd6, 0x84, 0xc5, 0x96, 0x63, 0xd0, 0xa2, 0xfa,
  7836. 0x21, 0xaf, 0x3f, 0x87, 0xd2, 0xe2, 0x06, 0x3d, 0x06, 0x08, 0xe2, 0x14, 0xb3, 0x17, 0x09, 0x50,
  7837. 0x9d, 0x9f, 0x35, 0x4b, 0x3a, 0xf1, 0xfa, 0x3d, 0x5c, 0xd2, 0x80, 0xbe, 0x8b, 0x10, 0x98, 0xc4,
  7838. 0x75, 0x23, 0x95, 0x0e, 0x25, 0xac, 0xd6, 0xad, 0xdf, 0x15, 0xc0, 0xfc, 0x9c, 0xf0, 0xd1, 0x5d,
  7839. 0x57, 0x7b, 0xf9, 0xe6, 0x4a, 0x02, 0x3d, 0x06, 0xe0, 0x71, 0x58, 0x4a, 0x73, 0xcc, 0xa5, 0x39,
  7840. 0x3a, 0x58, 0xa5, 0x39, 0x1a, 0x10, 0x9b, 0xc3, 0x7d, 0x26, 0x54, 0xae, 0x98, 0x58, 0xad, 0xd1,
  7841. 0xdb, 0x50, 0x08, 0x98, 0xab, 0xe8, 0x79, 0x45, 0x87, 0xf9, 0x59, 0x33, 0x2f, 0xeb, 0x57, 0xbf,
  7842. 0x87, 0xf3, 0xf2, 0xaa, 0xef, 0xaa, 0xfa, 0x15, 0x04, 0x4c, 0x10, 0xd9, 0x1b, 0xb8, 0x2e, 0xc3,
  7843. 0x99, 0x49, 0xd2, 0x59, 0xc2, 0x92, 0xd2, 0x99, 0x62, 0xa2, 0x23, 0x78, 0x2b, 0xd1, 0x37, 0x2d,
  7844. 0xb0, 0x78, 0x1b, 0x81, 0x48, 0x4b, 0x48, 0xdd, 0xa4, 0xda, 0x55, 0xe9, 0xf2, 0x76, 0xa5, 0x3c,
  7845. 0x98, 0xd5, 0xae, 0xba, 0x50, 0x75, 0x29, 0xf7, 0x22, 0xea, 0xaa, 0x6a, 0x42, 0x55, 0x66, 0xd6,
  7846. 0x9e, 0x7c, 0xf7, 0x2a, 0x21, 0x14, 0x57, 0x34, 0x47, 0xed, 0x50, 0x07, 0x8a, 0x3a, 0x6e, 0xb8,
  7847. 0x55, 0xbe, 0x4d, 0x7d, 0x5f, 0xd0, 0xce, 0x55, 0xc3, 0xca, 0xad, 0xaa, 0xe1, 0x53, 0x00, 0x9f,
  7848. 0x0d, 0x6d, 0x37, 0xf2, 0xa6, 0x34, 0xb2, 0xaa, 0x7a, 0x78, 0xc9, 0xe0, 0xf6, 0x14, 0x02, 0x97,
  7849. 0x7c, 0x36, 0x8c, 0x97, 0x2b, 0x45, 0xa9, 0x76, 0xcb, 0xa2, 0x44, 0xa0, 0x4e, 0x38, 0xf7, 0x86,
  7850. 0x01, 0x75, 0xed, 0x21, 0x0d, 0x68, 0xe4, 0x39, 0x76, 0x44, 0x39, 0x9b, 0x44, 0x0e, 0xe5, 0xd6,
  7851. 0x37, 0x94, 0x27, 0x32, 0xc7, 0x8f, 0x67, 0x31, 0x18, 0x6b, 0x2c, 0xb6, 0x12, 0x31, 0x17, 0x2e,
  7852. 0xf8, 0x6e, 0xfd, 0xe4, 0xb4, 0xb5, 0x01, 0xeb, 0xe9, 0x32, 0xb5, 0x63, 0x7c, 0x64, 0x7c, 0x6c,
  7853. 0x1c, 0x18, 0xad, 0xbf, 0xe6, 0xe0, 0x9b, 0x2b, 0x3e, 0x45, 0x3f, 0x82, 0x82, 0xf6, 0xea, 0x55,
  7854. 0x43, 0xa4, 0xe6, 0xe1, 0x04, 0x8b, 0x36, 0xa1, 0x24, 0x53, 0x9c, 0x72, 0x4e, 0xe3, 0xe2, 0x55,
  7855. 0xc2, 0xcb, 0x03, 0x64, 0x41, 0x81, 0xf8, 0x1e, 0x91, 0x77, 0x6b, 0xea, 0x2e, 0xd9, 0xa2, 0x09,
  7856. 0x6c, 0xc4, 0xae, 0xb7, 0x97, 0xbd, 0xda, 0x66, 0xa1, 0xe0, 0x96, 0xa9, 0xec, 0xff, 0xf0, 0x46,
  7857. 0x91, 0xa0, 0x3f, 0xce, 0xf2, 0xe0, 0x45, 0x28, 0xf8, 0x7e, 0x20, 0xa2, 0x19, 0x5e, 0x77, 0x33,
  7858. 0xae, 0xea, 0xcf, 0xe0, 0xe1, 0xa5, 0x14, 0xf4, 0x00, 0xd6, 0x46, 0x74, 0x16, 0x97, 0x27, 0x2c,
  7859. 0x97, 0x68, 0x1d, 0xee, 0x4f, 0x89, 0x3f, 0xa1, 0xba, 0x9a, 0xc5, 0x9b, 0xdd, 0xdc, 0x8e, 0xd1,
  7860. 0xfa, 0x7b, 0x0e, 0x0a, 0x5a, 0x9d, 0xbb, 0x9e, 0x0c, 0xf4, 0xb3, 0x2b, 0x85, 0xed, 0x03, 0xa8,
  7861. 0x68, 0x97, 0xc6, 0x19, 0x69, 0x5e, 0x1b, 0xd3, 0xe5, 0x18, 0x1f, 0x67, 0xe3, 0x07, 0x60, 0x7a,
  7862. 0x21, 0x19, 0xeb, 0xa9, 0x20, 0xf3, 0xe5, 0xfe, 0x41, 0xe7, 0xf9, 0x8b, 0x30, 0x2e, 0x2c, 0xc5,
  7863. 0xf9, 0x59, 0xd3, 0x94, 0x07, 0x58, 0xd1, 0x32, 0x1a, 0x7a, 0x3e, 0xa3, 0xa1, 0x67, 0xf6, 0xcf,
  7864. 0xbf, 0xe5, 0xa1, 0xb0, 0xe7, 0x4f, 0xb8, 0xa0, 0xd1, 0x5d, 0xfb, 0x52, 0x3f, 0xbb, 0xe2, 0xcb,
  7865. 0x3d, 0x28, 0x44, 0x8c, 0x09, 0xdb, 0x21, 0x57, 0xb9, 0x11, 0x33, 0x26, 0xf6, 0x3a, 0xdd, 0x9a,
  7866. 0x24, 0xca, 0x16, 0x10, 0xef, 0x71, 0x5e, 0x52, 0xf7, 0x08, 0xfa, 0x12, 0x36, 0x92, 0xc6, 0x39,
  7867. 0x60, 0x4c, 0x70, 0x11, 0x91, 0xd0, 0x1e, 0xd1, 0x99, 0x9c, 0xbc, 0xd6, 0x2e, 0x1b, 0xed, 0xf7,
  7868. 0x03, 0x27, 0x9a, 0x29, 0x1f, 0x7f, 0x42, 0x67, 0x78, 0x5d, 0x0b, 0xe8, 0x26, 0xfc, 0x4f, 0xe8,
  7869. 0x8c, 0xa3, 0x0f, 0x61, 0x93, 0x2e, 0x60, 0x52, 0xa2, 0xed, 0x93, 0xb1, 0x1c, 0x09, 0x6c, 0xc7,
  7870. 0x67, 0xce, 0x48, 0x79, 0xde, 0xc4, 0x0f, 0x69, 0x5a, 0xd4, 0xa7, 0x31, 0x62, 0x4f, 0x02, 0x10,
  7871. 0x07, 0x6b, 0xe0, 0x13, 0x67, 0xe4, 0x7b, 0x5c, 0xfe, 0xf7, 0x96, 0x9a, 0xd4, 0x65, 0x63, 0x91,
  7872. 0xba, 0xed, 0x5c, 0xe1, 0xad, 0x76, 0x77, 0xc9, 0x4d, 0xcd, 0xfd, 0x3a, 0xf1, 0xbe, 0x3d, 0xc8,
  7873. 0xbe, 0x45, 0x5d, 0x28, 0x4f, 0x02, 0xf9, 0x7c, 0xec, 0x83, 0xd2, 0x4d, 0x7d, 0x00, 0x31, 0x4b,
  7874. 0x59, 0xbe, 0x09, 0xe6, 0xb1, 0x1c, 0x75, 0x64, 0xb7, 0x29, 0xc6, 0x31, 0xf8, 0x8b, 0xfe, 0xc1,
  7875. 0x21, 0x56, 0xa7, 0xa8, 0x0d, 0xc8, 0xa5, 0xc7, 0x64, 0xe2, 0x8b, 0x4e, 0x5c, 0x82, 0x0e, 0x18,
  7876. 0xf3, 0x55, 0x6b, 0x29, 0xe1, 0x8c, 0x1b, 0xd4, 0x00, 0xe0, 0x93, 0x41, 0x40, 0xc5, 0xa1, 0xf7,
  7877. 0x1b, 0xaa, 0xfa, 0x47, 0x15, 0xa7, 0x4e, 0x56, 0xfe, 0x75, 0xa8, 0xae, 0xfe, 0xeb, 0x50, 0x9f,
  7878. 0xc2, 0xe6, 0x55, 0xee, 0xc8, 0x28, 0x2a, 0x1f, 0xa5, 0x8b, 0x4a, 0xf9, 0xc9, 0xbb, 0x59, 0x1e,
  7879. 0xc8, 0x16, 0x99, 0x2a, 0x40, 0x99, 0x89, 0xf4, 0x17, 0x03, 0xf2, 0x87, 0xd4, 0x89, 0xa8, 0x78,
  7880. 0xa3, 0x79, 0xb4, 0x73, 0x2e, 0x8f, 0x1a, 0xd9, 0x83, 0xbe, 0x7c, 0x75, 0x25, 0x8d, 0xea, 0x50,
  7881. 0xf4, 0x02, 0x41, 0xa3, 0x80, 0xf8, 0x2a, 0x8f, 0x8a, 0x78, 0xb1, 0xcf, 0x34, 0xe0, 0x0f, 0x06,
  7882. 0xe4, 0xe3, 0x11, 0xf7, 0xae, 0x0d, 0x88, 0x5f, 0xbd, 0x68, 0x40, 0xa6, 0x92, 0xff, 0x31, 0xa0,
  7883. 0x98, 0x74, 0xda, 0x37, 0xaa, 0xe6, 0x85, 0x91, 0x71, 0xed, 0x7f, 0x1e, 0x19, 0x11, 0x98, 0x23,
  7884. 0x2f, 0xd0, 0xc3, 0x2d, 0x56, 0x6b, 0xd4, 0x86, 0x42, 0x48, 0x66, 0x3e, 0x23, 0xae, 0xae, 0xf0,
  7885. 0xeb, 0x2b, 0xbf, 0xd4, 0x74, 0x82, 0x19, 0x4e, 0x40, 0xbb, 0xeb, 0x27, 0xa7, 0xad, 0x07, 0x50,
  7886. 0x4b, 0x5b, 0xfe, 0xd2, 0x68, 0xfd, 0xd3, 0x80, 0xd2, 0xfe, 0xaf, 0x05, 0x0d, 0xd4, 0x20, 0xf3,
  7887. 0x7f, 0x69, 0xfc, 0xd6, 0xea, 0xaf, 0x39, 0xa5, 0x73, 0x3f, 0xd4, 0x64, 0x7d, 0xd4, 0xae, 0xf5,
  7888. 0xea, 0x75, 0xe3, 0xde, 0xbf, 0x5e, 0x37, 0xee, 0xfd, 0x76, 0xde, 0x30, 0x5e, 0xcd, 0x1b, 0xc6,
  7889. 0x3f, 0xe6, 0x0d, 0xe3, 0xdf, 0xf3, 0x86, 0x31, 0xc8, 0x2b, 0xff, 0xfc, 0xf0, 0xbf, 0x01, 0x00,
  7890. 0x00, 0xff, 0xff, 0xc3, 0x37, 0x09, 0x2f, 0x94, 0x14, 0x00, 0x00,
  7891. }