| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| // This file was auto-generated by the vanadium vdl tool. |
| // Source: controller.vdl |
| |
| package app |
| |
| import ( |
| "v.io/v23" |
| "v.io/v23/context" |
| "v.io/v23/rpc" |
| "v.io/v23/security" |
| "v.io/v23/vdlroot/signature" |
| "v.io/x/ref/services/wspr/internal/principal" |
| ) |
| |
| func __VDLEnsureNativeBuilt_controller() { |
| } |
| |
| // ControllerClientMethods is the client interface |
| // containing Controller methods. |
| type ControllerClientMethods interface { |
| // NewServer instructs WSPR to create a server and start listening for calls on |
| // behalf of a JavaScript server. |
| NewServer(_ *context.T, name string, serverId uint32, serverOpts []RpcServerOption, _ ...rpc.CallOpt) error |
| // Stop instructs WSPR to stop listening for calls for the |
| // given javascript server. |
| Stop(_ *context.T, serverId uint32, _ ...rpc.CallOpt) error |
| // AddName adds a published name to an existing server. |
| AddName(_ *context.T, serverId uint32, name string, _ ...rpc.CallOpt) error |
| // RemoveName removes a published name from an existing server. |
| RemoveName(_ *context.T, serverId uint32, name string, _ ...rpc.CallOpt) error |
| // Bless binds extensions of blessings held by this principal to |
| // another principal (represented by its public key). |
| Bless(_ *context.T, publicKey []byte, blessings security.Blessings, extension string, caveat []security.Caveat, _ ...rpc.CallOpt) (principal.BlessingsId, error) |
| // BlessSelf creates a blessing with the provided name for this principal. |
| BlessSelf(_ *context.T, name string, caveats []security.Caveat, _ ...rpc.CallOpt) (principal.BlessingsId, error) |
| // AddToRoots adds the provided blessing as a root. |
| AddToRoots(_ *context.T, blessings security.Blessings, _ ...rpc.CallOpt) error |
| // BlessingStoreSet puts the specified blessing in the blessing store under the provided pattern. |
| BlessingStoreSet(_ *context.T, blessingsblessings security.Blessings, pattern security.BlessingPattern, _ ...rpc.CallOpt) (principal.BlessingsId, error) |
| // BlessingStoreForPeer retrieves the blessings marked for the given peers. |
| BlessingStoreForPeer(_ *context.T, peerBlessings []string, _ ...rpc.CallOpt) (principal.BlessingsId, error) |
| // BlessingStoreSetDefault sets the default blessings. |
| BlessingStoreSetDefault(_ *context.T, blessingsblessings security.Blessings, _ ...rpc.CallOpt) error |
| // BlessingStoreDefault fetches the default blessings for the principal of the controller. |
| BlessingStoreDefault(*context.T, ...rpc.CallOpt) (principal.BlessingsId, error) |
| // BlessingStorePublicKey fetches the public key of the principal for which this store hosts blessings. |
| BlessingStorePublicKey(*context.T, ...rpc.CallOpt) ([]byte, error) |
| // BlessingStorePeerBlessings returns all the blessings that the BlessingStore holds. |
| BlessingStorePeerBlessings(*context.T, ...rpc.CallOpt) (map[security.BlessingPattern]principal.BlessingsId, error) |
| // BlessingStoreDebugString retrieves a debug string describing the state of the blessing store |
| BlessingStoreDebugString(*context.T, ...rpc.CallOpt) (string, error) |
| // RemoteBlessings fetches the remote blessings for a given name and method. |
| RemoteBlessings(_ *context.T, name string, method string, _ ...rpc.CallOpt) ([]string, error) |
| // Signature fetches the signature for a given name. |
| Signature(_ *context.T, name string, _ ...rpc.CallOpt) ([]signature.Interface, error) |
| } |
| |
| // ControllerClientStub adds universal methods to ControllerClientMethods. |
| type ControllerClientStub interface { |
| ControllerClientMethods |
| rpc.UniversalServiceMethods |
| } |
| |
| // ControllerClient returns a client stub for Controller. |
| func ControllerClient(name string) ControllerClientStub { |
| return implControllerClientStub{name} |
| } |
| |
| type implControllerClientStub struct { |
| name string |
| } |
| |
| func (c implControllerClientStub) NewServer(ctx *context.T, i0 string, i1 uint32, i2 []RpcServerOption, opts ...rpc.CallOpt) (err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "NewServer", []interface{}{i0, i1, i2}, nil, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) Stop(ctx *context.T, i0 uint32, opts ...rpc.CallOpt) (err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "Stop", []interface{}{i0}, nil, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) AddName(ctx *context.T, i0 uint32, i1 string, opts ...rpc.CallOpt) (err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "AddName", []interface{}{i0, i1}, nil, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) RemoveName(ctx *context.T, i0 uint32, i1 string, opts ...rpc.CallOpt) (err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "RemoveName", []interface{}{i0, i1}, nil, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) Bless(ctx *context.T, i0 []byte, i1 security.Blessings, i2 string, i3 []security.Caveat, opts ...rpc.CallOpt) (o0 principal.BlessingsId, err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "Bless", []interface{}{i0, i1, i2, i3}, []interface{}{&o0}, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) BlessSelf(ctx *context.T, i0 string, i1 []security.Caveat, opts ...rpc.CallOpt) (o0 principal.BlessingsId, err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "BlessSelf", []interface{}{i0, i1}, []interface{}{&o0}, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) AddToRoots(ctx *context.T, i0 security.Blessings, opts ...rpc.CallOpt) (err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "AddToRoots", []interface{}{i0}, nil, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) BlessingStoreSet(ctx *context.T, i0 security.Blessings, i1 security.BlessingPattern, opts ...rpc.CallOpt) (o0 principal.BlessingsId, err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "BlessingStoreSet", []interface{}{i0, i1}, []interface{}{&o0}, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) BlessingStoreForPeer(ctx *context.T, i0 []string, opts ...rpc.CallOpt) (o0 principal.BlessingsId, err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "BlessingStoreForPeer", []interface{}{i0}, []interface{}{&o0}, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) BlessingStoreSetDefault(ctx *context.T, i0 security.Blessings, opts ...rpc.CallOpt) (err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "BlessingStoreSetDefault", []interface{}{i0}, nil, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) BlessingStoreDefault(ctx *context.T, opts ...rpc.CallOpt) (o0 principal.BlessingsId, err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "BlessingStoreDefault", nil, []interface{}{&o0}, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) BlessingStorePublicKey(ctx *context.T, opts ...rpc.CallOpt) (o0 []byte, err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "BlessingStorePublicKey", nil, []interface{}{&o0}, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) BlessingStorePeerBlessings(ctx *context.T, opts ...rpc.CallOpt) (o0 map[security.BlessingPattern]principal.BlessingsId, err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "BlessingStorePeerBlessings", nil, []interface{}{&o0}, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) BlessingStoreDebugString(ctx *context.T, opts ...rpc.CallOpt) (o0 string, err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "BlessingStoreDebugString", nil, []interface{}{&o0}, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) RemoteBlessings(ctx *context.T, i0 string, i1 string, opts ...rpc.CallOpt) (o0 []string, err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "RemoteBlessings", []interface{}{i0, i1}, []interface{}{&o0}, opts...) |
| return |
| } |
| |
| func (c implControllerClientStub) Signature(ctx *context.T, i0 string, opts ...rpc.CallOpt) (o0 []signature.Interface, err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "Signature", []interface{}{i0}, []interface{}{&o0}, opts...) |
| return |
| } |
| |
| // ControllerServerMethods is the interface a server writer |
| // implements for Controller. |
| type ControllerServerMethods interface { |
| // NewServer instructs WSPR to create a server and start listening for calls on |
| // behalf of a JavaScript server. |
| NewServer(_ *context.T, _ rpc.ServerCall, name string, serverId uint32, serverOpts []RpcServerOption) error |
| // Stop instructs WSPR to stop listening for calls for the |
| // given javascript server. |
| Stop(_ *context.T, _ rpc.ServerCall, serverId uint32) error |
| // AddName adds a published name to an existing server. |
| AddName(_ *context.T, _ rpc.ServerCall, serverId uint32, name string) error |
| // RemoveName removes a published name from an existing server. |
| RemoveName(_ *context.T, _ rpc.ServerCall, serverId uint32, name string) error |
| // Bless binds extensions of blessings held by this principal to |
| // another principal (represented by its public key). |
| Bless(_ *context.T, _ rpc.ServerCall, publicKey []byte, blessings security.Blessings, extension string, caveat []security.Caveat) (principal.BlessingsId, error) |
| // BlessSelf creates a blessing with the provided name for this principal. |
| BlessSelf(_ *context.T, _ rpc.ServerCall, name string, caveats []security.Caveat) (principal.BlessingsId, error) |
| // AddToRoots adds the provided blessing as a root. |
| AddToRoots(_ *context.T, _ rpc.ServerCall, blessings security.Blessings) error |
| // BlessingStoreSet puts the specified blessing in the blessing store under the provided pattern. |
| BlessingStoreSet(_ *context.T, _ rpc.ServerCall, blessingsblessings security.Blessings, pattern security.BlessingPattern) (principal.BlessingsId, error) |
| // BlessingStoreForPeer retrieves the blessings marked for the given peers. |
| BlessingStoreForPeer(_ *context.T, _ rpc.ServerCall, peerBlessings []string) (principal.BlessingsId, error) |
| // BlessingStoreSetDefault sets the default blessings. |
| BlessingStoreSetDefault(_ *context.T, _ rpc.ServerCall, blessingsblessings security.Blessings) error |
| // BlessingStoreDefault fetches the default blessings for the principal of the controller. |
| BlessingStoreDefault(*context.T, rpc.ServerCall) (principal.BlessingsId, error) |
| // BlessingStorePublicKey fetches the public key of the principal for which this store hosts blessings. |
| BlessingStorePublicKey(*context.T, rpc.ServerCall) ([]byte, error) |
| // BlessingStorePeerBlessings returns all the blessings that the BlessingStore holds. |
| BlessingStorePeerBlessings(*context.T, rpc.ServerCall) (map[security.BlessingPattern]principal.BlessingsId, error) |
| // BlessingStoreDebugString retrieves a debug string describing the state of the blessing store |
| BlessingStoreDebugString(*context.T, rpc.ServerCall) (string, error) |
| // RemoteBlessings fetches the remote blessings for a given name and method. |
| RemoteBlessings(_ *context.T, _ rpc.ServerCall, name string, method string) ([]string, error) |
| // Signature fetches the signature for a given name. |
| Signature(_ *context.T, _ rpc.ServerCall, name string) ([]signature.Interface, error) |
| } |
| |
| // ControllerServerStubMethods is the server interface containing |
| // Controller methods, as expected by rpc.Server. |
| // There is no difference between this interface and ControllerServerMethods |
| // since there are no streaming methods. |
| type ControllerServerStubMethods ControllerServerMethods |
| |
| // ControllerServerStub adds universal methods to ControllerServerStubMethods. |
| type ControllerServerStub interface { |
| ControllerServerStubMethods |
| // Describe the Controller interfaces. |
| Describe__() []rpc.InterfaceDesc |
| } |
| |
| // ControllerServer returns a server stub for Controller. |
| // It converts an implementation of ControllerServerMethods into |
| // an object that may be used by rpc.Server. |
| func ControllerServer(impl ControllerServerMethods) ControllerServerStub { |
| stub := implControllerServerStub{ |
| impl: impl, |
| } |
| // Initialize GlobState; always check the stub itself first, to handle the |
| // case where the user has the Glob method defined in their VDL source. |
| if gs := rpc.NewGlobState(stub); gs != nil { |
| stub.gs = gs |
| } else if gs := rpc.NewGlobState(impl); gs != nil { |
| stub.gs = gs |
| } |
| return stub |
| } |
| |
| type implControllerServerStub struct { |
| impl ControllerServerMethods |
| gs *rpc.GlobState |
| } |
| |
| func (s implControllerServerStub) NewServer(ctx *context.T, call rpc.ServerCall, i0 string, i1 uint32, i2 []RpcServerOption) error { |
| return s.impl.NewServer(ctx, call, i0, i1, i2) |
| } |
| |
| func (s implControllerServerStub) Stop(ctx *context.T, call rpc.ServerCall, i0 uint32) error { |
| return s.impl.Stop(ctx, call, i0) |
| } |
| |
| func (s implControllerServerStub) AddName(ctx *context.T, call rpc.ServerCall, i0 uint32, i1 string) error { |
| return s.impl.AddName(ctx, call, i0, i1) |
| } |
| |
| func (s implControllerServerStub) RemoveName(ctx *context.T, call rpc.ServerCall, i0 uint32, i1 string) error { |
| return s.impl.RemoveName(ctx, call, i0, i1) |
| } |
| |
| func (s implControllerServerStub) Bless(ctx *context.T, call rpc.ServerCall, i0 []byte, i1 security.Blessings, i2 string, i3 []security.Caveat) (principal.BlessingsId, error) { |
| return s.impl.Bless(ctx, call, i0, i1, i2, i3) |
| } |
| |
| func (s implControllerServerStub) BlessSelf(ctx *context.T, call rpc.ServerCall, i0 string, i1 []security.Caveat) (principal.BlessingsId, error) { |
| return s.impl.BlessSelf(ctx, call, i0, i1) |
| } |
| |
| func (s implControllerServerStub) AddToRoots(ctx *context.T, call rpc.ServerCall, i0 security.Blessings) error { |
| return s.impl.AddToRoots(ctx, call, i0) |
| } |
| |
| func (s implControllerServerStub) BlessingStoreSet(ctx *context.T, call rpc.ServerCall, i0 security.Blessings, i1 security.BlessingPattern) (principal.BlessingsId, error) { |
| return s.impl.BlessingStoreSet(ctx, call, i0, i1) |
| } |
| |
| func (s implControllerServerStub) BlessingStoreForPeer(ctx *context.T, call rpc.ServerCall, i0 []string) (principal.BlessingsId, error) { |
| return s.impl.BlessingStoreForPeer(ctx, call, i0) |
| } |
| |
| func (s implControllerServerStub) BlessingStoreSetDefault(ctx *context.T, call rpc.ServerCall, i0 security.Blessings) error { |
| return s.impl.BlessingStoreSetDefault(ctx, call, i0) |
| } |
| |
| func (s implControllerServerStub) BlessingStoreDefault(ctx *context.T, call rpc.ServerCall) (principal.BlessingsId, error) { |
| return s.impl.BlessingStoreDefault(ctx, call) |
| } |
| |
| func (s implControllerServerStub) BlessingStorePublicKey(ctx *context.T, call rpc.ServerCall) ([]byte, error) { |
| return s.impl.BlessingStorePublicKey(ctx, call) |
| } |
| |
| func (s implControllerServerStub) BlessingStorePeerBlessings(ctx *context.T, call rpc.ServerCall) (map[security.BlessingPattern]principal.BlessingsId, error) { |
| return s.impl.BlessingStorePeerBlessings(ctx, call) |
| } |
| |
| func (s implControllerServerStub) BlessingStoreDebugString(ctx *context.T, call rpc.ServerCall) (string, error) { |
| return s.impl.BlessingStoreDebugString(ctx, call) |
| } |
| |
| func (s implControllerServerStub) RemoteBlessings(ctx *context.T, call rpc.ServerCall, i0 string, i1 string) ([]string, error) { |
| return s.impl.RemoteBlessings(ctx, call, i0, i1) |
| } |
| |
| func (s implControllerServerStub) Signature(ctx *context.T, call rpc.ServerCall, i0 string) ([]signature.Interface, error) { |
| return s.impl.Signature(ctx, call, i0) |
| } |
| |
| func (s implControllerServerStub) Globber() *rpc.GlobState { |
| return s.gs |
| } |
| |
| func (s implControllerServerStub) Describe__() []rpc.InterfaceDesc { |
| return []rpc.InterfaceDesc{ControllerDesc} |
| } |
| |
| // ControllerDesc describes the Controller interface. |
| var ControllerDesc rpc.InterfaceDesc = descController |
| |
| // descController hides the desc to keep godoc clean. |
| var descController = rpc.InterfaceDesc{ |
| Name: "Controller", |
| PkgPath: "v.io/x/ref/services/wspr/internal/app", |
| Methods: []rpc.MethodDesc{ |
| { |
| Name: "NewServer", |
| Doc: "// NewServer instructs WSPR to create a server and start listening for calls on\n// behalf of a JavaScript server.", |
| InArgs: []rpc.ArgDesc{ |
| {"name", ``}, // string |
| {"serverId", ``}, // uint32 |
| {"serverOpts", ``}, // []RpcServerOption |
| }, |
| }, |
| { |
| Name: "Stop", |
| Doc: "// Stop instructs WSPR to stop listening for calls for the\n// given javascript server.", |
| InArgs: []rpc.ArgDesc{ |
| {"serverId", ``}, // uint32 |
| }, |
| }, |
| { |
| Name: "AddName", |
| Doc: "// AddName adds a published name to an existing server.", |
| InArgs: []rpc.ArgDesc{ |
| {"serverId", ``}, // uint32 |
| {"name", ``}, // string |
| }, |
| }, |
| { |
| Name: "RemoveName", |
| Doc: "// RemoveName removes a published name from an existing server.", |
| InArgs: []rpc.ArgDesc{ |
| {"serverId", ``}, // uint32 |
| {"name", ``}, // string |
| }, |
| }, |
| { |
| Name: "Bless", |
| Doc: "// Bless binds extensions of blessings held by this principal to\n// another principal (represented by its public key).", |
| InArgs: []rpc.ArgDesc{ |
| {"publicKey", ``}, // []byte |
| {"blessings", ``}, // security.Blessings |
| {"extension", ``}, // string |
| {"caveat", ``}, // []security.Caveat |
| }, |
| OutArgs: []rpc.ArgDesc{ |
| {"", ``}, // principal.BlessingsId |
| }, |
| }, |
| { |
| Name: "BlessSelf", |
| Doc: "// BlessSelf creates a blessing with the provided name for this principal.", |
| InArgs: []rpc.ArgDesc{ |
| {"name", ``}, // string |
| {"caveats", ``}, // []security.Caveat |
| }, |
| OutArgs: []rpc.ArgDesc{ |
| {"", ``}, // principal.BlessingsId |
| }, |
| }, |
| { |
| Name: "AddToRoots", |
| Doc: "// AddToRoots adds the provided blessing as a root.", |
| InArgs: []rpc.ArgDesc{ |
| {"blessings", ``}, // security.Blessings |
| }, |
| }, |
| { |
| Name: "BlessingStoreSet", |
| Doc: "// BlessingStoreSet puts the specified blessing in the blessing store under the provided pattern.", |
| InArgs: []rpc.ArgDesc{ |
| {"blessingsblessings", ``}, // security.Blessings |
| {"pattern", ``}, // security.BlessingPattern |
| }, |
| OutArgs: []rpc.ArgDesc{ |
| {"", ``}, // principal.BlessingsId |
| }, |
| }, |
| { |
| Name: "BlessingStoreForPeer", |
| Doc: "// BlessingStoreForPeer retrieves the blessings marked for the given peers.", |
| InArgs: []rpc.ArgDesc{ |
| {"peerBlessings", ``}, // []string |
| }, |
| OutArgs: []rpc.ArgDesc{ |
| {"", ``}, // principal.BlessingsId |
| }, |
| }, |
| { |
| Name: "BlessingStoreSetDefault", |
| Doc: "// BlessingStoreSetDefault sets the default blessings.", |
| InArgs: []rpc.ArgDesc{ |
| {"blessingsblessings", ``}, // security.Blessings |
| }, |
| }, |
| { |
| Name: "BlessingStoreDefault", |
| Doc: "// BlessingStoreDefault fetches the default blessings for the principal of the controller.", |
| OutArgs: []rpc.ArgDesc{ |
| {"", ``}, // principal.BlessingsId |
| }, |
| }, |
| { |
| Name: "BlessingStorePublicKey", |
| Doc: "// BlessingStorePublicKey fetches the public key of the principal for which this store hosts blessings.", |
| OutArgs: []rpc.ArgDesc{ |
| {"", ``}, // []byte |
| }, |
| }, |
| { |
| Name: "BlessingStorePeerBlessings", |
| Doc: "// BlessingStorePeerBlessings returns all the blessings that the BlessingStore holds.", |
| OutArgs: []rpc.ArgDesc{ |
| {"", ``}, // map[security.BlessingPattern]principal.BlessingsId |
| }, |
| }, |
| { |
| Name: "BlessingStoreDebugString", |
| Doc: "// BlessingStoreDebugString retrieves a debug string describing the state of the blessing store", |
| OutArgs: []rpc.ArgDesc{ |
| {"", ``}, // string |
| }, |
| }, |
| { |
| Name: "RemoteBlessings", |
| Doc: "// RemoteBlessings fetches the remote blessings for a given name and method.", |
| InArgs: []rpc.ArgDesc{ |
| {"name", ``}, // string |
| {"method", ``}, // string |
| }, |
| OutArgs: []rpc.ArgDesc{ |
| {"", ``}, // []string |
| }, |
| }, |
| { |
| Name: "Signature", |
| Doc: "// Signature fetches the signature for a given name.", |
| InArgs: []rpc.ArgDesc{ |
| {"name", ``}, // string |
| }, |
| OutArgs: []rpc.ArgDesc{ |
| {"", ``}, // []signature.Interface |
| }, |
| }, |
| }, |
| } |