Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 1 | // This file was auto-generated by the veyron vdl tool. |
| 2 | // Source: repository.vdl |
| 3 | |
| 4 | // Package repository contains implementation of the interface for |
| 5 | // storing and serving various veyron management objects. |
| 6 | package repository |
| 7 | |
| 8 | import ( |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 9 | "v.io/core/veyron/services/mgmt/profile" |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 10 | |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 11 | "v.io/core/veyron2/services/mgmt/application" |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 12 | |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 13 | "v.io/core/veyron2/services/mgmt/repository" |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 14 | |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 15 | "v.io/core/veyron2/services/security/access" |
Asim Shankar | 6888519 | 2014-11-26 12:48:35 -0800 | [diff] [blame] | 16 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 17 | // The non-user imports are prefixed with "__" to prevent collisions. |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 18 | __veyron2 "v.io/core/veyron2" |
| 19 | __context "v.io/core/veyron2/context" |
| 20 | __ipc "v.io/core/veyron2/ipc" |
| 21 | __vdlutil "v.io/core/veyron2/vdl/vdlutil" |
| 22 | __wiretype "v.io/core/veyron2/wiretype" |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 23 | ) |
| 24 | |
Jing Jin | 896d776 | 2014-11-03 11:18:52 -0800 | [diff] [blame] | 25 | // TODO(toddw): Remove this line once the new signature support is done. |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 26 | // It corrects a bug where __wiretype is unused in VDL pacakges where only |
Jing Jin | 896d776 | 2014-11-03 11:18:52 -0800 | [diff] [blame] | 27 | // bootstrap types are used on interfaces. |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 28 | const _ = __wiretype.TypeIDInvalid |
Shyam Jayaraman | c4aed6e | 2014-07-22 14:25:06 -0700 | [diff] [blame] | 29 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 30 | // ApplicationClientMethods is the client interface |
| 31 | // containing Application methods. |
| 32 | // |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 33 | // Application describes an application repository internally. Besides |
| 34 | // the public Application interface, it allows to add and remove |
| 35 | // application envelopes. |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 36 | type ApplicationClientMethods interface { |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 37 | // Application provides access to application envelopes. An |
| 38 | // application envelope is identified by an application name and an |
Bogdan Caprita | d9281a3 | 2014-07-02 14:40:39 -0700 | [diff] [blame] | 39 | // application version, which are specified through the object name, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 40 | // and a profile name, which is specified using a method argument. |
| 41 | // |
| 42 | // Example: |
| 43 | // /apps/search/v1.Match([]string{"base", "media"}) |
| 44 | // returns an application envelope that can be used for downloading |
| 45 | // and executing the "search" application, version "v1", runnable |
| 46 | // on either the "base" or "media" profile. |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 47 | repository.ApplicationClientMethods |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 48 | // Put adds the given tuple of application version (specified |
Bogdan Caprita | d9281a3 | 2014-07-02 14:40:39 -0700 | [diff] [blame] | 49 | // through the object name suffix) and application envelope to all |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 50 | // of the given application profiles. |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 51 | Put(ctx *__context.T, Profiles []string, Envelope application.Envelope, opts ...__ipc.CallOpt) error |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 52 | // Remove removes the application envelope for the given profile |
Bogdan Caprita | d9281a3 | 2014-07-02 14:40:39 -0700 | [diff] [blame] | 53 | // name and application version (specified through the object name |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 54 | // suffix). If no version is specified as part of the suffix, the |
| 55 | // method removes all versions for the given profile. |
| 56 | // |
| 57 | // TODO(jsimsa): Add support for using "*" to specify all profiles |
| 58 | // when Matt implements Globing (or Ken implements querying). |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 59 | Remove(ctx *__context.T, Profile string, opts ...__ipc.CallOpt) error |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 60 | } |
| 61 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 62 | // ApplicationClientStub adds universal methods to ApplicationClientMethods. |
| 63 | type ApplicationClientStub interface { |
| 64 | ApplicationClientMethods |
| 65 | __ipc.UniversalServiceMethods |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 66 | } |
| 67 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 68 | // ApplicationClient returns a client stub for Application. |
| 69 | func ApplicationClient(name string, opts ...__ipc.BindOpt) ApplicationClientStub { |
| 70 | var client __ipc.Client |
| 71 | for _, opt := range opts { |
| 72 | if clientOpt, ok := opt.(__ipc.Client); ok { |
Matt Rosencrantz | bf85d54 | 2014-08-22 13:31:14 -0700 | [diff] [blame] | 73 | client = clientOpt |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 74 | } |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 75 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 76 | return implApplicationClientStub{name, client, repository.ApplicationClient(name, client)} |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 77 | } |
| 78 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 79 | type implApplicationClientStub struct { |
| 80 | name string |
| 81 | client __ipc.Client |
| 82 | |
| 83 | repository.ApplicationClientStub |
| 84 | } |
| 85 | |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 86 | func (c implApplicationClientStub) c(ctx *__context.T) __ipc.Client { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 87 | if c.client != nil { |
| 88 | return c.client |
| 89 | } |
| 90 | return __veyron2.RuntimeFromContext(ctx).Client() |
| 91 | } |
| 92 | |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 93 | func (c implApplicationClientStub) Put(ctx *__context.T, i0 []string, i1 application.Envelope, opts ...__ipc.CallOpt) (err error) { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 94 | var call __ipc.Call |
| 95 | if call, err = c.c(ctx).StartCall(ctx, c.name, "Put", []interface{}{i0, i1}, opts...); err != nil { |
| 96 | return |
| 97 | } |
| 98 | if ierr := call.Finish(&err); ierr != nil { |
| 99 | err = ierr |
| 100 | } |
| 101 | return |
| 102 | } |
| 103 | |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 104 | func (c implApplicationClientStub) Remove(ctx *__context.T, i0 string, opts ...__ipc.CallOpt) (err error) { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 105 | var call __ipc.Call |
| 106 | if call, err = c.c(ctx).StartCall(ctx, c.name, "Remove", []interface{}{i0}, opts...); err != nil { |
| 107 | return |
| 108 | } |
| 109 | if ierr := call.Finish(&err); ierr != nil { |
| 110 | err = ierr |
| 111 | } |
| 112 | return |
| 113 | } |
| 114 | |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 115 | func (c implApplicationClientStub) Signature(ctx *__context.T, opts ...__ipc.CallOpt) (o0 __ipc.ServiceSignature, err error) { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 116 | var call __ipc.Call |
| 117 | if call, err = c.c(ctx).StartCall(ctx, c.name, "Signature", nil, opts...); err != nil { |
| 118 | return |
| 119 | } |
| 120 | if ierr := call.Finish(&o0, &err); ierr != nil { |
| 121 | err = ierr |
| 122 | } |
| 123 | return |
| 124 | } |
| 125 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 126 | // ApplicationServerMethods is the interface a server writer |
| 127 | // implements for Application. |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 128 | // |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 129 | // Application describes an application repository internally. Besides |
| 130 | // the public Application interface, it allows to add and remove |
| 131 | // application envelopes. |
| 132 | type ApplicationServerMethods interface { |
| 133 | // Application provides access to application envelopes. An |
| 134 | // application envelope is identified by an application name and an |
| 135 | // application version, which are specified through the object name, |
| 136 | // and a profile name, which is specified using a method argument. |
| 137 | // |
| 138 | // Example: |
| 139 | // /apps/search/v1.Match([]string{"base", "media"}) |
| 140 | // returns an application envelope that can be used for downloading |
| 141 | // and executing the "search" application, version "v1", runnable |
| 142 | // on either the "base" or "media" profile. |
| 143 | repository.ApplicationServerMethods |
| 144 | // Put adds the given tuple of application version (specified |
| 145 | // through the object name suffix) and application envelope to all |
| 146 | // of the given application profiles. |
| 147 | Put(ctx __ipc.ServerContext, Profiles []string, Envelope application.Envelope) error |
| 148 | // Remove removes the application envelope for the given profile |
| 149 | // name and application version (specified through the object name |
| 150 | // suffix). If no version is specified as part of the suffix, the |
| 151 | // method removes all versions for the given profile. |
| 152 | // |
| 153 | // TODO(jsimsa): Add support for using "*" to specify all profiles |
| 154 | // when Matt implements Globing (or Ken implements querying). |
| 155 | Remove(ctx __ipc.ServerContext, Profile string) error |
| 156 | } |
| 157 | |
| 158 | // ApplicationServerStubMethods is the server interface containing |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 159 | // Application methods, as expected by ipc.Server. |
| 160 | // There is no difference between this interface and ApplicationServerMethods |
| 161 | // since there are no streaming methods. |
| 162 | type ApplicationServerStubMethods ApplicationServerMethods |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 163 | |
| 164 | // ApplicationServerStub adds universal methods to ApplicationServerStubMethods. |
| 165 | type ApplicationServerStub interface { |
| 166 | ApplicationServerStubMethods |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 167 | // Describe the Application interfaces. |
| 168 | Describe__() []__ipc.InterfaceDesc |
| 169 | // Signature will be replaced with Describe__. |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 170 | Signature(ctx __ipc.ServerContext) (__ipc.ServiceSignature, error) |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | // ApplicationServer returns a server stub for Application. |
| 174 | // It converts an implementation of ApplicationServerMethods into |
| 175 | // an object that may be used by ipc.Server. |
| 176 | func ApplicationServer(impl ApplicationServerMethods) ApplicationServerStub { |
| 177 | stub := implApplicationServerStub{ |
| 178 | impl: impl, |
| 179 | ApplicationServerStub: repository.ApplicationServer(impl), |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 180 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 181 | // Initialize GlobState; always check the stub itself first, to handle the |
| 182 | // case where the user has the Glob method defined in their VDL source. |
| 183 | if gs := __ipc.NewGlobState(stub); gs != nil { |
| 184 | stub.gs = gs |
| 185 | } else if gs := __ipc.NewGlobState(impl); gs != nil { |
| 186 | stub.gs = gs |
Robin Thellend | 94bc464 | 2014-11-05 18:05:08 -0800 | [diff] [blame] | 187 | } |
Robin Thellend | 94bc464 | 2014-11-05 18:05:08 -0800 | [diff] [blame] | 188 | return stub |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 189 | } |
| 190 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 191 | type implApplicationServerStub struct { |
| 192 | impl ApplicationServerMethods |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 193 | repository.ApplicationServerStub |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 194 | gs *__ipc.GlobState |
Matt Rosencrantz | bf85d54 | 2014-08-22 13:31:14 -0700 | [diff] [blame] | 195 | } |
| 196 | |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 197 | func (s implApplicationServerStub) Put(ctx __ipc.ServerContext, i0 []string, i1 application.Envelope) error { |
| 198 | return s.impl.Put(ctx, i0, i1) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 199 | } |
| 200 | |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 201 | func (s implApplicationServerStub) Remove(ctx __ipc.ServerContext, i0 string) error { |
| 202 | return s.impl.Remove(ctx, i0) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 203 | } |
| 204 | |
Robin Thellend | 39ac323 | 2014-12-02 09:50:41 -0800 | [diff] [blame] | 205 | func (s implApplicationServerStub) Globber() *__ipc.GlobState { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 206 | return s.gs |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 207 | } |
| 208 | |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 209 | func (s implApplicationServerStub) Describe__() []__ipc.InterfaceDesc { |
| 210 | return []__ipc.InterfaceDesc{ApplicationDesc, repository.ApplicationDesc} |
| 211 | } |
| 212 | |
| 213 | // ApplicationDesc describes the Application interface. |
| 214 | var ApplicationDesc __ipc.InterfaceDesc = descApplication |
| 215 | |
| 216 | // descApplication hides the desc to keep godoc clean. |
| 217 | var descApplication = __ipc.InterfaceDesc{ |
| 218 | Name: "Application", |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 219 | PkgPath: "v.io/core/veyron/services/mgmt/repository", |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 220 | Doc: "// Application describes an application repository internally. Besides\n// the public Application interface, it allows to add and remove\n// application envelopes.", |
| 221 | Embeds: []__ipc.EmbedDesc{ |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 222 | {"Application", "v.io/core/veyron2/services/mgmt/repository", "// Application provides access to application envelopes. An\n// application envelope is identified by an application name and an\n// application version, which are specified through the object name,\n// and a profile name, which is specified using a method argument.\n//\n// Example:\n// /apps/search/v1.Match([]string{\"base\", \"media\"})\n// returns an application envelope that can be used for downloading\n// and executing the \"search\" application, version \"v1\", runnable\n// on either the \"base\" or \"media\" profile."}, |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 223 | }, |
| 224 | Methods: []__ipc.MethodDesc{ |
| 225 | { |
| 226 | Name: "Put", |
| 227 | Doc: "// Put adds the given tuple of application version (specified\n// through the object name suffix) and application envelope to all\n// of the given application profiles.", |
| 228 | InArgs: []__ipc.ArgDesc{ |
| 229 | {"Profiles", ``}, // []string |
| 230 | {"Envelope", ``}, // application.Envelope |
| 231 | }, |
| 232 | OutArgs: []__ipc.ArgDesc{ |
| 233 | {"", ``}, // error |
| 234 | }, |
Asim Shankar | 6888519 | 2014-11-26 12:48:35 -0800 | [diff] [blame] | 235 | Tags: []__vdlutil.Any{access.Tag("Write")}, |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 236 | }, |
| 237 | { |
| 238 | Name: "Remove", |
| 239 | Doc: "// Remove removes the application envelope for the given profile\n// name and application version (specified through the object name\n// suffix). If no version is specified as part of the suffix, the\n// method removes all versions for the given profile.\n//\n// TODO(jsimsa): Add support for using \"*\" to specify all profiles\n// when Matt implements Globing (or Ken implements querying).", |
| 240 | InArgs: []__ipc.ArgDesc{ |
| 241 | {"Profile", ``}, // string |
| 242 | }, |
| 243 | OutArgs: []__ipc.ArgDesc{ |
| 244 | {"", ``}, // error |
| 245 | }, |
Asim Shankar | 6888519 | 2014-11-26 12:48:35 -0800 | [diff] [blame] | 246 | Tags: []__vdlutil.Any{access.Tag("Write")}, |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 247 | }, |
| 248 | }, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 249 | } |
| 250 | |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 251 | func (s implApplicationServerStub) Signature(ctx __ipc.ServerContext) (__ipc.ServiceSignature, error) { |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 252 | // TODO(toddw): Replace with new Describe__ implementation. |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 253 | result := __ipc.ServiceSignature{Methods: make(map[string]__ipc.MethodSignature)} |
| 254 | result.Methods["Put"] = __ipc.MethodSignature{ |
| 255 | InArgs: []__ipc.MethodArgument{ |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 256 | {Name: "Profiles", Type: 61}, |
Robin Thellend | 64178ed | 2014-11-20 13:16:22 -0800 | [diff] [blame] | 257 | {Name: "Envelope", Type: 66}, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 258 | }, |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 259 | OutArgs: []__ipc.MethodArgument{ |
Robin Thellend | 64178ed | 2014-11-20 13:16:22 -0800 | [diff] [blame] | 260 | {Name: "", Type: 67}, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 261 | }, |
| 262 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 263 | result.Methods["Remove"] = __ipc.MethodSignature{ |
| 264 | InArgs: []__ipc.MethodArgument{ |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 265 | {Name: "Profile", Type: 3}, |
| 266 | }, |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 267 | OutArgs: []__ipc.MethodArgument{ |
Robin Thellend | 64178ed | 2014-11-20 13:16:22 -0800 | [diff] [blame] | 268 | {Name: "", Type: 67}, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 269 | }, |
| 270 | } |
| 271 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 272 | result.TypeDefs = []__vdlutil.Any{ |
Robin Thellend | 64178ed | 2014-11-20 13:16:22 -0800 | [diff] [blame] | 273 | __wiretype.MapType{Key: 0x3, Elem: 0x3, Name: "", Tags: []string(nil)}, __wiretype.StructType{ |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 274 | []__wiretype.FieldType{ |
| 275 | __wiretype.FieldType{Type: 0x3, Name: "Title"}, |
| 276 | __wiretype.FieldType{Type: 0x3d, Name: "Args"}, |
| 277 | __wiretype.FieldType{Type: 0x3, Name: "Binary"}, |
| 278 | __wiretype.FieldType{Type: 0x3d, Name: "Env"}, |
Robin Thellend | 64178ed | 2014-11-20 13:16:22 -0800 | [diff] [blame] | 279 | __wiretype.FieldType{Type: 0x41, Name: "Packages"}, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 280 | }, |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 281 | "v.io/core/veyron2/services/mgmt/application.Envelope", []string(nil)}, |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 282 | __wiretype.NamedPrimitiveType{Type: 0x1, Name: "error", Tags: []string(nil)}} |
| 283 | var ss __ipc.ServiceSignature |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 284 | var firstAdded int |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 285 | ss, _ = s.ApplicationServerStub.Signature(ctx) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 286 | firstAdded = len(result.TypeDefs) |
| 287 | for k, v := range ss.Methods { |
| 288 | for i, _ := range v.InArgs { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 289 | if v.InArgs[i].Type >= __wiretype.TypeIDFirst { |
| 290 | v.InArgs[i].Type += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 291 | } |
| 292 | } |
| 293 | for i, _ := range v.OutArgs { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 294 | if v.OutArgs[i].Type >= __wiretype.TypeIDFirst { |
| 295 | v.OutArgs[i].Type += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 296 | } |
| 297 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 298 | if v.InStream >= __wiretype.TypeIDFirst { |
| 299 | v.InStream += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 300 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 301 | if v.OutStream >= __wiretype.TypeIDFirst { |
| 302 | v.OutStream += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 303 | } |
| 304 | result.Methods[k] = v |
| 305 | } |
| 306 | //TODO(bprosnitz) combine type definitions from embeded interfaces in a way that doesn't cause duplication. |
| 307 | for _, d := range ss.TypeDefs { |
| 308 | switch wt := d.(type) { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 309 | case __wiretype.SliceType: |
| 310 | if wt.Elem >= __wiretype.TypeIDFirst { |
| 311 | wt.Elem += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 312 | } |
| 313 | d = wt |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 314 | case __wiretype.ArrayType: |
| 315 | if wt.Elem >= __wiretype.TypeIDFirst { |
| 316 | wt.Elem += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 317 | } |
| 318 | d = wt |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 319 | case __wiretype.MapType: |
| 320 | if wt.Key >= __wiretype.TypeIDFirst { |
| 321 | wt.Key += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 322 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 323 | if wt.Elem >= __wiretype.TypeIDFirst { |
| 324 | wt.Elem += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 325 | } |
| 326 | d = wt |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 327 | case __wiretype.StructType: |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 328 | for i, fld := range wt.Fields { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 329 | if fld.Type >= __wiretype.TypeIDFirst { |
| 330 | wt.Fields[i].Type += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 331 | } |
| 332 | } |
| 333 | d = wt |
| 334 | // NOTE: other types are missing, but we are upgrading anyways. |
| 335 | } |
| 336 | result.TypeDefs = append(result.TypeDefs, d) |
| 337 | } |
| 338 | |
| 339 | return result, nil |
| 340 | } |
| 341 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 342 | // ProfileClientMethods is the client interface |
| 343 | // containing Profile methods. |
| 344 | // |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 345 | // Profile describes a profile internally. Besides the public Profile |
| 346 | // interface, it allows to add and remove profile specifications. |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 347 | type ProfileClientMethods interface { |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 348 | // Profile abstracts a device's ability to run binaries, and hides |
| 349 | // specifics such as the operating system, hardware architecture, and |
| 350 | // the set of installed libraries. Profiles describe binaries and |
| 351 | // devices, and are used to match them. |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 352 | repository.ProfileClientMethods |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 353 | // Specification returns the profile specification for the profile |
Bogdan Caprita | d9281a3 | 2014-07-02 14:40:39 -0700 | [diff] [blame] | 354 | // identified through the object name suffix. |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 355 | Specification(*__context.T, ...__ipc.CallOpt) (profile.Specification, error) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 356 | // Put sets the profile specification for the profile identified |
Bogdan Caprita | d9281a3 | 2014-07-02 14:40:39 -0700 | [diff] [blame] | 357 | // through the object name suffix. |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 358 | Put(ctx *__context.T, Specification profile.Specification, opts ...__ipc.CallOpt) error |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 359 | // Remove removes the profile specification for the profile |
Bogdan Caprita | d9281a3 | 2014-07-02 14:40:39 -0700 | [diff] [blame] | 360 | // identified through the object name suffix. |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 361 | Remove(*__context.T, ...__ipc.CallOpt) error |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 362 | } |
| 363 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 364 | // ProfileClientStub adds universal methods to ProfileClientMethods. |
| 365 | type ProfileClientStub interface { |
| 366 | ProfileClientMethods |
| 367 | __ipc.UniversalServiceMethods |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 368 | } |
| 369 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 370 | // ProfileClient returns a client stub for Profile. |
| 371 | func ProfileClient(name string, opts ...__ipc.BindOpt) ProfileClientStub { |
| 372 | var client __ipc.Client |
| 373 | for _, opt := range opts { |
| 374 | if clientOpt, ok := opt.(__ipc.Client); ok { |
Matt Rosencrantz | bf85d54 | 2014-08-22 13:31:14 -0700 | [diff] [blame] | 375 | client = clientOpt |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 376 | } |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 377 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 378 | return implProfileClientStub{name, client, repository.ProfileClient(name, client)} |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 379 | } |
| 380 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 381 | type implProfileClientStub struct { |
| 382 | name string |
| 383 | client __ipc.Client |
| 384 | |
| 385 | repository.ProfileClientStub |
| 386 | } |
| 387 | |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 388 | func (c implProfileClientStub) c(ctx *__context.T) __ipc.Client { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 389 | if c.client != nil { |
| 390 | return c.client |
| 391 | } |
| 392 | return __veyron2.RuntimeFromContext(ctx).Client() |
| 393 | } |
| 394 | |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 395 | func (c implProfileClientStub) Specification(ctx *__context.T, opts ...__ipc.CallOpt) (o0 profile.Specification, err error) { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 396 | var call __ipc.Call |
| 397 | if call, err = c.c(ctx).StartCall(ctx, c.name, "Specification", nil, opts...); err != nil { |
| 398 | return |
| 399 | } |
| 400 | if ierr := call.Finish(&o0, &err); ierr != nil { |
| 401 | err = ierr |
| 402 | } |
| 403 | return |
| 404 | } |
| 405 | |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 406 | func (c implProfileClientStub) Put(ctx *__context.T, i0 profile.Specification, opts ...__ipc.CallOpt) (err error) { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 407 | var call __ipc.Call |
| 408 | if call, err = c.c(ctx).StartCall(ctx, c.name, "Put", []interface{}{i0}, opts...); err != nil { |
| 409 | return |
| 410 | } |
| 411 | if ierr := call.Finish(&err); ierr != nil { |
| 412 | err = ierr |
| 413 | } |
| 414 | return |
| 415 | } |
| 416 | |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 417 | func (c implProfileClientStub) Remove(ctx *__context.T, opts ...__ipc.CallOpt) (err error) { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 418 | var call __ipc.Call |
| 419 | if call, err = c.c(ctx).StartCall(ctx, c.name, "Remove", nil, opts...); err != nil { |
| 420 | return |
| 421 | } |
| 422 | if ierr := call.Finish(&err); ierr != nil { |
| 423 | err = ierr |
| 424 | } |
| 425 | return |
| 426 | } |
| 427 | |
Matt Rosencrantz | 4f8ac60 | 2014-12-29 14:42:48 -0800 | [diff] [blame^] | 428 | func (c implProfileClientStub) Signature(ctx *__context.T, opts ...__ipc.CallOpt) (o0 __ipc.ServiceSignature, err error) { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 429 | var call __ipc.Call |
| 430 | if call, err = c.c(ctx).StartCall(ctx, c.name, "Signature", nil, opts...); err != nil { |
| 431 | return |
| 432 | } |
| 433 | if ierr := call.Finish(&o0, &err); ierr != nil { |
| 434 | err = ierr |
| 435 | } |
| 436 | return |
| 437 | } |
| 438 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 439 | // ProfileServerMethods is the interface a server writer |
| 440 | // implements for Profile. |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 441 | // |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 442 | // Profile describes a profile internally. Besides the public Profile |
| 443 | // interface, it allows to add and remove profile specifications. |
| 444 | type ProfileServerMethods interface { |
| 445 | // Profile abstracts a device's ability to run binaries, and hides |
| 446 | // specifics such as the operating system, hardware architecture, and |
| 447 | // the set of installed libraries. Profiles describe binaries and |
| 448 | // devices, and are used to match them. |
| 449 | repository.ProfileServerMethods |
| 450 | // Specification returns the profile specification for the profile |
| 451 | // identified through the object name suffix. |
| 452 | Specification(__ipc.ServerContext) (profile.Specification, error) |
| 453 | // Put sets the profile specification for the profile identified |
| 454 | // through the object name suffix. |
| 455 | Put(ctx __ipc.ServerContext, Specification profile.Specification) error |
| 456 | // Remove removes the profile specification for the profile |
| 457 | // identified through the object name suffix. |
| 458 | Remove(__ipc.ServerContext) error |
| 459 | } |
| 460 | |
| 461 | // ProfileServerStubMethods is the server interface containing |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 462 | // Profile methods, as expected by ipc.Server. |
| 463 | // There is no difference between this interface and ProfileServerMethods |
| 464 | // since there are no streaming methods. |
| 465 | type ProfileServerStubMethods ProfileServerMethods |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 466 | |
| 467 | // ProfileServerStub adds universal methods to ProfileServerStubMethods. |
| 468 | type ProfileServerStub interface { |
| 469 | ProfileServerStubMethods |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 470 | // Describe the Profile interfaces. |
| 471 | Describe__() []__ipc.InterfaceDesc |
| 472 | // Signature will be replaced with Describe__. |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 473 | Signature(ctx __ipc.ServerContext) (__ipc.ServiceSignature, error) |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 474 | } |
| 475 | |
| 476 | // ProfileServer returns a server stub for Profile. |
| 477 | // It converts an implementation of ProfileServerMethods into |
| 478 | // an object that may be used by ipc.Server. |
| 479 | func ProfileServer(impl ProfileServerMethods) ProfileServerStub { |
| 480 | stub := implProfileServerStub{ |
| 481 | impl: impl, |
| 482 | ProfileServerStub: repository.ProfileServer(impl), |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 483 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 484 | // Initialize GlobState; always check the stub itself first, to handle the |
| 485 | // case where the user has the Glob method defined in their VDL source. |
| 486 | if gs := __ipc.NewGlobState(stub); gs != nil { |
| 487 | stub.gs = gs |
| 488 | } else if gs := __ipc.NewGlobState(impl); gs != nil { |
| 489 | stub.gs = gs |
Robin Thellend | 94bc464 | 2014-11-05 18:05:08 -0800 | [diff] [blame] | 490 | } |
Robin Thellend | 94bc464 | 2014-11-05 18:05:08 -0800 | [diff] [blame] | 491 | return stub |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 492 | } |
| 493 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 494 | type implProfileServerStub struct { |
| 495 | impl ProfileServerMethods |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 496 | repository.ProfileServerStub |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 497 | gs *__ipc.GlobState |
Matt Rosencrantz | bf85d54 | 2014-08-22 13:31:14 -0700 | [diff] [blame] | 498 | } |
| 499 | |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 500 | func (s implProfileServerStub) Specification(ctx __ipc.ServerContext) (profile.Specification, error) { |
| 501 | return s.impl.Specification(ctx) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 502 | } |
| 503 | |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 504 | func (s implProfileServerStub) Put(ctx __ipc.ServerContext, i0 profile.Specification) error { |
| 505 | return s.impl.Put(ctx, i0) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 506 | } |
| 507 | |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 508 | func (s implProfileServerStub) Remove(ctx __ipc.ServerContext) error { |
| 509 | return s.impl.Remove(ctx) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 510 | } |
| 511 | |
Robin Thellend | 39ac323 | 2014-12-02 09:50:41 -0800 | [diff] [blame] | 512 | func (s implProfileServerStub) Globber() *__ipc.GlobState { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 513 | return s.gs |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 514 | } |
| 515 | |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 516 | func (s implProfileServerStub) Describe__() []__ipc.InterfaceDesc { |
| 517 | return []__ipc.InterfaceDesc{ProfileDesc, repository.ProfileDesc} |
| 518 | } |
| 519 | |
| 520 | // ProfileDesc describes the Profile interface. |
| 521 | var ProfileDesc __ipc.InterfaceDesc = descProfile |
| 522 | |
| 523 | // descProfile hides the desc to keep godoc clean. |
| 524 | var descProfile = __ipc.InterfaceDesc{ |
| 525 | Name: "Profile", |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 526 | PkgPath: "v.io/core/veyron/services/mgmt/repository", |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 527 | Doc: "// Profile describes a profile internally. Besides the public Profile\n// interface, it allows to add and remove profile specifications.", |
| 528 | Embeds: []__ipc.EmbedDesc{ |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 529 | {"Profile", "v.io/core/veyron2/services/mgmt/repository", "// Profile abstracts a device's ability to run binaries, and hides\n// specifics such as the operating system, hardware architecture, and\n// the set of installed libraries. Profiles describe binaries and\n// devices, and are used to match them."}, |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 530 | }, |
| 531 | Methods: []__ipc.MethodDesc{ |
| 532 | { |
| 533 | Name: "Specification", |
| 534 | Doc: "// Specification returns the profile specification for the profile\n// identified through the object name suffix.", |
| 535 | OutArgs: []__ipc.ArgDesc{ |
| 536 | {"", ``}, // profile.Specification |
| 537 | {"", ``}, // error |
| 538 | }, |
Asim Shankar | 6888519 | 2014-11-26 12:48:35 -0800 | [diff] [blame] | 539 | Tags: []__vdlutil.Any{access.Tag("Read")}, |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 540 | }, |
| 541 | { |
| 542 | Name: "Put", |
| 543 | Doc: "// Put sets the profile specification for the profile identified\n// through the object name suffix.", |
| 544 | InArgs: []__ipc.ArgDesc{ |
| 545 | {"Specification", ``}, // profile.Specification |
| 546 | }, |
| 547 | OutArgs: []__ipc.ArgDesc{ |
| 548 | {"", ``}, // error |
| 549 | }, |
Asim Shankar | 6888519 | 2014-11-26 12:48:35 -0800 | [diff] [blame] | 550 | Tags: []__vdlutil.Any{access.Tag("Write")}, |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 551 | }, |
| 552 | { |
| 553 | Name: "Remove", |
| 554 | Doc: "// Remove removes the profile specification for the profile\n// identified through the object name suffix.", |
| 555 | OutArgs: []__ipc.ArgDesc{ |
| 556 | {"", ``}, // error |
| 557 | }, |
Asim Shankar | 6888519 | 2014-11-26 12:48:35 -0800 | [diff] [blame] | 558 | Tags: []__vdlutil.Any{access.Tag("Write")}, |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 559 | }, |
| 560 | }, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 561 | } |
| 562 | |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 563 | func (s implProfileServerStub) Signature(ctx __ipc.ServerContext) (__ipc.ServiceSignature, error) { |
Todd Wang | 5739dda | 2014-11-16 22:44:02 -0800 | [diff] [blame] | 564 | // TODO(toddw): Replace with new Describe__ implementation. |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 565 | result := __ipc.ServiceSignature{Methods: make(map[string]__ipc.MethodSignature)} |
| 566 | result.Methods["Put"] = __ipc.MethodSignature{ |
| 567 | InArgs: []__ipc.MethodArgument{ |
Jiri Simsa | 2f8bc27 | 2014-07-16 12:29:15 -0700 | [diff] [blame] | 568 | {Name: "Specification", Type: 70}, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 569 | }, |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 570 | OutArgs: []__ipc.MethodArgument{ |
Jiri Simsa | 2f8bc27 | 2014-07-16 12:29:15 -0700 | [diff] [blame] | 571 | {Name: "", Type: 71}, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 572 | }, |
| 573 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 574 | result.Methods["Remove"] = __ipc.MethodSignature{ |
| 575 | InArgs: []__ipc.MethodArgument{}, |
| 576 | OutArgs: []__ipc.MethodArgument{ |
Jiri Simsa | 2f8bc27 | 2014-07-16 12:29:15 -0700 | [diff] [blame] | 577 | {Name: "", Type: 71}, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 578 | }, |
| 579 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 580 | result.Methods["Specification"] = __ipc.MethodSignature{ |
| 581 | InArgs: []__ipc.MethodArgument{}, |
| 582 | OutArgs: []__ipc.MethodArgument{ |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 583 | {Name: "", Type: 70}, |
Jiri Simsa | 2f8bc27 | 2014-07-16 12:29:15 -0700 | [diff] [blame] | 584 | {Name: "", Type: 71}, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 585 | }, |
| 586 | } |
| 587 | |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 588 | result.TypeDefs = []__vdlutil.Any{ |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 589 | __wiretype.NamedPrimitiveType{Type: 0x3, Name: "v.io/core/veyron2/services/mgmt/build.Architecture", Tags: []string(nil)}, __wiretype.NamedPrimitiveType{Type: 0x3, Name: "v.io/core/veyron2/services/mgmt/build.Format", Tags: []string(nil)}, __wiretype.StructType{ |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 590 | []__wiretype.FieldType{ |
| 591 | __wiretype.FieldType{Type: 0x3, Name: "Name"}, |
| 592 | __wiretype.FieldType{Type: 0x3, Name: "MajorVersion"}, |
| 593 | __wiretype.FieldType{Type: 0x3, Name: "MinorVersion"}, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 594 | }, |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 595 | "v.io/core/veyron/services/mgmt/profile.Library", []string(nil)}, |
| 596 | __wiretype.MapType{Key: 0x43, Elem: 0x2, Name: "", Tags: []string(nil)}, __wiretype.NamedPrimitiveType{Type: 0x3, Name: "v.io/core/veyron2/services/mgmt/build.OperatingSystem", Tags: []string(nil)}, __wiretype.StructType{ |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 597 | []__wiretype.FieldType{ |
| 598 | __wiretype.FieldType{Type: 0x41, Name: "Arch"}, |
| 599 | __wiretype.FieldType{Type: 0x3, Name: "Description"}, |
| 600 | __wiretype.FieldType{Type: 0x42, Name: "Format"}, |
| 601 | __wiretype.FieldType{Type: 0x44, Name: "Libraries"}, |
| 602 | __wiretype.FieldType{Type: 0x3, Name: "Label"}, |
| 603 | __wiretype.FieldType{Type: 0x45, Name: "OS"}, |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 604 | }, |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 605 | "v.io/core/veyron/services/mgmt/profile.Specification", []string(nil)}, |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 606 | __wiretype.NamedPrimitiveType{Type: 0x1, Name: "error", Tags: []string(nil)}} |
| 607 | var ss __ipc.ServiceSignature |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 608 | var firstAdded int |
Todd Wang | 1fe7cdd | 2014-11-12 12:51:49 -0800 | [diff] [blame] | 609 | ss, _ = s.ProfileServerStub.Signature(ctx) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 610 | firstAdded = len(result.TypeDefs) |
| 611 | for k, v := range ss.Methods { |
| 612 | for i, _ := range v.InArgs { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 613 | if v.InArgs[i].Type >= __wiretype.TypeIDFirst { |
| 614 | v.InArgs[i].Type += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 615 | } |
| 616 | } |
| 617 | for i, _ := range v.OutArgs { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 618 | if v.OutArgs[i].Type >= __wiretype.TypeIDFirst { |
| 619 | v.OutArgs[i].Type += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 620 | } |
| 621 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 622 | if v.InStream >= __wiretype.TypeIDFirst { |
| 623 | v.InStream += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 624 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 625 | if v.OutStream >= __wiretype.TypeIDFirst { |
| 626 | v.OutStream += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 627 | } |
| 628 | result.Methods[k] = v |
| 629 | } |
| 630 | //TODO(bprosnitz) combine type definitions from embeded interfaces in a way that doesn't cause duplication. |
| 631 | for _, d := range ss.TypeDefs { |
| 632 | switch wt := d.(type) { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 633 | case __wiretype.SliceType: |
| 634 | if wt.Elem >= __wiretype.TypeIDFirst { |
| 635 | wt.Elem += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 636 | } |
| 637 | d = wt |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 638 | case __wiretype.ArrayType: |
| 639 | if wt.Elem >= __wiretype.TypeIDFirst { |
| 640 | wt.Elem += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 641 | } |
| 642 | d = wt |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 643 | case __wiretype.MapType: |
| 644 | if wt.Key >= __wiretype.TypeIDFirst { |
| 645 | wt.Key += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 646 | } |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 647 | if wt.Elem >= __wiretype.TypeIDFirst { |
| 648 | wt.Elem += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 649 | } |
| 650 | d = wt |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 651 | case __wiretype.StructType: |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 652 | for i, fld := range wt.Fields { |
Todd Wang | 702385a | 2014-11-07 01:54:08 -0800 | [diff] [blame] | 653 | if fld.Type >= __wiretype.TypeIDFirst { |
| 654 | wt.Fields[i].Type += __wiretype.TypeID(firstAdded) |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 655 | } |
| 656 | } |
| 657 | d = wt |
| 658 | // NOTE: other types are missing, but we are upgrading anyways. |
| 659 | } |
| 660 | result.TypeDefs = append(result.TypeDefs, d) |
| 661 | } |
| 662 | |
| 663 | return result, nil |
| 664 | } |