veyron2/ipc/model.go: Add the new Glob interfaces.
This change is the 1st of a series of changes that add a simple
interface for objects to participate in the namespace.
Each object will have the option of implementing the full
mounttable.Globbable interface, or the much simpler VChildrenGlobber
interface where each object only has to enumerate its immediate
children.
The subsequent changes will update the generated vdl.go files in other
repositories and add the new interface to all the invoker implementations.
Then we'll modify the ipc.Server to implement Glob using the new
interface, and finally, we'll convert most of the existing objects to
use VChildrenGlobber.
Change-Id: I68acd6437c3d083609fa4debf5829faf085f8681
diff --git a/runtimes/google/ipc/benchmarks/service.vdl.go b/runtimes/google/ipc/benchmarks/service.vdl.go
index 806dd55..646f0b0 100644
--- a/runtimes/google/ipc/benchmarks/service.vdl.go
+++ b/runtimes/google/ipc/benchmarks/service.vdl.go
@@ -294,9 +294,27 @@
// It takes a regular server implementing the BenchmarkService
// interface, and returns a new server stub.
func NewServerBenchmark(server BenchmarkService) interface{} {
- return &ServerStubBenchmark{
+ stub := &ServerStubBenchmark{
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubBenchmark implements Benchmark.
@@ -370,6 +388,7 @@
// the requirements of veyron2/ipc.ReflectInvoker.
type ServerStubBenchmark struct {
service BenchmarkService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubBenchmark) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -430,6 +449,10 @@
return
}
+func (__gen_s *ServerStubBenchmark) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubBenchmark) Echo(call _gen_ipc.ServerCall, Payload []byte) (reply []byte, err error) {
reply, err = __gen_s.service.Echo(call, Payload)
return
diff --git a/runtimes/google/ipc/flow_test.go b/runtimes/google/ipc/flow_test.go
index f121968..0d608bb 100644
--- a/runtimes/google/ipc/flow_test.go
+++ b/runtimes/google/ipc/flow_test.go
@@ -82,6 +82,10 @@
return nil, errors.New(inv.suffix)
}
+func (inv closureInvoker) VGlob() *ipc.GlobState {
+ return nil
+}
+
// echoInvoker serves a method that takes a string and echoes it:
// func(_ ServerCall, arg string) (string, error)
type echoInvoker struct{ suffix string }
@@ -100,6 +104,10 @@
return []interface{}{result}, nil
}
+func (inv echoInvoker) VGlob() *ipc.GlobState {
+ return nil
+}
+
func TestFlowClientServer(t *testing.T) {
type v []interface{}
type testcase struct {
diff --git a/security/agent/pingpong/wire.vdl.go b/security/agent/pingpong/wire.vdl.go
index 9bf1574..35862ff 100644
--- a/security/agent/pingpong/wire.vdl.go
+++ b/security/agent/pingpong/wire.vdl.go
@@ -64,9 +64,27 @@
// It takes a regular server implementing the PingPongService
// interface, and returns a new server stub.
func NewServerPingPong(server PingPongService) interface{} {
- return &ServerStubPingPong{
+ stub := &ServerStubPingPong{
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubPingPong implements PingPong.
@@ -131,6 +149,7 @@
// the requirements of veyron2/ipc.ReflectInvoker.
type ServerStubPingPong struct {
service PingPongService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubPingPong) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -181,6 +200,10 @@
return
}
+func (__gen_s *ServerStubPingPong) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubPingPong) Ping(call _gen_ipc.ServerCall, message string) (reply string, err error) {
reply, err = __gen_s.service.Ping(call, message)
return
diff --git a/security/agent/server/wire.vdl.go b/security/agent/server/wire.vdl.go
index d9fcc39..2870d8e 100644
--- a/security/agent/server/wire.vdl.go
+++ b/security/agent/server/wire.vdl.go
@@ -91,9 +91,27 @@
// It takes a regular server implementing the AgentService
// interface, and returns a new server stub.
func NewServerAgent(server AgentService) interface{} {
- return &ServerStubAgent{
+ stub := &ServerStubAgent{
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubAgent implements Agent.
@@ -301,6 +319,7 @@
// the requirements of veyron2/ipc.ReflectInvoker.
type ServerStubAgent struct {
service AgentService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubAgent) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -518,6 +537,10 @@
return
}
+func (__gen_s *ServerStubAgent) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubAgent) Bless(call _gen_ipc.ServerCall, key []byte, wit security.WireBlessings, extension string, caveat security.Caveat, additionalCaveats []security.Caveat) (reply security.WireBlessings, err error) {
reply, err = __gen_s.service.Bless(call, key, wit, extension, caveat, additionalCaveats)
return
diff --git a/services/identity/identity.vdl.go b/services/identity/identity.vdl.go
index 85027dc..60a4fc0 100644
--- a/services/identity/identity.vdl.go
+++ b/services/identity/identity.vdl.go
@@ -84,9 +84,27 @@
// It takes a regular server implementing the OAuthBlesserService
// interface, and returns a new server stub.
func NewServerOAuthBlesser(server OAuthBlesserService) interface{} {
- return &ServerStubOAuthBlesser{
+ stub := &ServerStubOAuthBlesser{
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubOAuthBlesser implements OAuthBlesser.
@@ -151,6 +169,7 @@
// the requirements of veyron2/ipc.ReflectInvoker.
type ServerStubOAuthBlesser struct {
service OAuthBlesserService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubOAuthBlesser) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -228,6 +247,10 @@
return
}
+func (__gen_s *ServerStubOAuthBlesser) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubOAuthBlesser) BlessUsingAccessToken(call _gen_ipc.ServerCall, token string) (blessing security.WireBlessings, email string, err error) {
blessing, email, err = __gen_s.service.BlessUsingAccessToken(call, token)
return
@@ -284,9 +307,27 @@
// It takes a regular server implementing the MacaroonBlesserService
// interface, and returns a new server stub.
func NewServerMacaroonBlesser(server MacaroonBlesserService) interface{} {
- return &ServerStubMacaroonBlesser{
+ stub := &ServerStubMacaroonBlesser{
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubMacaroonBlesser implements MacaroonBlesser.
@@ -351,6 +392,7 @@
// the requirements of veyron2/ipc.ReflectInvoker.
type ServerStubMacaroonBlesser struct {
service MacaroonBlesserService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubMacaroonBlesser) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -427,6 +469,10 @@
return
}
+func (__gen_s *ServerStubMacaroonBlesser) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubMacaroonBlesser) Bless(call _gen_ipc.ServerCall, macaroon string) (reply security.WireBlessings, err error) {
reply, err = __gen_s.service.Bless(call, macaroon)
return
diff --git a/services/mgmt/debug/debug.vdl.go b/services/mgmt/debug/debug.vdl.go
index 96e09d0..34514b4 100644
--- a/services/mgmt/debug/debug.vdl.go
+++ b/services/mgmt/debug/debug.vdl.go
@@ -97,12 +97,30 @@
// It takes a regular server implementing the DebugService
// interface, and returns a new server stub.
func NewServerDebug(server DebugService) interface{} {
- return &ServerStubDebug{
+ stub := &ServerStubDebug{
ServerStubLogFile: *logreader.NewServerLogFile(server).(*logreader.ServerStubLogFile),
ServerStubStats: *stats.NewServerStats(server).(*stats.ServerStubStats),
ServerStubPProf: *pprof.NewServerPProf(server).(*pprof.ServerStubPProf),
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubDebug implements Debug.
@@ -164,6 +182,7 @@
pprof.ServerStubPProf
service DebugService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubDebug) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -368,3 +387,7 @@
}
return
}
+
+func (__gen_s *ServerStubDebug) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
diff --git a/services/mgmt/node/config.vdl.go b/services/mgmt/node/config.vdl.go
index 5ef274f..7b9dfbe 100644
--- a/services/mgmt/node/config.vdl.go
+++ b/services/mgmt/node/config.vdl.go
@@ -67,9 +67,27 @@
// It takes a regular server implementing the ConfigService
// interface, and returns a new server stub.
func NewServerConfig(server ConfigService) interface{} {
- return &ServerStubConfig{
+ stub := &ServerStubConfig{
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubConfig implements Config.
@@ -134,6 +152,7 @@
// the requirements of veyron2/ipc.ReflectInvoker.
type ServerStubConfig struct {
service ConfigService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubConfig) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -184,6 +203,10 @@
return
}
+func (__gen_s *ServerStubConfig) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubConfig) Set(call _gen_ipc.ServerCall, key string, value string) (err error) {
err = __gen_s.service.Set(call, key, value)
return
diff --git a/services/mgmt/node/impl/proxy_invoker.go b/services/mgmt/node/impl/proxy_invoker.go
index b46733c..fb52ef7 100644
--- a/services/mgmt/node/impl/proxy_invoker.go
+++ b/services/mgmt/node/impl/proxy_invoker.go
@@ -121,6 +121,11 @@
return results, err
}
+func (p *proxyInvoker) VGlob() *ipc.GlobState {
+ // TODO(rthellend): Add implementation
+ return nil
+}
+
// numResults returns the number of result values for the given method.
func (p *proxyInvoker) numResults(method string) (int, error) {
sig, err := p.sigStub.Signature(nil)
diff --git a/services/mgmt/repository/repository.vdl.go b/services/mgmt/repository/repository.vdl.go
index 57ac530..93dbd1a 100644
--- a/services/mgmt/repository/repository.vdl.go
+++ b/services/mgmt/repository/repository.vdl.go
@@ -122,10 +122,28 @@
// It takes a regular server implementing the ApplicationService
// interface, and returns a new server stub.
func NewServerApplication(server ApplicationService) interface{} {
- return &ServerStubApplication{
+ stub := &ServerStubApplication{
ServerStubApplication: *repository.NewServerApplication(server).(*repository.ServerStubApplication),
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubApplication implements Application.
@@ -205,6 +223,7 @@
repository.ServerStubApplication
service ApplicationService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubApplication) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -331,6 +350,10 @@
return
}
+func (__gen_s *ServerStubApplication) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubApplication) Put(call _gen_ipc.ServerCall, Profiles []string, Envelope application.Envelope) (err error) {
err = __gen_s.service.Put(call, Profiles, Envelope)
return
@@ -416,10 +439,28 @@
// It takes a regular server implementing the ProfileService
// interface, and returns a new server stub.
func NewServerProfile(server ProfileService) interface{} {
- return &ServerStubProfile{
+ stub := &ServerStubProfile{
ServerStubProfile: *repository.NewServerProfile(server).(*repository.ServerStubProfile),
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubProfile implements Profile.
@@ -510,6 +551,7 @@
repository.ServerStubProfile
service ProfileService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubProfile) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -651,6 +693,10 @@
return
}
+func (__gen_s *ServerStubProfile) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubProfile) Specification(call _gen_ipc.ServerCall) (reply profile.Specification, err error) {
reply, err = __gen_s.service.Specification(call)
return
diff --git a/services/mgmt/root/root.vdl.go b/services/mgmt/root/root.vdl.go
index 273f77b..452cff5 100644
--- a/services/mgmt/root/root.vdl.go
+++ b/services/mgmt/root/root.vdl.go
@@ -72,9 +72,27 @@
// It takes a regular server implementing the RootService
// interface, and returns a new server stub.
func NewServerRoot(server RootService) interface{} {
- return &ServerStubRoot{
+ stub := &ServerStubRoot{
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubRoot implements Root.
@@ -139,6 +157,7 @@
// the requirements of veyron2/ipc.ReflectInvoker.
type ServerStubRoot struct {
service RootService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubRoot) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -188,6 +207,10 @@
return
}
+func (__gen_s *ServerStubRoot) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubRoot) Reset(call _gen_ipc.ServerCall, Deadline uint64) (err error) {
err = __gen_s.service.Reset(call, Deadline)
return
diff --git a/services/mounttable/lib/collection_test_interface.vdl.go b/services/mounttable/lib/collection_test_interface.vdl.go
index a667cd5..377eeb2 100644
--- a/services/mounttable/lib/collection_test_interface.vdl.go
+++ b/services/mounttable/lib/collection_test_interface.vdl.go
@@ -78,9 +78,27 @@
// It takes a regular server implementing the CollectionService
// interface, and returns a new server stub.
func NewServerCollection(server CollectionService) interface{} {
- return &ServerStubCollection{
+ stub := &ServerStubCollection{
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubCollection implements Collection.
@@ -156,6 +174,7 @@
// the requirements of veyron2/ipc.ReflectInvoker.
type ServerStubCollection struct {
service CollectionService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubCollection) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -215,6 +234,10 @@
return
}
+func (__gen_s *ServerStubCollection) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubCollection) Export(call _gen_ipc.ServerCall, Val string, Overwrite bool) (err error) {
err = __gen_s.service.Export(call, Val, Overwrite)
return
diff --git a/services/security/discharger.vdl.go b/services/security/discharger.vdl.go
index 6793150..b36f608 100644
--- a/services/security/discharger.vdl.go
+++ b/services/security/discharger.vdl.go
@@ -83,9 +83,27 @@
// It takes a regular server implementing the DischargerService
// interface, and returns a new server stub.
func NewServerDischarger(server DischargerService) interface{} {
- return &ServerStubDischarger{
+ stub := &ServerStubDischarger{
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubDischarger implements Discharger.
@@ -150,6 +168,7 @@
// the requirements of veyron2/ipc.ReflectInvoker.
type ServerStubDischarger struct {
service DischargerService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubDischarger) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -208,6 +227,10 @@
return
}
+func (__gen_s *ServerStubDischarger) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubDischarger) Discharge(call _gen_ipc.ServerCall, Caveat _gen_vdlutil.Any, Impetus security.DischargeImpetus) (reply _gen_vdlutil.Any, err error) {
reply, err = __gen_s.service.Discharge(call, Caveat, Impetus)
return
diff --git a/tools/vrpc/test_base/test_base.vdl.go b/tools/vrpc/test_base/test_base.vdl.go
index 92bf836..ef4e9cf 100644
--- a/tools/vrpc/test_base/test_base.vdl.go
+++ b/tools/vrpc/test_base/test_base.vdl.go
@@ -236,9 +236,27 @@
// It takes a regular server implementing the TypeTesterService
// interface, and returns a new server stub.
func NewServerTypeTester(server TypeTesterService) interface{} {
- return &ServerStubTypeTester{
+ stub := &ServerStubTypeTester{
service: server,
}
+ var gs _gen_ipc.GlobState
+ var self interface{} = stub
+ // VAllGlobber is implemented by the server object, which is wrapped in
+ // a VDL generated server stub.
+ if x, ok := self.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VAllGlobber is implemented by the server object without using a VDL
+ // generated stub.
+ if x, ok := server.(_gen_ipc.VAllGlobber); ok {
+ gs.VAllGlobber = x
+ }
+ // VChildrenGlobber is implemented in the server object.
+ if x, ok := server.(_gen_ipc.VChildrenGlobber); ok {
+ gs.VChildrenGlobber = x
+ }
+ stub.gs = &gs
+ return stub
}
// clientStubTypeTester implements TypeTester.
@@ -510,6 +528,7 @@
// the requirements of veyron2/ipc.ReflectInvoker.
type ServerStubTypeTester struct {
service TypeTesterService
+ gs *_gen_ipc.GlobState
}
func (__gen_s *ServerStubTypeTester) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
@@ -764,6 +783,10 @@
return
}
+func (__gen_s *ServerStubTypeTester) VGlob() *_gen_ipc.GlobState {
+ return __gen_s.gs
+}
+
func (__gen_s *ServerStubTypeTester) EchoBool(call _gen_ipc.ServerCall, I1 bool) (reply bool, err error) {
reply, err = __gen_s.service.EchoBool(call, I1)
return