123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599 |
- // Code generated by protoc-gen-gogo.
- // source: watch.proto
- // DO NOT EDIT!
- package api
- import proto "github.com/gogo/protobuf/proto"
- import fmt "fmt"
- import math "math"
- import _ "github.com/gogo/protobuf/gogoproto"
- import _ "github.com/docker/swarmkit/protobuf/plugin"
- import github_com_docker_swarmkit_api_deepcopy "github.com/docker/swarmkit/api/deepcopy"
- import (
- context "golang.org/x/net/context"
- grpc "google.golang.org/grpc"
- )
- import raftselector "github.com/docker/swarmkit/manager/raftselector"
- import codes "google.golang.org/grpc/codes"
- import metadata "google.golang.org/grpc/metadata"
- import transport "google.golang.org/grpc/transport"
- import rafttime "time"
- import strings "strings"
- import reflect "reflect"
- import io "io"
- // Reference imports to suppress errors if they are not otherwise used.
- var _ = proto.Marshal
- var _ = fmt.Errorf
- var _ = math.Inf
- // WatchActionKind distinguishes between creations, updates, and removals. It
- // is structured as a bitmap so multiple kinds of events can be requested with
- // a mask.
- type WatchActionKind int32
- const (
- WatchActionKindUnknown WatchActionKind = 0
- WatchActionKindCreate WatchActionKind = 1
- WatchActionKindUpdate WatchActionKind = 2
- WatchActionKindRemove WatchActionKind = 4
- )
- var WatchActionKind_name = map[int32]string{
- 0: "WATCH_ACTION_UNKNOWN",
- 1: "WATCH_ACTION_CREATE",
- 2: "WATCH_ACTION_UPDATE",
- 4: "WATCH_ACTION_REMOVE",
- }
- var WatchActionKind_value = map[string]int32{
- "WATCH_ACTION_UNKNOWN": 0,
- "WATCH_ACTION_CREATE": 1,
- "WATCH_ACTION_UPDATE": 2,
- "WATCH_ACTION_REMOVE": 4,
- }
- func (x WatchActionKind) String() string {
- return proto.EnumName(WatchActionKind_name, int32(x))
- }
- func (WatchActionKind) EnumDescriptor() ([]byte, []int) { return fileDescriptorWatch, []int{0} }
- type Object struct {
- // Types that are valid to be assigned to Object:
- // *Object_Node
- // *Object_Service
- // *Object_Network
- // *Object_Task
- // *Object_Cluster
- // *Object_Secret
- // *Object_Resource
- // *Object_Extension
- // *Object_Config
- Object isObject_Object `protobuf_oneof:"Object"`
- }
- func (m *Object) Reset() { *m = Object{} }
- func (*Object) ProtoMessage() {}
- func (*Object) Descriptor() ([]byte, []int) { return fileDescriptorWatch, []int{0} }
- type isObject_Object interface {
- isObject_Object()
- MarshalTo([]byte) (int, error)
- Size() int
- }
- type Object_Node struct {
- Node *Node `protobuf:"bytes,1,opt,name=node,oneof"`
- }
- type Object_Service struct {
- Service *Service `protobuf:"bytes,2,opt,name=service,oneof"`
- }
- type Object_Network struct {
- Network *Network `protobuf:"bytes,3,opt,name=network,oneof"`
- }
- type Object_Task struct {
- Task *Task `protobuf:"bytes,4,opt,name=task,oneof"`
- }
- type Object_Cluster struct {
- Cluster *Cluster `protobuf:"bytes,5,opt,name=cluster,oneof"`
- }
- type Object_Secret struct {
- Secret *Secret `protobuf:"bytes,6,opt,name=secret,oneof"`
- }
- type Object_Resource struct {
- Resource *Resource `protobuf:"bytes,7,opt,name=resource,oneof"`
- }
- type Object_Extension struct {
- Extension *Extension `protobuf:"bytes,8,opt,name=extension,oneof"`
- }
- type Object_Config struct {
- Config *Config `protobuf:"bytes,9,opt,name=config,oneof"`
- }
- func (*Object_Node) isObject_Object() {}
- func (*Object_Service) isObject_Object() {}
- func (*Object_Network) isObject_Object() {}
- func (*Object_Task) isObject_Object() {}
- func (*Object_Cluster) isObject_Object() {}
- func (*Object_Secret) isObject_Object() {}
- func (*Object_Resource) isObject_Object() {}
- func (*Object_Extension) isObject_Object() {}
- func (*Object_Config) isObject_Object() {}
- func (m *Object) GetObject() isObject_Object {
- if m != nil {
- return m.Object
- }
- return nil
- }
- func (m *Object) GetNode() *Node {
- if x, ok := m.GetObject().(*Object_Node); ok {
- return x.Node
- }
- return nil
- }
- func (m *Object) GetService() *Service {
- if x, ok := m.GetObject().(*Object_Service); ok {
- return x.Service
- }
- return nil
- }
- func (m *Object) GetNetwork() *Network {
- if x, ok := m.GetObject().(*Object_Network); ok {
- return x.Network
- }
- return nil
- }
- func (m *Object) GetTask() *Task {
- if x, ok := m.GetObject().(*Object_Task); ok {
- return x.Task
- }
- return nil
- }
- func (m *Object) GetCluster() *Cluster {
- if x, ok := m.GetObject().(*Object_Cluster); ok {
- return x.Cluster
- }
- return nil
- }
- func (m *Object) GetSecret() *Secret {
- if x, ok := m.GetObject().(*Object_Secret); ok {
- return x.Secret
- }
- return nil
- }
- func (m *Object) GetResource() *Resource {
- if x, ok := m.GetObject().(*Object_Resource); ok {
- return x.Resource
- }
- return nil
- }
- func (m *Object) GetExtension() *Extension {
- if x, ok := m.GetObject().(*Object_Extension); ok {
- return x.Extension
- }
- return nil
- }
- func (m *Object) GetConfig() *Config {
- if x, ok := m.GetObject().(*Object_Config); ok {
- return x.Config
- }
- return nil
- }
- // XXX_OneofFuncs is for the internal use of the proto package.
- func (*Object) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
- return _Object_OneofMarshaler, _Object_OneofUnmarshaler, _Object_OneofSizer, []interface{}{
- (*Object_Node)(nil),
- (*Object_Service)(nil),
- (*Object_Network)(nil),
- (*Object_Task)(nil),
- (*Object_Cluster)(nil),
- (*Object_Secret)(nil),
- (*Object_Resource)(nil),
- (*Object_Extension)(nil),
- (*Object_Config)(nil),
- }
- }
- func _Object_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
- m := msg.(*Object)
- // Object
- switch x := m.Object.(type) {
- case *Object_Node:
- _ = b.EncodeVarint(1<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Node); err != nil {
- return err
- }
- case *Object_Service:
- _ = b.EncodeVarint(2<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Service); err != nil {
- return err
- }
- case *Object_Network:
- _ = b.EncodeVarint(3<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Network); err != nil {
- return err
- }
- case *Object_Task:
- _ = b.EncodeVarint(4<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Task); err != nil {
- return err
- }
- case *Object_Cluster:
- _ = b.EncodeVarint(5<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Cluster); err != nil {
- return err
- }
- case *Object_Secret:
- _ = b.EncodeVarint(6<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Secret); err != nil {
- return err
- }
- case *Object_Resource:
- _ = b.EncodeVarint(7<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Resource); err != nil {
- return err
- }
- case *Object_Extension:
- _ = b.EncodeVarint(8<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Extension); err != nil {
- return err
- }
- case *Object_Config:
- _ = b.EncodeVarint(9<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Config); err != nil {
- return err
- }
- case nil:
- default:
- return fmt.Errorf("Object.Object has unexpected type %T", x)
- }
- return nil
- }
- func _Object_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
- m := msg.(*Object)
- switch tag {
- case 1: // Object.node
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Node)
- err := b.DecodeMessage(msg)
- m.Object = &Object_Node{msg}
- return true, err
- case 2: // Object.service
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Service)
- err := b.DecodeMessage(msg)
- m.Object = &Object_Service{msg}
- return true, err
- case 3: // Object.network
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Network)
- err := b.DecodeMessage(msg)
- m.Object = &Object_Network{msg}
- return true, err
- case 4: // Object.task
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Task)
- err := b.DecodeMessage(msg)
- m.Object = &Object_Task{msg}
- return true, err
- case 5: // Object.cluster
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Cluster)
- err := b.DecodeMessage(msg)
- m.Object = &Object_Cluster{msg}
- return true, err
- case 6: // Object.secret
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Secret)
- err := b.DecodeMessage(msg)
- m.Object = &Object_Secret{msg}
- return true, err
- case 7: // Object.resource
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Resource)
- err := b.DecodeMessage(msg)
- m.Object = &Object_Resource{msg}
- return true, err
- case 8: // Object.extension
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Extension)
- err := b.DecodeMessage(msg)
- m.Object = &Object_Extension{msg}
- return true, err
- case 9: // Object.config
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Config)
- err := b.DecodeMessage(msg)
- m.Object = &Object_Config{msg}
- return true, err
- default:
- return false, nil
- }
- }
- func _Object_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*Object)
- // Object
- switch x := m.Object.(type) {
- case *Object_Node:
- s := proto.Size(x.Node)
- n += proto.SizeVarint(1<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Object_Service:
- s := proto.Size(x.Service)
- n += proto.SizeVarint(2<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Object_Network:
- s := proto.Size(x.Network)
- n += proto.SizeVarint(3<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Object_Task:
- s := proto.Size(x.Task)
- n += proto.SizeVarint(4<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Object_Cluster:
- s := proto.Size(x.Cluster)
- n += proto.SizeVarint(5<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Object_Secret:
- s := proto.Size(x.Secret)
- n += proto.SizeVarint(6<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Object_Resource:
- s := proto.Size(x.Resource)
- n += proto.SizeVarint(7<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Object_Extension:
- s := proto.Size(x.Extension)
- n += proto.SizeVarint(8<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Object_Config:
- s := proto.Size(x.Config)
- n += proto.SizeVarint(9<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
- }
- // FIXME(aaronl): These messages should ideally be embedded in SelectBy, but
- // protoc generates bad code for that.
- type SelectBySlot struct {
- ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
- Slot uint64 `protobuf:"varint,2,opt,name=slot,proto3" json:"slot,omitempty"`
- }
- func (m *SelectBySlot) Reset() { *m = SelectBySlot{} }
- func (*SelectBySlot) ProtoMessage() {}
- func (*SelectBySlot) Descriptor() ([]byte, []int) { return fileDescriptorWatch, []int{1} }
- type SelectByCustom struct {
- Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
- Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"`
- Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
- }
- func (m *SelectByCustom) Reset() { *m = SelectByCustom{} }
- func (*SelectByCustom) ProtoMessage() {}
- func (*SelectByCustom) Descriptor() ([]byte, []int) { return fileDescriptorWatch, []int{2} }
- type SelectBy struct {
- // TODO(aaronl): Are all of these things we want to expose in
- // the API? Exposing them may commit us to maintaining those
- // internal indices going forward.
- //
- // Types that are valid to be assigned to By:
- // *SelectBy_ID
- // *SelectBy_IDPrefix
- // *SelectBy_Name
- // *SelectBy_NamePrefix
- // *SelectBy_Custom
- // *SelectBy_CustomPrefix
- // *SelectBy_ServiceID
- // *SelectBy_NodeID
- // *SelectBy_Slot
- // *SelectBy_DesiredState
- // *SelectBy_Role
- // *SelectBy_Membership
- // *SelectBy_ReferencedNetworkID
- // *SelectBy_ReferencedSecretID
- // *SelectBy_ReferencedConfigID
- // *SelectBy_Kind
- By isSelectBy_By `protobuf_oneof:"By"`
- }
- func (m *SelectBy) Reset() { *m = SelectBy{} }
- func (*SelectBy) ProtoMessage() {}
- func (*SelectBy) Descriptor() ([]byte, []int) { return fileDescriptorWatch, []int{3} }
- type isSelectBy_By interface {
- isSelectBy_By()
- MarshalTo([]byte) (int, error)
- Size() int
- }
- type SelectBy_ID struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3,oneof"`
- }
- type SelectBy_IDPrefix struct {
- IDPrefix string `protobuf:"bytes,2,opt,name=id_prefix,json=idPrefix,proto3,oneof"`
- }
- type SelectBy_Name struct {
- Name string `protobuf:"bytes,3,opt,name=name,proto3,oneof"`
- }
- type SelectBy_NamePrefix struct {
- NamePrefix string `protobuf:"bytes,4,opt,name=name_prefix,json=namePrefix,proto3,oneof"`
- }
- type SelectBy_Custom struct {
- Custom *SelectByCustom `protobuf:"bytes,5,opt,name=custom,oneof"`
- }
- type SelectBy_CustomPrefix struct {
- CustomPrefix *SelectByCustom `protobuf:"bytes,6,opt,name=custom_prefix,json=customPrefix,oneof"`
- }
- type SelectBy_ServiceID struct {
- ServiceID string `protobuf:"bytes,7,opt,name=service_id,json=serviceId,proto3,oneof"`
- }
- type SelectBy_NodeID struct {
- NodeID string `protobuf:"bytes,8,opt,name=node_id,json=nodeId,proto3,oneof"`
- }
- type SelectBy_Slot struct {
- Slot *SelectBySlot `protobuf:"bytes,9,opt,name=slot,oneof"`
- }
- type SelectBy_DesiredState struct {
- DesiredState TaskState `protobuf:"varint,10,opt,name=desired_state,json=desiredState,proto3,enum=docker.swarmkit.v1.TaskState,oneof"`
- }
- type SelectBy_Role struct {
- Role NodeRole `protobuf:"varint,11,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole,oneof"`
- }
- type SelectBy_Membership struct {
- Membership NodeSpec_Membership `protobuf:"varint,12,opt,name=membership,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership,oneof"`
- }
- type SelectBy_ReferencedNetworkID struct {
- ReferencedNetworkID string `protobuf:"bytes,13,opt,name=referenced_network_id,json=referencedNetworkId,proto3,oneof"`
- }
- type SelectBy_ReferencedSecretID struct {
- ReferencedSecretID string `protobuf:"bytes,14,opt,name=referenced_secret_id,json=referencedSecretId,proto3,oneof"`
- }
- type SelectBy_ReferencedConfigID struct {
- ReferencedConfigID string `protobuf:"bytes,16,opt,name=referenced_config_id,json=referencedConfigId,proto3,oneof"`
- }
- type SelectBy_Kind struct {
- Kind string `protobuf:"bytes,15,opt,name=kind,proto3,oneof"`
- }
- func (*SelectBy_ID) isSelectBy_By() {}
- func (*SelectBy_IDPrefix) isSelectBy_By() {}
- func (*SelectBy_Name) isSelectBy_By() {}
- func (*SelectBy_NamePrefix) isSelectBy_By() {}
- func (*SelectBy_Custom) isSelectBy_By() {}
- func (*SelectBy_CustomPrefix) isSelectBy_By() {}
- func (*SelectBy_ServiceID) isSelectBy_By() {}
- func (*SelectBy_NodeID) isSelectBy_By() {}
- func (*SelectBy_Slot) isSelectBy_By() {}
- func (*SelectBy_DesiredState) isSelectBy_By() {}
- func (*SelectBy_Role) isSelectBy_By() {}
- func (*SelectBy_Membership) isSelectBy_By() {}
- func (*SelectBy_ReferencedNetworkID) isSelectBy_By() {}
- func (*SelectBy_ReferencedSecretID) isSelectBy_By() {}
- func (*SelectBy_ReferencedConfigID) isSelectBy_By() {}
- func (*SelectBy_Kind) isSelectBy_By() {}
- func (m *SelectBy) GetBy() isSelectBy_By {
- if m != nil {
- return m.By
- }
- return nil
- }
- func (m *SelectBy) GetID() string {
- if x, ok := m.GetBy().(*SelectBy_ID); ok {
- return x.ID
- }
- return ""
- }
- func (m *SelectBy) GetIDPrefix() string {
- if x, ok := m.GetBy().(*SelectBy_IDPrefix); ok {
- return x.IDPrefix
- }
- return ""
- }
- func (m *SelectBy) GetName() string {
- if x, ok := m.GetBy().(*SelectBy_Name); ok {
- return x.Name
- }
- return ""
- }
- func (m *SelectBy) GetNamePrefix() string {
- if x, ok := m.GetBy().(*SelectBy_NamePrefix); ok {
- return x.NamePrefix
- }
- return ""
- }
- func (m *SelectBy) GetCustom() *SelectByCustom {
- if x, ok := m.GetBy().(*SelectBy_Custom); ok {
- return x.Custom
- }
- return nil
- }
- func (m *SelectBy) GetCustomPrefix() *SelectByCustom {
- if x, ok := m.GetBy().(*SelectBy_CustomPrefix); ok {
- return x.CustomPrefix
- }
- return nil
- }
- func (m *SelectBy) GetServiceID() string {
- if x, ok := m.GetBy().(*SelectBy_ServiceID); ok {
- return x.ServiceID
- }
- return ""
- }
- func (m *SelectBy) GetNodeID() string {
- if x, ok := m.GetBy().(*SelectBy_NodeID); ok {
- return x.NodeID
- }
- return ""
- }
- func (m *SelectBy) GetSlot() *SelectBySlot {
- if x, ok := m.GetBy().(*SelectBy_Slot); ok {
- return x.Slot
- }
- return nil
- }
- func (m *SelectBy) GetDesiredState() TaskState {
- if x, ok := m.GetBy().(*SelectBy_DesiredState); ok {
- return x.DesiredState
- }
- return TaskStateNew
- }
- func (m *SelectBy) GetRole() NodeRole {
- if x, ok := m.GetBy().(*SelectBy_Role); ok {
- return x.Role
- }
- return NodeRoleWorker
- }
- func (m *SelectBy) GetMembership() NodeSpec_Membership {
- if x, ok := m.GetBy().(*SelectBy_Membership); ok {
- return x.Membership
- }
- return NodeMembershipPending
- }
- func (m *SelectBy) GetReferencedNetworkID() string {
- if x, ok := m.GetBy().(*SelectBy_ReferencedNetworkID); ok {
- return x.ReferencedNetworkID
- }
- return ""
- }
- func (m *SelectBy) GetReferencedSecretID() string {
- if x, ok := m.GetBy().(*SelectBy_ReferencedSecretID); ok {
- return x.ReferencedSecretID
- }
- return ""
- }
- func (m *SelectBy) GetReferencedConfigID() string {
- if x, ok := m.GetBy().(*SelectBy_ReferencedConfigID); ok {
- return x.ReferencedConfigID
- }
- return ""
- }
- func (m *SelectBy) GetKind() string {
- if x, ok := m.GetBy().(*SelectBy_Kind); ok {
- return x.Kind
- }
- return ""
- }
- // XXX_OneofFuncs is for the internal use of the proto package.
- func (*SelectBy) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
- return _SelectBy_OneofMarshaler, _SelectBy_OneofUnmarshaler, _SelectBy_OneofSizer, []interface{}{
- (*SelectBy_ID)(nil),
- (*SelectBy_IDPrefix)(nil),
- (*SelectBy_Name)(nil),
- (*SelectBy_NamePrefix)(nil),
- (*SelectBy_Custom)(nil),
- (*SelectBy_CustomPrefix)(nil),
- (*SelectBy_ServiceID)(nil),
- (*SelectBy_NodeID)(nil),
- (*SelectBy_Slot)(nil),
- (*SelectBy_DesiredState)(nil),
- (*SelectBy_Role)(nil),
- (*SelectBy_Membership)(nil),
- (*SelectBy_ReferencedNetworkID)(nil),
- (*SelectBy_ReferencedSecretID)(nil),
- (*SelectBy_ReferencedConfigID)(nil),
- (*SelectBy_Kind)(nil),
- }
- }
- func _SelectBy_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
- m := msg.(*SelectBy)
- // By
- switch x := m.By.(type) {
- case *SelectBy_ID:
- _ = b.EncodeVarint(1<<3 | proto.WireBytes)
- _ = b.EncodeStringBytes(x.ID)
- case *SelectBy_IDPrefix:
- _ = b.EncodeVarint(2<<3 | proto.WireBytes)
- _ = b.EncodeStringBytes(x.IDPrefix)
- case *SelectBy_Name:
- _ = b.EncodeVarint(3<<3 | proto.WireBytes)
- _ = b.EncodeStringBytes(x.Name)
- case *SelectBy_NamePrefix:
- _ = b.EncodeVarint(4<<3 | proto.WireBytes)
- _ = b.EncodeStringBytes(x.NamePrefix)
- case *SelectBy_Custom:
- _ = b.EncodeVarint(5<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Custom); err != nil {
- return err
- }
- case *SelectBy_CustomPrefix:
- _ = b.EncodeVarint(6<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.CustomPrefix); err != nil {
- return err
- }
- case *SelectBy_ServiceID:
- _ = b.EncodeVarint(7<<3 | proto.WireBytes)
- _ = b.EncodeStringBytes(x.ServiceID)
- case *SelectBy_NodeID:
- _ = b.EncodeVarint(8<<3 | proto.WireBytes)
- _ = b.EncodeStringBytes(x.NodeID)
- case *SelectBy_Slot:
- _ = b.EncodeVarint(9<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Slot); err != nil {
- return err
- }
- case *SelectBy_DesiredState:
- _ = b.EncodeVarint(10<<3 | proto.WireVarint)
- _ = b.EncodeVarint(uint64(x.DesiredState))
- case *SelectBy_Role:
- _ = b.EncodeVarint(11<<3 | proto.WireVarint)
- _ = b.EncodeVarint(uint64(x.Role))
- case *SelectBy_Membership:
- _ = b.EncodeVarint(12<<3 | proto.WireVarint)
- _ = b.EncodeVarint(uint64(x.Membership))
- case *SelectBy_ReferencedNetworkID:
- _ = b.EncodeVarint(13<<3 | proto.WireBytes)
- _ = b.EncodeStringBytes(x.ReferencedNetworkID)
- case *SelectBy_ReferencedSecretID:
- _ = b.EncodeVarint(14<<3 | proto.WireBytes)
- _ = b.EncodeStringBytes(x.ReferencedSecretID)
- case *SelectBy_ReferencedConfigID:
- _ = b.EncodeVarint(16<<3 | proto.WireBytes)
- _ = b.EncodeStringBytes(x.ReferencedConfigID)
- case *SelectBy_Kind:
- _ = b.EncodeVarint(15<<3 | proto.WireBytes)
- _ = b.EncodeStringBytes(x.Kind)
- case nil:
- default:
- return fmt.Errorf("SelectBy.By has unexpected type %T", x)
- }
- return nil
- }
- func _SelectBy_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
- m := msg.(*SelectBy)
- switch tag {
- case 1: // By.id
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.By = &SelectBy_ID{x}
- return true, err
- case 2: // By.id_prefix
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.By = &SelectBy_IDPrefix{x}
- return true, err
- case 3: // By.name
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.By = &SelectBy_Name{x}
- return true, err
- case 4: // By.name_prefix
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.By = &SelectBy_NamePrefix{x}
- return true, err
- case 5: // By.custom
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(SelectByCustom)
- err := b.DecodeMessage(msg)
- m.By = &SelectBy_Custom{msg}
- return true, err
- case 6: // By.custom_prefix
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(SelectByCustom)
- err := b.DecodeMessage(msg)
- m.By = &SelectBy_CustomPrefix{msg}
- return true, err
- case 7: // By.service_id
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.By = &SelectBy_ServiceID{x}
- return true, err
- case 8: // By.node_id
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.By = &SelectBy_NodeID{x}
- return true, err
- case 9: // By.slot
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(SelectBySlot)
- err := b.DecodeMessage(msg)
- m.By = &SelectBy_Slot{msg}
- return true, err
- case 10: // By.desired_state
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.By = &SelectBy_DesiredState{TaskState(x)}
- return true, err
- case 11: // By.role
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.By = &SelectBy_Role{NodeRole(x)}
- return true, err
- case 12: // By.membership
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.By = &SelectBy_Membership{NodeSpec_Membership(x)}
- return true, err
- case 13: // By.referenced_network_id
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.By = &SelectBy_ReferencedNetworkID{x}
- return true, err
- case 14: // By.referenced_secret_id
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.By = &SelectBy_ReferencedSecretID{x}
- return true, err
- case 16: // By.referenced_config_id
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.By = &SelectBy_ReferencedConfigID{x}
- return true, err
- case 15: // By.kind
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.By = &SelectBy_Kind{x}
- return true, err
- default:
- return false, nil
- }
- }
- func _SelectBy_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*SelectBy)
- // By
- switch x := m.By.(type) {
- case *SelectBy_ID:
- n += proto.SizeVarint(1<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(len(x.ID)))
- n += len(x.ID)
- case *SelectBy_IDPrefix:
- n += proto.SizeVarint(2<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(len(x.IDPrefix)))
- n += len(x.IDPrefix)
- case *SelectBy_Name:
- n += proto.SizeVarint(3<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(len(x.Name)))
- n += len(x.Name)
- case *SelectBy_NamePrefix:
- n += proto.SizeVarint(4<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(len(x.NamePrefix)))
- n += len(x.NamePrefix)
- case *SelectBy_Custom:
- s := proto.Size(x.Custom)
- n += proto.SizeVarint(5<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case *SelectBy_CustomPrefix:
- s := proto.Size(x.CustomPrefix)
- n += proto.SizeVarint(6<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case *SelectBy_ServiceID:
- n += proto.SizeVarint(7<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(len(x.ServiceID)))
- n += len(x.ServiceID)
- case *SelectBy_NodeID:
- n += proto.SizeVarint(8<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(len(x.NodeID)))
- n += len(x.NodeID)
- case *SelectBy_Slot:
- s := proto.Size(x.Slot)
- n += proto.SizeVarint(9<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(s))
- n += s
- case *SelectBy_DesiredState:
- n += proto.SizeVarint(10<<3 | proto.WireVarint)
- n += proto.SizeVarint(uint64(x.DesiredState))
- case *SelectBy_Role:
- n += proto.SizeVarint(11<<3 | proto.WireVarint)
- n += proto.SizeVarint(uint64(x.Role))
- case *SelectBy_Membership:
- n += proto.SizeVarint(12<<3 | proto.WireVarint)
- n += proto.SizeVarint(uint64(x.Membership))
- case *SelectBy_ReferencedNetworkID:
- n += proto.SizeVarint(13<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(len(x.ReferencedNetworkID)))
- n += len(x.ReferencedNetworkID)
- case *SelectBy_ReferencedSecretID:
- n += proto.SizeVarint(14<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(len(x.ReferencedSecretID)))
- n += len(x.ReferencedSecretID)
- case *SelectBy_ReferencedConfigID:
- n += proto.SizeVarint(16<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(len(x.ReferencedConfigID)))
- n += len(x.ReferencedConfigID)
- case *SelectBy_Kind:
- n += proto.SizeVarint(15<<3 | proto.WireBytes)
- n += proto.SizeVarint(uint64(len(x.Kind)))
- n += len(x.Kind)
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
- }
- type WatchRequest struct {
- // Multiple entries are combined using OR logic - i.e. if an event
- // matches all of the selectors specified in any single watch entry,
- // the event will be sent to the client.
- Entries []*WatchRequest_WatchEntry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"`
- // ResumeFrom provides an version to resume the watch from, if non-nil.
- // The watch will return changes since this version, and continue to
- // return new changes afterwards. Watch will return an error if the
- // server has compacted its log and no longer has complete history to
- // this point.
- ResumeFrom *Version `protobuf:"bytes,2,opt,name=resume_from,json=resumeFrom" json:"resume_from,omitempty"`
- // IncludeOldObject causes WatchMessages to include a copy of the
- // previous version of the object on updates. Note that only live
- // changes will include the old object (not historical changes
- // retrieved using ResumeFrom).
- IncludeOldObject bool `protobuf:"varint,3,opt,name=include_old_object,json=includeOldObject,proto3" json:"include_old_object,omitempty"`
- }
- func (m *WatchRequest) Reset() { *m = WatchRequest{} }
- func (*WatchRequest) ProtoMessage() {}
- func (*WatchRequest) Descriptor() ([]byte, []int) { return fileDescriptorWatch, []int{4} }
- type WatchRequest_WatchEntry struct {
- // Kind can contain a builtin type such as "node", "secret", etc. or
- // the kind specified by a custom-defined object.
- Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
- // Action (create/update/delete)
- // This is a bitmask, so multiple actions may be OR'd together
- Action WatchActionKind `protobuf:"varint,2,opt,name=action,proto3,enum=docker.swarmkit.v1.WatchActionKind" json:"action,omitempty"`
- // Filters are combined using AND logic - an event must match
- // all of them to pass the filter.
- Filters []*SelectBy `protobuf:"bytes,3,rep,name=filters" json:"filters,omitempty"`
- }
- func (m *WatchRequest_WatchEntry) Reset() { *m = WatchRequest_WatchEntry{} }
- func (*WatchRequest_WatchEntry) ProtoMessage() {}
- func (*WatchRequest_WatchEntry) Descriptor() ([]byte, []int) { return fileDescriptorWatch, []int{4, 0} }
- // WatchMessage is the type of the stream that's returned to the client by
- // Watch. Note that the first item of this stream will always be a WatchMessage
- // with a nil Object, to signal that the stream has started.
- type WatchMessage struct {
- Events []*WatchMessage_Event `protobuf:"bytes,1,rep,name=events" json:"events,omitempty"`
- // Index versions this change to the data store. It can be used to
- // resume the watch from this point.
- Version *Version `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
- }
- func (m *WatchMessage) Reset() { *m = WatchMessage{} }
- func (*WatchMessage) ProtoMessage() {}
- func (*WatchMessage) Descriptor() ([]byte, []int) { return fileDescriptorWatch, []int{5} }
- type WatchMessage_Event struct {
- // Action (create/update/delete)
- // Note that WatchMessage does not expose "commit" events that
- // mark transaction boundaries.
- Action WatchActionKind `protobuf:"varint,1,opt,name=action,proto3,enum=docker.swarmkit.v1.WatchActionKind" json:"action,omitempty"`
- // Matched object
- Object *Object `protobuf:"bytes,2,opt,name=object" json:"object,omitempty"`
- // For updates, OldObject will optionally be included in the
- // watch message, containing the previous version of the
- // object, if IncludeOldObject was set in WatchRequest.
- OldObject *Object `protobuf:"bytes,3,opt,name=old_object,json=oldObject" json:"old_object,omitempty"`
- }
- func (m *WatchMessage_Event) Reset() { *m = WatchMessage_Event{} }
- func (*WatchMessage_Event) ProtoMessage() {}
- func (*WatchMessage_Event) Descriptor() ([]byte, []int) { return fileDescriptorWatch, []int{5, 0} }
- func init() {
- proto.RegisterType((*Object)(nil), "docker.swarmkit.v1.Object")
- proto.RegisterType((*SelectBySlot)(nil), "docker.swarmkit.v1.SelectBySlot")
- proto.RegisterType((*SelectByCustom)(nil), "docker.swarmkit.v1.SelectByCustom")
- proto.RegisterType((*SelectBy)(nil), "docker.swarmkit.v1.SelectBy")
- proto.RegisterType((*WatchRequest)(nil), "docker.swarmkit.v1.WatchRequest")
- proto.RegisterType((*WatchRequest_WatchEntry)(nil), "docker.swarmkit.v1.WatchRequest.WatchEntry")
- proto.RegisterType((*WatchMessage)(nil), "docker.swarmkit.v1.WatchMessage")
- proto.RegisterType((*WatchMessage_Event)(nil), "docker.swarmkit.v1.WatchMessage.Event")
- proto.RegisterEnum("docker.swarmkit.v1.WatchActionKind", WatchActionKind_name, WatchActionKind_value)
- }
- type authenticatedWrapperWatchServer struct {
- local WatchServer
- authorize func(context.Context, []string) error
- }
- func NewAuthenticatedWrapperWatchServer(local WatchServer, authorize func(context.Context, []string) error) WatchServer {
- return &authenticatedWrapperWatchServer{
- local: local,
- authorize: authorize,
- }
- }
- func (p *authenticatedWrapperWatchServer) Watch(r *WatchRequest, stream Watch_WatchServer) error {
- if err := p.authorize(stream.Context(), []string{"swarm-manager"}); err != nil {
- return err
- }
- return p.local.Watch(r, stream)
- }
- func (m *Object) Copy() *Object {
- if m == nil {
- return nil
- }
- o := &Object{}
- o.CopyFrom(m)
- return o
- }
- func (m *Object) CopyFrom(src interface{}) {
- o := src.(*Object)
- *m = *o
- if o.Object != nil {
- switch o.Object.(type) {
- case *Object_Node:
- v := Object_Node{
- Node: &Node{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.Node, o.GetNode())
- m.Object = &v
- case *Object_Service:
- v := Object_Service{
- Service: &Service{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.Service, o.GetService())
- m.Object = &v
- case *Object_Network:
- v := Object_Network{
- Network: &Network{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.Network, o.GetNetwork())
- m.Object = &v
- case *Object_Task:
- v := Object_Task{
- Task: &Task{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.Task, o.GetTask())
- m.Object = &v
- case *Object_Cluster:
- v := Object_Cluster{
- Cluster: &Cluster{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.Cluster, o.GetCluster())
- m.Object = &v
- case *Object_Secret:
- v := Object_Secret{
- Secret: &Secret{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.Secret, o.GetSecret())
- m.Object = &v
- case *Object_Resource:
- v := Object_Resource{
- Resource: &Resource{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.Resource, o.GetResource())
- m.Object = &v
- case *Object_Extension:
- v := Object_Extension{
- Extension: &Extension{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.Extension, o.GetExtension())
- m.Object = &v
- case *Object_Config:
- v := Object_Config{
- Config: &Config{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.Config, o.GetConfig())
- m.Object = &v
- }
- }
- }
- func (m *SelectBySlot) Copy() *SelectBySlot {
- if m == nil {
- return nil
- }
- o := &SelectBySlot{}
- o.CopyFrom(m)
- return o
- }
- func (m *SelectBySlot) CopyFrom(src interface{}) {
- o := src.(*SelectBySlot)
- *m = *o
- }
- func (m *SelectByCustom) Copy() *SelectByCustom {
- if m == nil {
- return nil
- }
- o := &SelectByCustom{}
- o.CopyFrom(m)
- return o
- }
- func (m *SelectByCustom) CopyFrom(src interface{}) {
- o := src.(*SelectByCustom)
- *m = *o
- }
- func (m *SelectBy) Copy() *SelectBy {
- if m == nil {
- return nil
- }
- o := &SelectBy{}
- o.CopyFrom(m)
- return o
- }
- func (m *SelectBy) CopyFrom(src interface{}) {
- o := src.(*SelectBy)
- *m = *o
- if o.By != nil {
- switch o.By.(type) {
- case *SelectBy_ID:
- v := SelectBy_ID{
- ID: o.GetID(),
- }
- m.By = &v
- case *SelectBy_IDPrefix:
- v := SelectBy_IDPrefix{
- IDPrefix: o.GetIDPrefix(),
- }
- m.By = &v
- case *SelectBy_Name:
- v := SelectBy_Name{
- Name: o.GetName(),
- }
- m.By = &v
- case *SelectBy_NamePrefix:
- v := SelectBy_NamePrefix{
- NamePrefix: o.GetNamePrefix(),
- }
- m.By = &v
- case *SelectBy_Custom:
- v := SelectBy_Custom{
- Custom: &SelectByCustom{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.Custom, o.GetCustom())
- m.By = &v
- case *SelectBy_CustomPrefix:
- v := SelectBy_CustomPrefix{
- CustomPrefix: &SelectByCustom{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.CustomPrefix, o.GetCustomPrefix())
- m.By = &v
- case *SelectBy_ServiceID:
- v := SelectBy_ServiceID{
- ServiceID: o.GetServiceID(),
- }
- m.By = &v
- case *SelectBy_NodeID:
- v := SelectBy_NodeID{
- NodeID: o.GetNodeID(),
- }
- m.By = &v
- case *SelectBy_Slot:
- v := SelectBy_Slot{
- Slot: &SelectBySlot{},
- }
- github_com_docker_swarmkit_api_deepcopy.Copy(v.Slot, o.GetSlot())
- m.By = &v
- case *SelectBy_DesiredState:
- v := SelectBy_DesiredState{
- DesiredState: o.GetDesiredState(),
- }
- m.By = &v
- case *SelectBy_Role:
- v := SelectBy_Role{
- Role: o.GetRole(),
- }
- m.By = &v
- case *SelectBy_Membership:
- v := SelectBy_Membership{
- Membership: o.GetMembership(),
- }
- m.By = &v
- case *SelectBy_ReferencedNetworkID:
- v := SelectBy_ReferencedNetworkID{
- ReferencedNetworkID: o.GetReferencedNetworkID(),
- }
- m.By = &v
- case *SelectBy_ReferencedSecretID:
- v := SelectBy_ReferencedSecretID{
- ReferencedSecretID: o.GetReferencedSecretID(),
- }
- m.By = &v
- case *SelectBy_ReferencedConfigID:
- v := SelectBy_ReferencedConfigID{
- ReferencedConfigID: o.GetReferencedConfigID(),
- }
- m.By = &v
- case *SelectBy_Kind:
- v := SelectBy_Kind{
- Kind: o.GetKind(),
- }
- m.By = &v
- }
- }
- }
- func (m *WatchRequest) Copy() *WatchRequest {
- if m == nil {
- return nil
- }
- o := &WatchRequest{}
- o.CopyFrom(m)
- return o
- }
- func (m *WatchRequest) CopyFrom(src interface{}) {
- o := src.(*WatchRequest)
- *m = *o
- if o.Entries != nil {
- m.Entries = make([]*WatchRequest_WatchEntry, len(o.Entries))
- for i := range m.Entries {
- m.Entries[i] = &WatchRequest_WatchEntry{}
- github_com_docker_swarmkit_api_deepcopy.Copy(m.Entries[i], o.Entries[i])
- }
- }
- if o.ResumeFrom != nil {
- m.ResumeFrom = &Version{}
- github_com_docker_swarmkit_api_deepcopy.Copy(m.ResumeFrom, o.ResumeFrom)
- }
- }
- func (m *WatchRequest_WatchEntry) Copy() *WatchRequest_WatchEntry {
- if m == nil {
- return nil
- }
- o := &WatchRequest_WatchEntry{}
- o.CopyFrom(m)
- return o
- }
- func (m *WatchRequest_WatchEntry) CopyFrom(src interface{}) {
- o := src.(*WatchRequest_WatchEntry)
- *m = *o
- if o.Filters != nil {
- m.Filters = make([]*SelectBy, len(o.Filters))
- for i := range m.Filters {
- m.Filters[i] = &SelectBy{}
- github_com_docker_swarmkit_api_deepcopy.Copy(m.Filters[i], o.Filters[i])
- }
- }
- }
- func (m *WatchMessage) Copy() *WatchMessage {
- if m == nil {
- return nil
- }
- o := &WatchMessage{}
- o.CopyFrom(m)
- return o
- }
- func (m *WatchMessage) CopyFrom(src interface{}) {
- o := src.(*WatchMessage)
- *m = *o
- if o.Events != nil {
- m.Events = make([]*WatchMessage_Event, len(o.Events))
- for i := range m.Events {
- m.Events[i] = &WatchMessage_Event{}
- github_com_docker_swarmkit_api_deepcopy.Copy(m.Events[i], o.Events[i])
- }
- }
- if o.Version != nil {
- m.Version = &Version{}
- github_com_docker_swarmkit_api_deepcopy.Copy(m.Version, o.Version)
- }
- }
- func (m *WatchMessage_Event) Copy() *WatchMessage_Event {
- if m == nil {
- return nil
- }
- o := &WatchMessage_Event{}
- o.CopyFrom(m)
- return o
- }
- func (m *WatchMessage_Event) CopyFrom(src interface{}) {
- o := src.(*WatchMessage_Event)
- *m = *o
- if o.Object != nil {
- m.Object = &Object{}
- github_com_docker_swarmkit_api_deepcopy.Copy(m.Object, o.Object)
- }
- if o.OldObject != nil {
- m.OldObject = &Object{}
- github_com_docker_swarmkit_api_deepcopy.Copy(m.OldObject, o.OldObject)
- }
- }
- // Reference imports to suppress errors if they are not otherwise used.
- var _ context.Context
- var _ grpc.ClientConn
- // This is a compile-time assertion to ensure that this generated file
- // is compatible with the grpc package it is being compiled against.
- const _ = grpc.SupportPackageIsVersion4
- // Client API for Watch service
- type WatchClient interface {
- // Watch starts a stream that returns any changes to objects that match
- // the specified selectors. When the stream begins, it immediately sends
- // an empty message back to the client. It is important to wait for
- // this message before taking any actions that depend on an established
- // stream of changes for consistency.
- Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Watch_WatchClient, error)
- }
- type watchClient struct {
- cc *grpc.ClientConn
- }
- func NewWatchClient(cc *grpc.ClientConn) WatchClient {
- return &watchClient{cc}
- }
- func (c *watchClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Watch_WatchClient, error) {
- stream, err := grpc.NewClientStream(ctx, &_Watch_serviceDesc.Streams[0], c.cc, "/docker.swarmkit.v1.Watch/Watch", opts...)
- if err != nil {
- return nil, err
- }
- x := &watchWatchClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
- }
- type Watch_WatchClient interface {
- Recv() (*WatchMessage, error)
- grpc.ClientStream
- }
- type watchWatchClient struct {
- grpc.ClientStream
- }
- func (x *watchWatchClient) Recv() (*WatchMessage, error) {
- m := new(WatchMessage)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
- }
- // Server API for Watch service
- type WatchServer interface {
- // Watch starts a stream that returns any changes to objects that match
- // the specified selectors. When the stream begins, it immediately sends
- // an empty message back to the client. It is important to wait for
- // this message before taking any actions that depend on an established
- // stream of changes for consistency.
- Watch(*WatchRequest, Watch_WatchServer) error
- }
- func RegisterWatchServer(s *grpc.Server, srv WatchServer) {
- s.RegisterService(&_Watch_serviceDesc, srv)
- }
- func _Watch_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(WatchRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(WatchServer).Watch(m, &watchWatchServer{stream})
- }
- type Watch_WatchServer interface {
- Send(*WatchMessage) error
- grpc.ServerStream
- }
- type watchWatchServer struct {
- grpc.ServerStream
- }
- func (x *watchWatchServer) Send(m *WatchMessage) error {
- return x.ServerStream.SendMsg(m)
- }
- var _Watch_serviceDesc = grpc.ServiceDesc{
- ServiceName: "docker.swarmkit.v1.Watch",
- HandlerType: (*WatchServer)(nil),
- Methods: []grpc.MethodDesc{},
- Streams: []grpc.StreamDesc{
- {
- StreamName: "Watch",
- Handler: _Watch_Watch_Handler,
- ServerStreams: true,
- },
- },
- Metadata: "watch.proto",
- }
- func (m *Object) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *Object) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Object != nil {
- nn1, err := m.Object.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += nn1
- }
- return i, nil
- }
- func (m *Object_Node) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Node != nil {
- dAtA[i] = 0xa
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Node.Size()))
- n2, err := m.Node.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n2
- }
- return i, nil
- }
- func (m *Object_Service) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Service != nil {
- dAtA[i] = 0x12
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Service.Size()))
- n3, err := m.Service.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n3
- }
- return i, nil
- }
- func (m *Object_Network) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Network != nil {
- dAtA[i] = 0x1a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Network.Size()))
- n4, err := m.Network.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n4
- }
- return i, nil
- }
- func (m *Object_Task) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Task != nil {
- dAtA[i] = 0x22
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Task.Size()))
- n5, err := m.Task.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n5
- }
- return i, nil
- }
- func (m *Object_Cluster) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Cluster != nil {
- dAtA[i] = 0x2a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Cluster.Size()))
- n6, err := m.Cluster.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n6
- }
- return i, nil
- }
- func (m *Object_Secret) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Secret != nil {
- dAtA[i] = 0x32
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Secret.Size()))
- n7, err := m.Secret.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n7
- }
- return i, nil
- }
- func (m *Object_Resource) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Resource != nil {
- dAtA[i] = 0x3a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Resource.Size()))
- n8, err := m.Resource.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n8
- }
- return i, nil
- }
- func (m *Object_Extension) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Extension != nil {
- dAtA[i] = 0x42
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Extension.Size()))
- n9, err := m.Extension.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n9
- }
- return i, nil
- }
- func (m *Object_Config) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Config != nil {
- dAtA[i] = 0x4a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Config.Size()))
- n10, err := m.Config.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n10
- }
- return i, nil
- }
- func (m *SelectBySlot) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *SelectBySlot) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.ServiceID) > 0 {
- dAtA[i] = 0xa
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID)))
- i += copy(dAtA[i:], m.ServiceID)
- }
- if m.Slot != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Slot))
- }
- return i, nil
- }
- func (m *SelectByCustom) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *SelectByCustom) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Kind) > 0 {
- dAtA[i] = 0xa
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind)))
- i += copy(dAtA[i:], m.Kind)
- }
- if len(m.Index) > 0 {
- dAtA[i] = 0x12
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.Index)))
- i += copy(dAtA[i:], m.Index)
- }
- if len(m.Value) > 0 {
- dAtA[i] = 0x1a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.Value)))
- i += copy(dAtA[i:], m.Value)
- }
- return i, nil
- }
- func (m *SelectBy) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *SelectBy) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.By != nil {
- nn11, err := m.By.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += nn11
- }
- return i, nil
- }
- func (m *SelectBy_ID) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0xa
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.ID)))
- i += copy(dAtA[i:], m.ID)
- return i, nil
- }
- func (m *SelectBy_IDPrefix) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x12
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.IDPrefix)))
- i += copy(dAtA[i:], m.IDPrefix)
- return i, nil
- }
- func (m *SelectBy_Name) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x1a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.Name)))
- i += copy(dAtA[i:], m.Name)
- return i, nil
- }
- func (m *SelectBy_NamePrefix) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x22
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.NamePrefix)))
- i += copy(dAtA[i:], m.NamePrefix)
- return i, nil
- }
- func (m *SelectBy_Custom) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Custom != nil {
- dAtA[i] = 0x2a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Custom.Size()))
- n12, err := m.Custom.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n12
- }
- return i, nil
- }
- func (m *SelectBy_CustomPrefix) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.CustomPrefix != nil {
- dAtA[i] = 0x32
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.CustomPrefix.Size()))
- n13, err := m.CustomPrefix.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n13
- }
- return i, nil
- }
- func (m *SelectBy_ServiceID) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x3a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID)))
- i += copy(dAtA[i:], m.ServiceID)
- return i, nil
- }
- func (m *SelectBy_NodeID) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x42
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.NodeID)))
- i += copy(dAtA[i:], m.NodeID)
- return i, nil
- }
- func (m *SelectBy_Slot) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Slot != nil {
- dAtA[i] = 0x4a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Slot.Size()))
- n14, err := m.Slot.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n14
- }
- return i, nil
- }
- func (m *SelectBy_DesiredState) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x50
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.DesiredState))
- return i, nil
- }
- func (m *SelectBy_Role) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x58
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Role))
- return i, nil
- }
- func (m *SelectBy_Membership) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x60
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Membership))
- return i, nil
- }
- func (m *SelectBy_ReferencedNetworkID) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x6a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedNetworkID)))
- i += copy(dAtA[i:], m.ReferencedNetworkID)
- return i, nil
- }
- func (m *SelectBy_ReferencedSecretID) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x72
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedSecretID)))
- i += copy(dAtA[i:], m.ReferencedSecretID)
- return i, nil
- }
- func (m *SelectBy_Kind) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x7a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind)))
- i += copy(dAtA[i:], m.Kind)
- return i, nil
- }
- func (m *SelectBy_ReferencedConfigID) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- dAtA[i] = 0x82
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedConfigID)))
- i += copy(dAtA[i:], m.ReferencedConfigID)
- return i, nil
- }
- func (m *WatchRequest) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *WatchRequest) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Entries) > 0 {
- for _, msg := range m.Entries {
- dAtA[i] = 0xa
- i++
- i = encodeVarintWatch(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if m.ResumeFrom != nil {
- dAtA[i] = 0x12
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.ResumeFrom.Size()))
- n15, err := m.ResumeFrom.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n15
- }
- if m.IncludeOldObject {
- dAtA[i] = 0x18
- i++
- if m.IncludeOldObject {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i++
- }
- return i, nil
- }
- func (m *WatchRequest_WatchEntry) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *WatchRequest_WatchEntry) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Kind) > 0 {
- dAtA[i] = 0xa
- i++
- i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind)))
- i += copy(dAtA[i:], m.Kind)
- }
- if m.Action != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Action))
- }
- if len(m.Filters) > 0 {
- for _, msg := range m.Filters {
- dAtA[i] = 0x1a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- return i, nil
- }
- func (m *WatchMessage) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *WatchMessage) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Events) > 0 {
- for _, msg := range m.Events {
- dAtA[i] = 0xa
- i++
- i = encodeVarintWatch(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if m.Version != nil {
- dAtA[i] = 0x12
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Version.Size()))
- n16, err := m.Version.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n16
- }
- return i, nil
- }
- func (m *WatchMessage_Event) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *WatchMessage_Event) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Action != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Action))
- }
- if m.Object != nil {
- dAtA[i] = 0x12
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.Object.Size()))
- n17, err := m.Object.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n17
- }
- if m.OldObject != nil {
- dAtA[i] = 0x1a
- i++
- i = encodeVarintWatch(dAtA, i, uint64(m.OldObject.Size()))
- n18, err := m.OldObject.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n18
- }
- return i, nil
- }
- func encodeFixed64Watch(dAtA []byte, offset int, v uint64) int {
- dAtA[offset] = uint8(v)
- dAtA[offset+1] = uint8(v >> 8)
- dAtA[offset+2] = uint8(v >> 16)
- dAtA[offset+3] = uint8(v >> 24)
- dAtA[offset+4] = uint8(v >> 32)
- dAtA[offset+5] = uint8(v >> 40)
- dAtA[offset+6] = uint8(v >> 48)
- dAtA[offset+7] = uint8(v >> 56)
- return offset + 8
- }
- func encodeFixed32Watch(dAtA []byte, offset int, v uint32) int {
- dAtA[offset] = uint8(v)
- dAtA[offset+1] = uint8(v >> 8)
- dAtA[offset+2] = uint8(v >> 16)
- dAtA[offset+3] = uint8(v >> 24)
- return offset + 4
- }
- func encodeVarintWatch(dAtA []byte, offset int, v uint64) int {
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return offset + 1
- }
- type raftProxyWatchServer struct {
- local WatchServer
- connSelector raftselector.ConnProvider
- localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error)
- }
- func NewRaftProxyWatchServer(local WatchServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) WatchServer {
- redirectChecker := func(ctx context.Context) (context.Context, error) {
- s, ok := transport.StreamFromContext(ctx)
- if !ok {
- return ctx, grpc.Errorf(codes.InvalidArgument, "remote addr is not found in context")
- }
- addr := s.ServerTransport().RemoteAddr().String()
- md, ok := metadata.FromContext(ctx)
- if ok && len(md["redirect"]) != 0 {
- return ctx, grpc.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"])
- }
- if !ok {
- md = metadata.New(map[string]string{})
- }
- md["redirect"] = append(md["redirect"], addr)
- return metadata.NewContext(ctx, md), nil
- }
- remoteMods := []func(context.Context) (context.Context, error){redirectChecker}
- remoteMods = append(remoteMods, remoteCtxMod)
- var localMods []func(context.Context) (context.Context, error)
- if localCtxMod != nil {
- localMods = []func(context.Context) (context.Context, error){localCtxMod}
- }
- return &raftProxyWatchServer{
- local: local,
- connSelector: connSelector,
- localCtxMods: localMods,
- remoteCtxMods: remoteMods,
- }
- }
- func (p *raftProxyWatchServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
- var err error
- for _, mod := range ctxMods {
- ctx, err = mod(ctx)
- if err != nil {
- return ctx, err
- }
- }
- return ctx, nil
- }
- func (p *raftProxyWatchServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
- ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
- defer ticker.Stop()
- for {
- select {
- case <-ticker.C:
- conn, err := p.connSelector.LeaderConn(ctx)
- if err != nil {
- return nil, err
- }
- client := NewHealthClient(conn)
- resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"})
- if err != nil || resp.Status != HealthCheckResponse_SERVING {
- continue
- }
- return conn, nil
- case <-ctx.Done():
- return nil, ctx.Err()
- }
- }
- }
- type Watch_WatchServerWrapper struct {
- Watch_WatchServer
- ctx context.Context
- }
- func (s Watch_WatchServerWrapper) Context() context.Context {
- return s.ctx
- }
- func (p *raftProxyWatchServer) Watch(r *WatchRequest, stream Watch_WatchServer) error {
- ctx := stream.Context()
- conn, err := p.connSelector.LeaderConn(ctx)
- if err != nil {
- if err == raftselector.ErrIsLeader {
- ctx, err = p.runCtxMods(ctx, p.localCtxMods)
- if err != nil {
- return err
- }
- streamWrapper := Watch_WatchServerWrapper{
- Watch_WatchServer: stream,
- ctx: ctx,
- }
- return p.local.Watch(r, streamWrapper)
- }
- return err
- }
- ctx, err = p.runCtxMods(ctx, p.remoteCtxMods)
- if err != nil {
- return err
- }
- clientStream, err := NewWatchClient(conn).Watch(ctx, r)
- if err != nil {
- return err
- }
- for {
- msg, err := clientStream.Recv()
- if err == io.EOF {
- break
- }
- if err != nil {
- return err
- }
- if err := stream.Send(msg); err != nil {
- return err
- }
- }
- return nil
- }
- func (m *Object) Size() (n int) {
- var l int
- _ = l
- if m.Object != nil {
- n += m.Object.Size()
- }
- return n
- }
- func (m *Object_Node) Size() (n int) {
- var l int
- _ = l
- if m.Node != nil {
- l = m.Node.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *Object_Service) Size() (n int) {
- var l int
- _ = l
- if m.Service != nil {
- l = m.Service.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *Object_Network) Size() (n int) {
- var l int
- _ = l
- if m.Network != nil {
- l = m.Network.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *Object_Task) Size() (n int) {
- var l int
- _ = l
- if m.Task != nil {
- l = m.Task.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *Object_Cluster) Size() (n int) {
- var l int
- _ = l
- if m.Cluster != nil {
- l = m.Cluster.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *Object_Secret) Size() (n int) {
- var l int
- _ = l
- if m.Secret != nil {
- l = m.Secret.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *Object_Resource) Size() (n int) {
- var l int
- _ = l
- if m.Resource != nil {
- l = m.Resource.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *Object_Extension) Size() (n int) {
- var l int
- _ = l
- if m.Extension != nil {
- l = m.Extension.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *Object_Config) Size() (n int) {
- var l int
- _ = l
- if m.Config != nil {
- l = m.Config.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *SelectBySlot) Size() (n int) {
- var l int
- _ = l
- l = len(m.ServiceID)
- if l > 0 {
- n += 1 + l + sovWatch(uint64(l))
- }
- if m.Slot != 0 {
- n += 1 + sovWatch(uint64(m.Slot))
- }
- return n
- }
- func (m *SelectByCustom) Size() (n int) {
- var l int
- _ = l
- l = len(m.Kind)
- if l > 0 {
- n += 1 + l + sovWatch(uint64(l))
- }
- l = len(m.Index)
- if l > 0 {
- n += 1 + l + sovWatch(uint64(l))
- }
- l = len(m.Value)
- if l > 0 {
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *SelectBy) Size() (n int) {
- var l int
- _ = l
- if m.By != nil {
- n += m.By.Size()
- }
- return n
- }
- func (m *SelectBy_ID) Size() (n int) {
- var l int
- _ = l
- l = len(m.ID)
- n += 1 + l + sovWatch(uint64(l))
- return n
- }
- func (m *SelectBy_IDPrefix) Size() (n int) {
- var l int
- _ = l
- l = len(m.IDPrefix)
- n += 1 + l + sovWatch(uint64(l))
- return n
- }
- func (m *SelectBy_Name) Size() (n int) {
- var l int
- _ = l
- l = len(m.Name)
- n += 1 + l + sovWatch(uint64(l))
- return n
- }
- func (m *SelectBy_NamePrefix) Size() (n int) {
- var l int
- _ = l
- l = len(m.NamePrefix)
- n += 1 + l + sovWatch(uint64(l))
- return n
- }
- func (m *SelectBy_Custom) Size() (n int) {
- var l int
- _ = l
- if m.Custom != nil {
- l = m.Custom.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *SelectBy_CustomPrefix) Size() (n int) {
- var l int
- _ = l
- if m.CustomPrefix != nil {
- l = m.CustomPrefix.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *SelectBy_ServiceID) Size() (n int) {
- var l int
- _ = l
- l = len(m.ServiceID)
- n += 1 + l + sovWatch(uint64(l))
- return n
- }
- func (m *SelectBy_NodeID) Size() (n int) {
- var l int
- _ = l
- l = len(m.NodeID)
- n += 1 + l + sovWatch(uint64(l))
- return n
- }
- func (m *SelectBy_Slot) Size() (n int) {
- var l int
- _ = l
- if m.Slot != nil {
- l = m.Slot.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *SelectBy_DesiredState) Size() (n int) {
- var l int
- _ = l
- n += 1 + sovWatch(uint64(m.DesiredState))
- return n
- }
- func (m *SelectBy_Role) Size() (n int) {
- var l int
- _ = l
- n += 1 + sovWatch(uint64(m.Role))
- return n
- }
- func (m *SelectBy_Membership) Size() (n int) {
- var l int
- _ = l
- n += 1 + sovWatch(uint64(m.Membership))
- return n
- }
- func (m *SelectBy_ReferencedNetworkID) Size() (n int) {
- var l int
- _ = l
- l = len(m.ReferencedNetworkID)
- n += 1 + l + sovWatch(uint64(l))
- return n
- }
- func (m *SelectBy_ReferencedSecretID) Size() (n int) {
- var l int
- _ = l
- l = len(m.ReferencedSecretID)
- n += 1 + l + sovWatch(uint64(l))
- return n
- }
- func (m *SelectBy_Kind) Size() (n int) {
- var l int
- _ = l
- l = len(m.Kind)
- n += 1 + l + sovWatch(uint64(l))
- return n
- }
- func (m *SelectBy_ReferencedConfigID) Size() (n int) {
- var l int
- _ = l
- l = len(m.ReferencedConfigID)
- n += 2 + l + sovWatch(uint64(l))
- return n
- }
- func (m *WatchRequest) Size() (n int) {
- var l int
- _ = l
- if len(m.Entries) > 0 {
- for _, e := range m.Entries {
- l = e.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- }
- if m.ResumeFrom != nil {
- l = m.ResumeFrom.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- if m.IncludeOldObject {
- n += 2
- }
- return n
- }
- func (m *WatchRequest_WatchEntry) Size() (n int) {
- var l int
- _ = l
- l = len(m.Kind)
- if l > 0 {
- n += 1 + l + sovWatch(uint64(l))
- }
- if m.Action != 0 {
- n += 1 + sovWatch(uint64(m.Action))
- }
- if len(m.Filters) > 0 {
- for _, e := range m.Filters {
- l = e.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- }
- return n
- }
- func (m *WatchMessage) Size() (n int) {
- var l int
- _ = l
- if len(m.Events) > 0 {
- for _, e := range m.Events {
- l = e.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- }
- if m.Version != nil {
- l = m.Version.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func (m *WatchMessage_Event) Size() (n int) {
- var l int
- _ = l
- if m.Action != 0 {
- n += 1 + sovWatch(uint64(m.Action))
- }
- if m.Object != nil {
- l = m.Object.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- if m.OldObject != nil {
- l = m.OldObject.Size()
- n += 1 + l + sovWatch(uint64(l))
- }
- return n
- }
- func sovWatch(x uint64) (n int) {
- for {
- n++
- x >>= 7
- if x == 0 {
- break
- }
- }
- return n
- }
- func sozWatch(x uint64) (n int) {
- return sovWatch(uint64((x << 1) ^ uint64((int64(x) >> 63))))
- }
- func (this *Object) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Object{`,
- `Object:` + fmt.Sprintf("%v", this.Object) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *Object_Node) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Object_Node{`,
- `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *Object_Service) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Object_Service{`,
- `Service:` + strings.Replace(fmt.Sprintf("%v", this.Service), "Service", "Service", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *Object_Network) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Object_Network{`,
- `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *Object_Task) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Object_Task{`,
- `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *Object_Cluster) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Object_Cluster{`,
- `Cluster:` + strings.Replace(fmt.Sprintf("%v", this.Cluster), "Cluster", "Cluster", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *Object_Secret) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Object_Secret{`,
- `Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *Object_Resource) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Object_Resource{`,
- `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "Resource", "Resource", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *Object_Extension) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Object_Extension{`,
- `Extension:` + strings.Replace(fmt.Sprintf("%v", this.Extension), "Extension", "Extension", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *Object_Config) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Object_Config{`,
- `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBySlot) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBySlot{`,
- `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`,
- `Slot:` + fmt.Sprintf("%v", this.Slot) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectByCustom) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectByCustom{`,
- `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
- `Index:` + fmt.Sprintf("%v", this.Index) + `,`,
- `Value:` + fmt.Sprintf("%v", this.Value) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy{`,
- `By:` + fmt.Sprintf("%v", this.By) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_ID) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_ID{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_IDPrefix) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_IDPrefix{`,
- `IDPrefix:` + fmt.Sprintf("%v", this.IDPrefix) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_Name) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_Name{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_NamePrefix) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_NamePrefix{`,
- `NamePrefix:` + fmt.Sprintf("%v", this.NamePrefix) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_Custom) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_Custom{`,
- `Custom:` + strings.Replace(fmt.Sprintf("%v", this.Custom), "SelectByCustom", "SelectByCustom", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_CustomPrefix) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_CustomPrefix{`,
- `CustomPrefix:` + strings.Replace(fmt.Sprintf("%v", this.CustomPrefix), "SelectByCustom", "SelectByCustom", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_ServiceID) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_ServiceID{`,
- `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_NodeID) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_NodeID{`,
- `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_Slot) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_Slot{`,
- `Slot:` + strings.Replace(fmt.Sprintf("%v", this.Slot), "SelectBySlot", "SelectBySlot", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_DesiredState) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_DesiredState{`,
- `DesiredState:` + fmt.Sprintf("%v", this.DesiredState) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_Role) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_Role{`,
- `Role:` + fmt.Sprintf("%v", this.Role) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_Membership) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_Membership{`,
- `Membership:` + fmt.Sprintf("%v", this.Membership) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_ReferencedNetworkID) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_ReferencedNetworkID{`,
- `ReferencedNetworkID:` + fmt.Sprintf("%v", this.ReferencedNetworkID) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_ReferencedSecretID) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_ReferencedSecretID{`,
- `ReferencedSecretID:` + fmt.Sprintf("%v", this.ReferencedSecretID) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_Kind) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_Kind{`,
- `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *SelectBy_ReferencedConfigID) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SelectBy_ReferencedConfigID{`,
- `ReferencedConfigID:` + fmt.Sprintf("%v", this.ReferencedConfigID) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *WatchRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&WatchRequest{`,
- `Entries:` + strings.Replace(fmt.Sprintf("%v", this.Entries), "WatchRequest_WatchEntry", "WatchRequest_WatchEntry", 1) + `,`,
- `ResumeFrom:` + strings.Replace(fmt.Sprintf("%v", this.ResumeFrom), "Version", "Version", 1) + `,`,
- `IncludeOldObject:` + fmt.Sprintf("%v", this.IncludeOldObject) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *WatchRequest_WatchEntry) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&WatchRequest_WatchEntry{`,
- `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
- `Action:` + fmt.Sprintf("%v", this.Action) + `,`,
- `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "SelectBy", "SelectBy", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *WatchMessage) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&WatchMessage{`,
- `Events:` + strings.Replace(fmt.Sprintf("%v", this.Events), "WatchMessage_Event", "WatchMessage_Event", 1) + `,`,
- `Version:` + strings.Replace(fmt.Sprintf("%v", this.Version), "Version", "Version", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func (this *WatchMessage_Event) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&WatchMessage_Event{`,
- `Action:` + fmt.Sprintf("%v", this.Action) + `,`,
- `Object:` + strings.Replace(fmt.Sprintf("%v", this.Object), "Object", "Object", 1) + `,`,
- `OldObject:` + strings.Replace(fmt.Sprintf("%v", this.OldObject), "Object", "Object", 1) + `,`,
- `}`,
- }, "")
- return s
- }
- func valueToStringWatch(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
- }
- func (m *Object) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: Object: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Object: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &Node{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.Object = &Object_Node{v}
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &Service{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.Object = &Object_Service{v}
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &Network{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.Object = &Object_Network{v}
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &Task{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.Object = &Object_Task{v}
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &Cluster{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.Object = &Object_Cluster{v}
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &Secret{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.Object = &Object_Secret{v}
- iNdEx = postIndex
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &Resource{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.Object = &Object_Resource{v}
- iNdEx = postIndex
- case 8:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &Extension{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.Object = &Object_Extension{v}
- iNdEx = postIndex
- case 9:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &Config{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.Object = &Object_Config{v}
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipWatch(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthWatch
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *SelectBySlot) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: SelectBySlot: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: SelectBySlot: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ServiceID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType)
- }
- m.Slot = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Slot |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipWatch(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthWatch
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *SelectByCustom) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: SelectByCustom: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: SelectByCustom: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Kind = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Index = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Value = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipWatch(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthWatch
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *SelectBy) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: SelectBy: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: SelectBy: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.By = &SelectBy_ID{string(dAtA[iNdEx:postIndex])}
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IDPrefix", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.By = &SelectBy_IDPrefix{string(dAtA[iNdEx:postIndex])}
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.By = &SelectBy_Name{string(dAtA[iNdEx:postIndex])}
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field NamePrefix", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.By = &SelectBy_NamePrefix{string(dAtA[iNdEx:postIndex])}
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &SelectByCustom{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.By = &SelectBy_Custom{v}
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CustomPrefix", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &SelectByCustom{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.By = &SelectBy_CustomPrefix{v}
- iNdEx = postIndex
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.By = &SelectBy_ServiceID{string(dAtA[iNdEx:postIndex])}
- iNdEx = postIndex
- case 8:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.By = &SelectBy_NodeID{string(dAtA[iNdEx:postIndex])}
- iNdEx = postIndex
- case 9:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &SelectBySlot{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.By = &SelectBy_Slot{v}
- iNdEx = postIndex
- case 10:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field DesiredState", wireType)
- }
- var v TaskState
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= (TaskState(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.By = &SelectBy_DesiredState{v}
- case 11:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
- }
- var v NodeRole
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= (NodeRole(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.By = &SelectBy_Role{v}
- case 12:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Membership", wireType)
- }
- var v NodeSpec_Membership
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= (NodeSpec_Membership(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.By = &SelectBy_Membership{v}
- case 13:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ReferencedNetworkID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.By = &SelectBy_ReferencedNetworkID{string(dAtA[iNdEx:postIndex])}
- iNdEx = postIndex
- case 14:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ReferencedSecretID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.By = &SelectBy_ReferencedSecretID{string(dAtA[iNdEx:postIndex])}
- iNdEx = postIndex
- case 15:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.By = &SelectBy_Kind{string(dAtA[iNdEx:postIndex])}
- iNdEx = postIndex
- case 16:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ReferencedConfigID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.By = &SelectBy_ReferencedConfigID{string(dAtA[iNdEx:postIndex])}
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipWatch(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthWatch
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *WatchRequest) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: WatchRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: WatchRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Entries = append(m.Entries, &WatchRequest_WatchEntry{})
- if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResumeFrom", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.ResumeFrom == nil {
- m.ResumeFrom = &Version{}
- }
- if err := m.ResumeFrom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field IncludeOldObject", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.IncludeOldObject = bool(v != 0)
- default:
- iNdEx = preIndex
- skippy, err := skipWatch(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthWatch
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *WatchRequest_WatchEntry) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: WatchEntry: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: WatchEntry: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + intStringLen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Kind = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
- }
- m.Action = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Action |= (WatchActionKind(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filters = append(m.Filters, &SelectBy{})
- if err := m.Filters[len(m.Filters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipWatch(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthWatch
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *WatchMessage) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: WatchMessage: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: WatchMessage: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Events = append(m.Events, &WatchMessage_Event{})
- if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Version == nil {
- m.Version = &Version{}
- }
- if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipWatch(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthWatch
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *WatchMessage_Event) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: Event: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
- }
- m.Action = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Action |= (WatchActionKind(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Object", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Object == nil {
- m.Object = &Object{}
- }
- if err := m.Object.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field OldObject", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthWatch
- }
- postIndex := iNdEx + msglen
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.OldObject == nil {
- m.OldObject = &Object{}
- }
- if err := m.OldObject.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipWatch(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthWatch
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func skipWatch(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- return iNdEx, nil
- case 1:
- iNdEx += 8
- return iNdEx, nil
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- iNdEx += length
- if length < 0 {
- return 0, ErrInvalidLengthWatch
- }
- return iNdEx, nil
- case 3:
- for {
- var innerWire uint64
- var start int = iNdEx
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowWatch
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- innerWire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- innerWireType := int(innerWire & 0x7)
- if innerWireType == 4 {
- break
- }
- next, err := skipWatch(dAtA[start:])
- if err != nil {
- return 0, err
- }
- iNdEx = start + next
- }
- return iNdEx, nil
- case 4:
- return iNdEx, nil
- case 5:
- iNdEx += 4
- return iNdEx, nil
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- }
- panic("unreachable")
- }
- var (
- ErrInvalidLengthWatch = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowWatch = fmt.Errorf("proto: integer overflow")
- )
- func init() { proto.RegisterFile("watch.proto", fileDescriptorWatch) }
- var fileDescriptorWatch = []byte{
- // 1155 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x96, 0xbb, 0x73, 0x1b, 0xd5,
- 0x17, 0xc7, 0xb5, 0x8a, 0xbc, 0x92, 0x8e, 0xac, 0xc4, 0x73, 0xed, 0x24, 0xfb, 0xd3, 0x2f, 0x48,
- 0x42, 0x0c, 0xe0, 0x21, 0x41, 0x01, 0x13, 0xc2, 0x00, 0x81, 0x19, 0x4b, 0x16, 0x23, 0x91, 0xb1,
- 0xec, 0xb9, 0xb6, 0xe3, 0x52, 0xb3, 0xde, 0x3d, 0x56, 0x16, 0xed, 0x43, 0xdc, 0x5d, 0xc9, 0x71,
- 0x47, 0x41, 0xc1, 0xa4, 0x67, 0x86, 0x26, 0x15, 0xd4, 0x34, 0x74, 0xf0, 0x0f, 0x64, 0xa8, 0x28,
- 0xa1, 0xd1, 0x10, 0x95, 0x14, 0xfc, 0x05, 0x14, 0xcc, 0x7d, 0xac, 0x1f, 0xca, 0xca, 0x21, 0x95,
- 0xee, 0xbd, 0xfb, 0xf9, 0x9e, 0x7b, 0xf6, 0xbc, 0x56, 0x50, 0x38, 0x32, 0x23, 0xeb, 0x61, 0x7d,
- 0xc8, 0x82, 0x28, 0x20, 0xc4, 0x0e, 0xac, 0x01, 0xb2, 0x7a, 0x78, 0x64, 0x32, 0x6f, 0xe0, 0x44,
- 0xf5, 0xf1, 0xbb, 0xa5, 0x42, 0x38, 0x44, 0x2b, 0x94, 0x40, 0xa9, 0x18, 0x1c, 0x7c, 0x81, 0x56,
- 0x14, 0x6f, 0x0b, 0xd1, 0xf1, 0x10, 0xe3, 0xcd, 0x4a, 0x3f, 0xe8, 0x07, 0x62, 0x79, 0x9b, 0xaf,
- 0xd4, 0xe9, 0xf2, 0xd0, 0x1d, 0xf5, 0x1d, 0xff, 0xb6, 0xfc, 0x91, 0x87, 0xb5, 0xaf, 0x33, 0xa0,
- 0x6f, 0x09, 0x4b, 0xa4, 0x0e, 0x19, 0x3f, 0xb0, 0xd1, 0xd0, 0xaa, 0xda, 0x6a, 0x61, 0xcd, 0xa8,
- 0x3f, 0xef, 0x41, 0xbd, 0x1b, 0xd8, 0xd8, 0x4e, 0x51, 0xc1, 0x91, 0x0f, 0x20, 0x1b, 0x22, 0x1b,
- 0x3b, 0x16, 0x1a, 0x69, 0x21, 0xf9, 0x7f, 0x92, 0x64, 0x47, 0x22, 0xed, 0x14, 0x8d, 0x69, 0x2e,
- 0xf4, 0x31, 0x3a, 0x0a, 0xd8, 0xc0, 0xb8, 0x34, 0x5f, 0xd8, 0x95, 0x08, 0x17, 0x2a, 0x9a, 0x7b,
- 0x18, 0x99, 0xe1, 0xc0, 0xc8, 0xcc, 0xf7, 0x70, 0xd7, 0x0c, 0xb9, 0x44, 0x70, 0xfc, 0x22, 0xcb,
- 0x1d, 0x85, 0x11, 0x32, 0x63, 0x61, 0xfe, 0x45, 0x4d, 0x89, 0xf0, 0x8b, 0x14, 0x4d, 0xee, 0x80,
- 0x1e, 0xa2, 0xc5, 0x30, 0x32, 0x74, 0xa1, 0x2b, 0x25, 0xbf, 0x19, 0x27, 0xda, 0x29, 0xaa, 0x58,
- 0xf2, 0x11, 0xe4, 0x18, 0x86, 0xc1, 0x88, 0x59, 0x68, 0x64, 0x85, 0xee, 0x46, 0x92, 0x8e, 0x2a,
- 0xa6, 0x9d, 0xa2, 0x27, 0x3c, 0xf9, 0x04, 0xf2, 0xf8, 0x28, 0x42, 0x3f, 0x74, 0x02, 0xdf, 0xc8,
- 0x09, 0xf1, 0x2b, 0x49, 0xe2, 0x56, 0x0c, 0xb5, 0x53, 0xf4, 0x54, 0xc1, 0x1d, 0xb6, 0x02, 0xff,
- 0xd0, 0xe9, 0x1b, 0xf9, 0xf9, 0x0e, 0x37, 0x05, 0xc1, 0x1d, 0x96, 0x6c, 0x23, 0x17, 0xe7, 0xbe,
- 0xb6, 0x0d, 0x8b, 0x3b, 0xe8, 0xa2, 0x15, 0x35, 0x8e, 0x77, 0xdc, 0x20, 0x22, 0xb7, 0x00, 0x54,
- 0xb6, 0x7a, 0x8e, 0x2d, 0x2a, 0x22, 0xdf, 0x28, 0x4e, 0x27, 0x95, 0xbc, 0x4a, 0x67, 0x67, 0x83,
- 0xe6, 0x15, 0xd0, 0xb1, 0x09, 0x81, 0x4c, 0xe8, 0x06, 0x91, 0x28, 0x83, 0x0c, 0x15, 0xeb, 0xda,
- 0x36, 0x5c, 0x8e, 0x2d, 0x36, 0x47, 0x61, 0x14, 0x78, 0x9c, 0x1a, 0x38, 0xbe, 0xb2, 0x46, 0xc5,
- 0x9a, 0xac, 0xc0, 0x82, 0xe3, 0xdb, 0xf8, 0x48, 0x48, 0xf3, 0x54, 0x6e, 0xf8, 0xe9, 0xd8, 0x74,
- 0x47, 0x28, 0xca, 0x23, 0x4f, 0xe5, 0xa6, 0xf6, 0x97, 0x0e, 0xb9, 0xd8, 0x24, 0x31, 0x20, 0x7d,
- 0xe2, 0x98, 0x3e, 0x9d, 0x54, 0xd2, 0x9d, 0x8d, 0x76, 0x8a, 0xa6, 0x1d, 0x9b, 0xdc, 0x84, 0xbc,
- 0x63, 0xf7, 0x86, 0x0c, 0x0f, 0x1d, 0x65, 0xb6, 0xb1, 0x38, 0x9d, 0x54, 0x72, 0x9d, 0x8d, 0x6d,
- 0x71, 0xc6, 0xc3, 0xee, 0xd8, 0x72, 0x4d, 0x56, 0x20, 0xe3, 0x9b, 0x9e, 0xba, 0x48, 0x54, 0xb6,
- 0xe9, 0x21, 0x79, 0x15, 0x0a, 0xfc, 0x37, 0x36, 0x92, 0x51, 0x0f, 0x81, 0x1f, 0x2a, 0xe1, 0x3d,
- 0xd0, 0x2d, 0xf1, 0x5a, 0xaa, 0xb2, 0x6a, 0xc9, 0x15, 0x72, 0x36, 0x00, 0x22, 0xf0, 0x32, 0x14,
- 0x1d, 0x28, 0xca, 0x55, 0x7c, 0x85, 0xfe, 0x12, 0x46, 0x16, 0xa5, 0x54, 0x39, 0x52, 0x3f, 0x97,
- 0xa9, 0x6c, 0x42, 0xa6, 0x78, 0xa5, 0x9c, 0xe6, 0xea, 0x75, 0xc8, 0xf2, 0xee, 0xe5, 0x70, 0x4e,
- 0xc0, 0x30, 0x9d, 0x54, 0x74, 0xde, 0xd8, 0x82, 0xd4, 0xf9, 0xc3, 0x8e, 0x4d, 0xee, 0xaa, 0x94,
- 0xca, 0x72, 0xaa, 0x5e, 0xe4, 0x18, 0x2f, 0x18, 0x1e, 0x3a, 0xce, 0x93, 0x0d, 0x28, 0xda, 0x18,
- 0x3a, 0x0c, 0xed, 0x5e, 0x18, 0x99, 0x11, 0x1a, 0x50, 0xd5, 0x56, 0x2f, 0x27, 0xd7, 0x32, 0xef,
- 0xd5, 0x1d, 0x0e, 0xf1, 0x97, 0x52, 0x2a, 0xb1, 0x27, 0x6b, 0x90, 0x61, 0x81, 0x8b, 0x46, 0x41,
- 0x88, 0x6f, 0xcc, 0x1b, 0x45, 0x34, 0x70, 0xc5, 0x38, 0xe2, 0x2c, 0xe9, 0x00, 0x78, 0xe8, 0x1d,
- 0x20, 0x0b, 0x1f, 0x3a, 0x43, 0x63, 0x51, 0x28, 0xdf, 0x9c, 0xa7, 0xdc, 0x19, 0xa2, 0x55, 0xdf,
- 0x3c, 0xc1, 0x79, 0x72, 0x4f, 0xc5, 0x64, 0x13, 0xae, 0x32, 0x3c, 0x44, 0x86, 0xbe, 0x85, 0x76,
- 0x4f, 0x4d, 0x1f, 0x1e, 0xb1, 0xa2, 0x88, 0xd8, 0xf5, 0xe9, 0xa4, 0xb2, 0x4c, 0x4f, 0x00, 0x35,
- 0xa8, 0x44, 0xf8, 0x96, 0xd9, 0x73, 0xc7, 0x36, 0xf9, 0x1c, 0x56, 0xce, 0x98, 0x93, 0xc3, 0x82,
- 0x5b, 0xbb, 0x2c, 0xac, 0x5d, 0x9b, 0x4e, 0x2a, 0xe4, 0xd4, 0x9a, 0x9c, 0x2a, 0xc2, 0x18, 0x61,
- 0xb3, 0xa7, 0xbc, 0x61, 0x64, 0x13, 0x5d, 0x89, 0x0b, 0x56, 0xb4, 0xd1, 0xf9, 0x1b, 0x64, 0x77,
- 0xf3, 0x1b, 0x96, 0x92, 0x6e, 0x90, 0x63, 0x60, 0xf6, 0x06, 0x75, 0x6a, 0x37, 0x32, 0x90, 0x6e,
- 0x1c, 0xd7, 0xfe, 0x48, 0xc3, 0xe2, 0x3e, 0xff, 0x1e, 0x51, 0xfc, 0x72, 0x84, 0x61, 0x44, 0x5a,
- 0x90, 0x45, 0x3f, 0x62, 0x0e, 0x86, 0x86, 0x56, 0xbd, 0xb4, 0x5a, 0x58, 0xbb, 0x99, 0x14, 0xdb,
- 0xb3, 0x12, 0xb9, 0x69, 0xf9, 0x11, 0x3b, 0xa6, 0xb1, 0x96, 0xdc, 0x83, 0x02, 0xc3, 0x70, 0xe4,
- 0x61, 0xef, 0x90, 0x05, 0xde, 0x45, 0x1f, 0x8e, 0x07, 0xc8, 0xf8, 0x68, 0xa3, 0x20, 0xf9, 0xcf,
- 0x58, 0xe0, 0x91, 0x5b, 0x40, 0x1c, 0xdf, 0x72, 0x47, 0x36, 0xf6, 0x02, 0xd7, 0xee, 0xc9, 0x4f,
- 0xa0, 0x68, 0xde, 0x1c, 0x5d, 0x52, 0x4f, 0xb6, 0x5c, 0x5b, 0x0e, 0xb5, 0xd2, 0xb7, 0x1a, 0xc0,
- 0xa9, 0x0f, 0x89, 0xf3, 0xe7, 0x63, 0xd0, 0x4d, 0x2b, 0xe2, 0x33, 0x37, 0x2d, 0x0a, 0xe6, 0xb5,
- 0xb9, 0x2f, 0xb5, 0x2e, 0xb0, 0xfb, 0x8e, 0x6f, 0x53, 0x25, 0x21, 0x77, 0x21, 0x7b, 0xe8, 0xb8,
- 0x11, 0xb2, 0xd0, 0xb8, 0x24, 0x42, 0x72, 0xe3, 0xa2, 0x36, 0xa1, 0x31, 0x5c, 0xfb, 0x25, 0x8e,
- 0xed, 0x26, 0x86, 0xa1, 0xd9, 0x47, 0xf2, 0x29, 0xe8, 0x38, 0x46, 0x3f, 0x8a, 0x43, 0xfb, 0xc6,
- 0x5c, 0x2f, 0x94, 0xa2, 0xde, 0xe2, 0x38, 0x55, 0x2a, 0xf2, 0x3e, 0x64, 0xc7, 0x32, 0x5a, 0xff,
- 0x25, 0xa0, 0x31, 0x5b, 0xfa, 0x49, 0x83, 0x05, 0x61, 0xe8, 0x4c, 0x18, 0xb4, 0x97, 0x0f, 0xc3,
- 0x1a, 0xe8, 0x2a, 0x11, 0xe9, 0xf9, 0xdf, 0x1e, 0x99, 0x12, 0xaa, 0x48, 0xf2, 0x21, 0xc0, 0x4c,
- 0x02, 0x2f, 0xd6, 0xe5, 0x83, 0x38, 0xab, 0x6f, 0xfd, 0xa3, 0xc1, 0x95, 0x19, 0x57, 0xc8, 0x1d,
- 0x58, 0xd9, 0x5f, 0xdf, 0x6d, 0xb6, 0x7b, 0xeb, 0xcd, 0xdd, 0xce, 0x56, 0xb7, 0xb7, 0xd7, 0xbd,
- 0xdf, 0xdd, 0xda, 0xef, 0x2e, 0xa5, 0x4a, 0xa5, 0xc7, 0x4f, 0xaa, 0xd7, 0x66, 0xf0, 0x3d, 0x7f,
- 0xe0, 0x07, 0x47, 0xdc, 0xf1, 0xe5, 0x73, 0xaa, 0x26, 0x6d, 0xad, 0xef, 0xb6, 0x96, 0xb4, 0xd2,
- 0xff, 0x1e, 0x3f, 0xa9, 0x5e, 0x9d, 0x11, 0x35, 0x19, 0xca, 0xc9, 0x74, 0x5e, 0xb3, 0xb7, 0xbd,
- 0xc1, 0x35, 0xe9, 0x44, 0xcd, 0xde, 0xd0, 0x4e, 0xd2, 0xd0, 0xd6, 0xe6, 0xd6, 0x83, 0xd6, 0x52,
- 0x26, 0x51, 0x43, 0xd1, 0x0b, 0xc6, 0x58, 0xba, 0xfe, 0xcd, 0xf7, 0xe5, 0xd4, 0xcf, 0x3f, 0x94,
- 0x67, 0x5f, 0x75, 0xcd, 0x83, 0x05, 0x71, 0x44, 0xec, 0x78, 0x51, 0x7d, 0x51, 0x23, 0x96, 0xaa,
- 0x2f, 0xaa, 0xa7, 0xda, 0xd5, 0x5f, 0x7f, 0xfc, 0xfb, 0xbb, 0xf4, 0x15, 0x28, 0x0a, 0xe2, 0x6d,
- 0xcf, 0xf4, 0xcd, 0x3e, 0xb2, 0x77, 0xb4, 0x86, 0xf1, 0xf4, 0x59, 0x39, 0xf5, 0xfb, 0xb3, 0x72,
- 0xea, 0xab, 0x69, 0x59, 0x7b, 0x3a, 0x2d, 0x6b, 0xbf, 0x4d, 0xcb, 0xda, 0x9f, 0xd3, 0xb2, 0x76,
- 0xa0, 0x8b, 0x3f, 0x90, 0xef, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x53, 0xd9, 0x73, 0xb7,
- 0x0a, 0x00, 0x00,
- }
|