objects.pb.go 215 KB

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