Get p2b and vdl to compile again.
"make go/bin/p2b" will do everything.
Change-Id: I88cd527234fb4f3e5d0d337f37830e47136265b9
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2e1f380
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+go/bin
+go/pkg
diff --git a/Makefile b/Makefile
index b4d6296..0d74399 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
-PATH:=$(VANADIUM_ROOT)/environment/cout/node/bin:$(PATH)
-PATH:=node_modules/.bin:../node_modules/.bin:$(PATH)
+export PATH:=$(VANADIUM_ROOT)/environment/cout/node/bin:node_modules/.bin:$(PATH)
+export GOPATH=$(PWD)/go
+export VDLPATH=$(GOPATH)
# All JS files except build.js and third party
JS_FILES = $(shell find browser -name "*.js" -a -not -name "build.js" -a -not -path "*third-party*")
@@ -9,9 +10,17 @@
# Builds everything
all: node_modules browser/third-party browser/third-party/veyron browser/build.js browser/index.html $(VANADIUM_ROOT)/release/go/bin
-# Build p2b cli binary
-$(VANADIUM_ROOT)/release/go/bin: p2b/main.go
- veyron go install veyron/...
+v-binaries:
+# TODO(nlacasse): Only build the binaries we need.
+ v23 go install v.io/...
+
+# Build vdl.go
+go/src/p2b/vdl/p2b.vdl.go: v-binaries
+ vdl generate -lang=go p2b/vdl
+
+# Compile p2b cli binary
+go/bin/p2b: go/src/p2b/main.go go/src/p2b/vdl/p2b.vdl.go
+ v23 go install p2b/...
# Install what we need from NPM, tools such as jspm, serve, etc...
node_modules: package.json
@@ -60,4 +69,4 @@
rm -f browser/index.html
rm -f browser/build.js
-.PHONY: start clean watch
+.PHONY: start clean watch v-binaries
diff --git a/p2b/main.go b/go/src/p2b/main.go
similarity index 73%
rename from p2b/main.go
rename to go/src/p2b/main.go
index ec989cc..cc359ec 100644
--- a/p2b/main.go
+++ b/go/src/p2b/main.go
@@ -8,10 +8,10 @@
"io"
"os"
- "v.io/core/veyron2/options"
- "v.io/core/veyron2/rt"
+ "v.io/core/veyron2"
+ "v.io/core/veyron2/vlog"
- "v.io/examples/pipetobrowser"
+ "p2b/vdl"
)
const usage = `
@@ -61,26 +61,23 @@
func main() {
flag.Usage = Usage
- runtime := rt.Init(options.NamespaceRoots{"/proxy.envyor.com:8101"})
- log := runtime.Logger()
if flag.NArg() != 1 {
Usage()
return
}
+ ctx, shutdown := veyron2.Init()
+ defer shutdown()
+
name := flag.Arg(0)
// bind to the p2b service
- s, err := pipetobrowser.BindViewer(name)
- if err != nil {
- log.Errorf("error binding to server: %v", err)
- return
- }
+ s := vdl.ViewerClient(name)
- stream, err := s.Pipe(runtime.NewContext())
+ stream, err := s.Pipe(ctx)
if err != nil {
- log.Errorf("failed to pipe to '%s' please ensure p2b service is running in the browser and name is correct.\nERR:%v", name, err)
+ vlog.Errorf("failed to pipe to '%s' please ensure p2b service is running in the browser and name is correct.\nERR:%v", name, err)
return
}
@@ -88,13 +85,13 @@
_, err = io.Copy(w, os.Stdin)
if err != nil {
- log.Errorf("failed to copy the stdin pipe to the outgoing stream\nERR:%v", err)
+ vlog.Errorf("failed to copy the stdin pipe to the outgoing stream\nERR:%v", err)
return
}
_, err = stream.Finish()
if err != nil {
- log.Errorf("error finishing stream: %v", err)
+ vlog.Errorf("error finishing stream: %v", err)
return
}
diff --git a/p2b.vdl b/go/src/p2b/vdl/p2b.vdl
similarity index 74%
rename from p2b.vdl
rename to go/src/p2b/vdl/p2b.vdl
index 15fed1c..7b9fc1d 100644
--- a/p2b.vdl
+++ b/go/src/p2b/vdl/p2b.vdl
@@ -1,7 +1,7 @@
-// Package pipetobrowser is an example of a veyron service for
+// Package vdl is an example of a veyron service for
// streaming data from a pipe to a browser, which can visualize this
// data.
-package pipetobrowser
+package vdl
// Viewer allows clients to stream data to it and to request a
// particular viewer to format and display the data.
@@ -9,5 +9,5 @@
// Pipe creates a bidirectional pipe between client and viewer
// service, returns total number of bytes received by the service
// after streaming ends
- Pipe() stream<[]byte, _> (any, error)
+ Pipe() stream<[]byte, _> (any | error)
}
diff --git a/go/src/p2b/vdl/p2b.vdl.go b/go/src/p2b/vdl/p2b.vdl.go
new file mode 100644
index 0000000..bf60aba
--- /dev/null
+++ b/go/src/p2b/vdl/p2b.vdl.go
@@ -0,0 +1,277 @@
+// This file was auto-generated by the veyron vdl tool.
+// Source: p2b.vdl
+
+// Package vdl is an example of a veyron service for
+// streaming data from a pipe to a browser, which can visualize this
+// data.
+package vdl
+
+import (
+ // VDL system imports
+ "io"
+ "v.io/core/veyron2"
+ "v.io/core/veyron2/context"
+ "v.io/core/veyron2/ipc"
+ "v.io/core/veyron2/vdl"
+)
+
+// ViewerClientMethods is the client interface
+// containing Viewer methods.
+//
+// Viewer allows clients to stream data to it and to request a
+// particular viewer to format and display the data.
+type ViewerClientMethods interface {
+ // Pipe creates a bidirectional pipe between client and viewer
+ // service, returns total number of bytes received by the service
+ // after streaming ends
+ Pipe(*context.T, ...ipc.CallOpt) (ViewerPipeCall, error)
+}
+
+// ViewerClientStub adds universal methods to ViewerClientMethods.
+type ViewerClientStub interface {
+ ViewerClientMethods
+ ipc.UniversalServiceMethods
+}
+
+// ViewerClient returns a client stub for Viewer.
+func ViewerClient(name string, opts ...ipc.BindOpt) ViewerClientStub {
+ var client ipc.Client
+ for _, opt := range opts {
+ if clientOpt, ok := opt.(ipc.Client); ok {
+ client = clientOpt
+ }
+ }
+ return implViewerClientStub{name, client}
+}
+
+type implViewerClientStub struct {
+ name string
+ client ipc.Client
+}
+
+func (c implViewerClientStub) c(ctx *context.T) ipc.Client {
+ if c.client != nil {
+ return c.client
+ }
+ return veyron2.GetClient(ctx)
+}
+
+func (c implViewerClientStub) Pipe(ctx *context.T, opts ...ipc.CallOpt) (ocall ViewerPipeCall, err error) {
+ var call ipc.Call
+ if call, err = c.c(ctx).StartCall(ctx, c.name, "Pipe", nil, opts...); err != nil {
+ return
+ }
+ ocall = &implViewerPipeCall{Call: call}
+ return
+}
+
+// ViewerPipeClientStream is the client stream for Viewer.Pipe.
+type ViewerPipeClientStream interface {
+ // SendStream returns the send side of the Viewer.Pipe client stream.
+ SendStream() interface {
+ // Send places the item onto the output stream. Returns errors
+ // encountered while sending, or if Send is called after Close or
+ // the stream has been canceled. Blocks if there is no buffer
+ // space; will unblock when buffer space is available or after
+ // the stream has been canceled.
+ Send(item []byte) error
+ // Close indicates to the server that no more items will be sent;
+ // server Recv calls will receive io.EOF after all sent items.
+ // This is an optional call - e.g. a client might call Close if it
+ // needs to continue receiving items from the server after it's
+ // done sending. Returns errors encountered while closing, or if
+ // Close is called after the stream has been canceled. Like Send,
+ // blocks if there is no buffer space available.
+ Close() error
+ }
+}
+
+// ViewerPipeCall represents the call returned from Viewer.Pipe.
+type ViewerPipeCall interface {
+ ViewerPipeClientStream
+ // Finish performs the equivalent of SendStream().Close, then blocks until
+ // the server is done, and returns the positional return values for the call.
+ //
+ // Finish returns immediately if the call has been canceled; depending on the
+ // timing the output could either be an error signaling cancelation, or the
+ // valid positional return values from the server.
+ //
+ // Calling Finish is mandatory for releasing stream resources, unless the call
+ // has been canceled or any of the other methods return an error. Finish should
+ // be called at most once.
+ Finish() (vdl.AnyRep, error)
+}
+
+type implViewerPipeCall struct {
+ ipc.Call
+}
+
+func (c *implViewerPipeCall) SendStream() interface {
+ Send(item []byte) error
+ Close() error
+} {
+ return implViewerPipeCallSend{c}
+}
+
+type implViewerPipeCallSend struct {
+ c *implViewerPipeCall
+}
+
+func (c implViewerPipeCallSend) Send(item []byte) error {
+ return c.c.Send(item)
+}
+func (c implViewerPipeCallSend) Close() error {
+ return c.c.CloseSend()
+}
+func (c *implViewerPipeCall) Finish() (o0 vdl.AnyRep, err error) {
+ if ierr := c.Call.Finish(&o0, &err); ierr != nil {
+ err = ierr
+ }
+ return
+}
+
+// ViewerServerMethods is the interface a server writer
+// implements for Viewer.
+//
+// Viewer allows clients to stream data to it and to request a
+// particular viewer to format and display the data.
+type ViewerServerMethods interface {
+ // Pipe creates a bidirectional pipe between client and viewer
+ // service, returns total number of bytes received by the service
+ // after streaming ends
+ Pipe(ViewerPipeContext) (vdl.AnyRep, error)
+}
+
+// ViewerServerStubMethods is the server interface containing
+// Viewer methods, as expected by ipc.Server.
+// The only difference between this interface and ViewerServerMethods
+// is the streaming methods.
+type ViewerServerStubMethods interface {
+ // Pipe creates a bidirectional pipe between client and viewer
+ // service, returns total number of bytes received by the service
+ // after streaming ends
+ Pipe(*ViewerPipeContextStub) (vdl.AnyRep, error)
+}
+
+// ViewerServerStub adds universal methods to ViewerServerStubMethods.
+type ViewerServerStub interface {
+ ViewerServerStubMethods
+ // Describe the Viewer interfaces.
+ Describe__() []ipc.InterfaceDesc
+}
+
+// ViewerServer returns a server stub for Viewer.
+// It converts an implementation of ViewerServerMethods into
+// an object that may be used by ipc.Server.
+func ViewerServer(impl ViewerServerMethods) ViewerServerStub {
+ stub := implViewerServerStub{
+ 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 := ipc.NewGlobState(stub); gs != nil {
+ stub.gs = gs
+ } else if gs := ipc.NewGlobState(impl); gs != nil {
+ stub.gs = gs
+ }
+ return stub
+}
+
+type implViewerServerStub struct {
+ impl ViewerServerMethods
+ gs *ipc.GlobState
+}
+
+func (s implViewerServerStub) Pipe(ctx *ViewerPipeContextStub) (vdl.AnyRep, error) {
+ return s.impl.Pipe(ctx)
+}
+
+func (s implViewerServerStub) Globber() *ipc.GlobState {
+ return s.gs
+}
+
+func (s implViewerServerStub) Describe__() []ipc.InterfaceDesc {
+ return []ipc.InterfaceDesc{ViewerDesc}
+}
+
+// ViewerDesc describes the Viewer interface.
+var ViewerDesc ipc.InterfaceDesc = descViewer
+
+// descViewer hides the desc to keep godoc clean.
+var descViewer = ipc.InterfaceDesc{
+ Name: "Viewer",
+ PkgPath: "p2b/vdl",
+ Doc: "// Viewer allows clients to stream data to it and to request a\n// particular viewer to format and display the data.",
+ Methods: []ipc.MethodDesc{
+ {
+ Name: "Pipe",
+ Doc: "// Pipe creates a bidirectional pipe between client and viewer\n// service, returns total number of bytes received by the service\n// after streaming ends",
+ OutArgs: []ipc.ArgDesc{
+ {"", ``}, // vdl.AnyRep
+ {"", ``}, // error
+ },
+ },
+ },
+}
+
+// ViewerPipeServerStream is the server stream for Viewer.Pipe.
+type ViewerPipeServerStream interface {
+ // RecvStream returns the receiver side of the Viewer.Pipe server stream.
+ RecvStream() interface {
+ // Advance stages an item so that it may be retrieved via Value. Returns
+ // true iff there is an item to retrieve. Advance must be called before
+ // Value is called. May block if an item is not available.
+ Advance() bool
+ // Value returns the item that was staged by Advance. May panic if Advance
+ // returned false or was not called. Never blocks.
+ Value() []byte
+ // Err returns any error encountered by Advance. Never blocks.
+ Err() error
+ }
+}
+
+// ViewerPipeContext represents the context passed to Viewer.Pipe.
+type ViewerPipeContext interface {
+ ipc.ServerContext
+ ViewerPipeServerStream
+}
+
+// ViewerPipeContextStub is a wrapper that converts ipc.ServerCall into
+// a typesafe stub that implements ViewerPipeContext.
+type ViewerPipeContextStub struct {
+ ipc.ServerCall
+ valRecv []byte
+ errRecv error
+}
+
+// Init initializes ViewerPipeContextStub from ipc.ServerCall.
+func (s *ViewerPipeContextStub) Init(call ipc.ServerCall) {
+ s.ServerCall = call
+}
+
+// RecvStream returns the receiver side of the Viewer.Pipe server stream.
+func (s *ViewerPipeContextStub) RecvStream() interface {
+ Advance() bool
+ Value() []byte
+ Err() error
+} {
+ return implViewerPipeContextRecv{s}
+}
+
+type implViewerPipeContextRecv struct {
+ s *ViewerPipeContextStub
+}
+
+func (s implViewerPipeContextRecv) Advance() bool {
+ s.s.errRecv = s.s.Recv(&s.s.valRecv)
+ return s.s.errRecv == nil
+}
+func (s implViewerPipeContextRecv) Value() []byte {
+ return s.s.valRecv
+}
+func (s implViewerPipeContextRecv) Err() error {
+ if s.s.errRecv == io.EOF {
+ return nil
+ }
+ return s.s.errRecv
+}
diff --git a/p2b.vdl.go b/p2b.vdl.go
deleted file mode 100644
index e837b78..0000000
--- a/p2b.vdl.go
+++ /dev/null
@@ -1,345 +0,0 @@
-// This file was auto-generated by the veyron vdl tool.
-// Source: p2b.vdl
-
-// Package pipetobrowser is an example of a veyron service for
-// streaming data from a pipe to a browser, which can visualize this
-// data.
-package pipetobrowser
-
-import (
- // The non-user imports are prefixed with "_gen_" to prevent collisions.
- _gen_io "io"
- _gen_veyron2 "v.io/core/veyron2"
- _gen_context "v.io/core/veyron2/context"
- _gen_ipc "v.io/core/veyron2/ipc"
- _gen_naming "v.io/core/veyron2/naming"
- _gen_vdlutil "v.io/core/veyron2/vdl/vdlutil"
- _gen_wiretype "v.io/core/veyron2/wiretype"
-)
-
-// TODO(bprosnitz) Remove this line once signatures are updated to use typevals.
-// It corrects a bug where _gen_wiretype is unused in VDL pacakges where only bootstrap types are used on interfaces.
-const _ = _gen_wiretype.TypeIDInvalid
-
-// Viewer allows clients to stream data to it and to request a
-// particular viewer to format and display the data.
-// Viewer is the interface the client binds and uses.
-// Viewer_ExcludingUniversal is the interface without internal framework-added methods
-// to enable embedding without method collisions. Not to be used directly by clients.
-type Viewer_ExcludingUniversal interface {
- // Pipe creates a bidirectional pipe between client and viewer
- // service, returns total number of bytes received by the service
- // after streaming ends
- Pipe(ctx _gen_context.T, opts ..._gen_ipc.CallOpt) (reply ViewerPipeCall, err error)
-}
-type Viewer interface {
- _gen_ipc.UniversalServiceMethods
- Viewer_ExcludingUniversal
-}
-
-// ViewerService is the interface the server implements.
-type ViewerService interface {
-
- // Pipe creates a bidirectional pipe between client and viewer
- // service, returns total number of bytes received by the service
- // after streaming ends
- Pipe(context _gen_ipc.ServerContext, stream ViewerServicePipeStream) (reply _gen_vdlutil.Any, err error)
-}
-
-// ViewerPipeCall is the interface for call object of the method
-// Pipe in the service interface Viewer.
-type ViewerPipeCall interface {
-
- // SendStream returns the send portion of the stream
- SendStream() interface {
- // Send places the item onto the output stream, blocking if there is no
- // buffer space available. Calls to Send after having called Close
- // or Cancel will fail. Any blocked Send calls will be unblocked upon
- // calling Cancel.
- Send(item []byte) error
-
- // Close indicates to the server that no more items will be sent;
- // server Recv calls will receive io.EOF after all sent items. This is
- // an optional call - it's used by streaming clients that need the
- // server to receive the io.EOF terminator before the client calls
- // Finish (for example, if the client needs to continue receiving items
- // from the server after having finished sending).
- // Calls to Close after having called Cancel will fail.
- // Like Send, Close blocks when there's no buffer space available.
- Close() error
- }
-
- // Finish performs the equivalent of SendStream().Close, then blocks until the server
- // is done, and returns the positional return values for call.
- // If Cancel has been called, Finish will return immediately; the output of
- // Finish could either be an error signalling cancelation, or the correct
- // positional return values from the server depending on the timing of the
- // call.
- //
- // Calling Finish is mandatory for releasing stream resources, unless Cancel
- // has been called or any of the other methods return an error.
- // Finish should be called at most once.
- Finish() (reply _gen_vdlutil.Any, err error)
-
- // Cancel cancels the RPC, notifying the server to stop processing. It
- // is safe to call Cancel concurrently with any of the other stream methods.
- // Calling Cancel after Finish has returned is a no-op.
- Cancel()
-}
-
-type implViewerPipeStreamSender struct {
- clientCall _gen_ipc.Call
-}
-
-func (c *implViewerPipeStreamSender) Send(item []byte) error {
- return c.clientCall.Send(item)
-}
-
-func (c *implViewerPipeStreamSender) Close() error {
- return c.clientCall.CloseSend()
-}
-
-// Implementation of the ViewerPipeCall interface that is not exported.
-type implViewerPipeCall struct {
- clientCall _gen_ipc.Call
- writeStream implViewerPipeStreamSender
-}
-
-func (c *implViewerPipeCall) SendStream() interface {
- Send(item []byte) error
- Close() error
-} {
- return &c.writeStream
-}
-
-func (c *implViewerPipeCall) Finish() (reply _gen_vdlutil.Any, err error) {
- if ierr := c.clientCall.Finish(&reply, &err); ierr != nil {
- err = ierr
- }
- return
-}
-
-func (c *implViewerPipeCall) Cancel() {
- c.clientCall.Cancel()
-}
-
-type implViewerServicePipeStreamIterator struct {
- serverCall _gen_ipc.ServerCall
- val []byte
- err error
-}
-
-func (s *implViewerServicePipeStreamIterator) Advance() bool {
- s.err = s.serverCall.Recv(&s.val)
- return s.err == nil
-}
-
-func (s *implViewerServicePipeStreamIterator) Value() []byte {
- return s.val
-}
-
-func (s *implViewerServicePipeStreamIterator) Err() error {
- if s.err == _gen_io.EOF {
- return nil
- }
- return s.err
-}
-
-// ViewerServicePipeStream is the interface for streaming responses of the method
-// Pipe in the service interface Viewer.
-type ViewerServicePipeStream interface {
- // RecvStream returns the recv portion of the stream
- RecvStream() interface {
- // Advance stages an element so the client can retrieve it
- // with Value. Advance returns true iff there is an
- // element to retrieve. The client must call Advance before
- // calling Value. Advance may block if an element is not
- // immediately available.
- Advance() bool
-
- // Value returns the element that was staged by Advance.
- // Value may panic if Advance returned false or was not
- // called at all. Value does not block.
- Value() []byte
-
- // Err returns a non-nil error iff the stream encountered
- // any errors. Err does not block.
- Err() error
- }
-}
-
-// Implementation of the ViewerServicePipeStream interface that is not exported.
-type implViewerServicePipeStream struct {
- reader implViewerServicePipeStreamIterator
-}
-
-func (s *implViewerServicePipeStream) RecvStream() interface {
- // Advance stages an element so the client can retrieve it
- // with Value. Advance returns true iff there is an
- // element to retrieve. The client must call Advance before
- // calling Value. The client must call Cancel if it does
- // not iterate through all elements (i.e. until Advance
- // returns false). Advance may block if an element is not
- // immediately available.
- Advance() bool
-
- // Value returns the element that was staged by Advance.
- // Value may panic if Advance returned false or was not
- // called at all. Value does not block.
- Value() []byte
-
- // Err returns a non-nil error iff the stream encountered
- // any errors. Err does not block.
- Err() error
-} {
- return &s.reader
-}
-
-// BindViewer returns the client stub implementing the Viewer
-// interface.
-//
-// If no _gen_ipc.Client is specified, the default _gen_ipc.Client in the
-// global Runtime is used.
-func BindViewer(name string, opts ..._gen_ipc.BindOpt) (Viewer, error) {
- var client _gen_ipc.Client
- switch len(opts) {
- case 0:
- // Do nothing.
- case 1:
- if clientOpt, ok := opts[0].(_gen_ipc.Client); opts[0] == nil || ok {
- client = clientOpt
- } else {
- return nil, _gen_vdlutil.ErrUnrecognizedOption
- }
- default:
- return nil, _gen_vdlutil.ErrTooManyOptionsToBind
- }
- stub := &clientStubViewer{defaultClient: client, name: name}
-
- return stub, nil
-}
-
-// NewServerViewer creates a new server stub.
-//
-// It takes a regular server implementing the ViewerService
-// interface, and returns a new server stub.
-func NewServerViewer(server ViewerService) interface{} {
- return &ServerStubViewer{
- service: server,
- }
-}
-
-// clientStubViewer implements Viewer.
-type clientStubViewer struct {
- defaultClient _gen_ipc.Client
- name string
-}
-
-func (__gen_c *clientStubViewer) client(ctx _gen_context.T) _gen_ipc.Client {
- if __gen_c.defaultClient != nil {
- return __gen_c.defaultClient
- }
- return _gen_veyron2.RuntimeFromContext(ctx).Client()
-}
-
-func (__gen_c *clientStubViewer) Pipe(ctx _gen_context.T, opts ..._gen_ipc.CallOpt) (reply ViewerPipeCall, err error) {
- var call _gen_ipc.Call
- if call, err = __gen_c.client(ctx).StartCall(ctx, __gen_c.name, "Pipe", nil, opts...); err != nil {
- return
- }
- reply = &implViewerPipeCall{clientCall: call, writeStream: implViewerPipeStreamSender{clientCall: call}}
- return
-}
-
-func (__gen_c *clientStubViewer) UnresolveStep(ctx _gen_context.T, opts ..._gen_ipc.CallOpt) (reply []string, err error) {
- var call _gen_ipc.Call
- if call, err = __gen_c.client(ctx).StartCall(ctx, __gen_c.name, "UnresolveStep", nil, opts...); err != nil {
- return
- }
- if ierr := call.Finish(&reply, &err); ierr != nil {
- err = ierr
- }
- return
-}
-
-func (__gen_c *clientStubViewer) Signature(ctx _gen_context.T, opts ..._gen_ipc.CallOpt) (reply _gen_ipc.ServiceSignature, err error) {
- var call _gen_ipc.Call
- if call, err = __gen_c.client(ctx).StartCall(ctx, __gen_c.name, "Signature", nil, opts...); err != nil {
- return
- }
- if ierr := call.Finish(&reply, &err); ierr != nil {
- err = ierr
- }
- return
-}
-
-func (__gen_c *clientStubViewer) GetMethodTags(ctx _gen_context.T, method string, opts ..._gen_ipc.CallOpt) (reply []interface{}, err error) {
- var call _gen_ipc.Call
- if call, err = __gen_c.client(ctx).StartCall(ctx, __gen_c.name, "GetMethodTags", []interface{}{method}, opts...); err != nil {
- return
- }
- if ierr := call.Finish(&reply, &err); ierr != nil {
- err = ierr
- }
- return
-}
-
-// ServerStubViewer wraps a server that implements
-// ViewerService and provides an object that satisfies
-// the requirements of veyron2/ipc.ReflectInvoker.
-type ServerStubViewer struct {
- service ViewerService
-}
-
-func (__gen_s *ServerStubViewer) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
- // TODO(bprosnitz) GetMethodTags() will be replaces with Signature().
- // Note: This exhibits some weird behavior like returning a nil error if the method isn't found.
- // This will change when it is replaced with Signature().
- switch method {
- case "Pipe":
- return []interface{}{}, nil
- default:
- return nil, nil
- }
-}
-
-func (__gen_s *ServerStubViewer) Signature(call _gen_ipc.ServerCall) (_gen_ipc.ServiceSignature, error) {
- result := _gen_ipc.ServiceSignature{Methods: make(map[string]_gen_ipc.MethodSignature)}
- result.Methods["Pipe"] = _gen_ipc.MethodSignature{
- InArgs: []_gen_ipc.MethodArgument{},
- OutArgs: []_gen_ipc.MethodArgument{
- {Name: "", Type: 65},
- {Name: "", Type: 66},
- },
- InStream: 68,
- }
-
- result.TypeDefs = []_gen_vdlutil.Any{
- _gen_wiretype.NamedPrimitiveType{Type: 0x1, Name: "anydata", Tags: []string(nil)}, _gen_wiretype.NamedPrimitiveType{Type: 0x1, Name: "error", Tags: []string(nil)}, _gen_wiretype.NamedPrimitiveType{Type: 0x32, Name: "byte", Tags: []string(nil)}, _gen_wiretype.SliceType{Elem: 0x43, Name: "", Tags: []string(nil)}}
-
- return result, nil
-}
-
-func (__gen_s *ServerStubViewer) UnresolveStep(call _gen_ipc.ServerCall) (reply []string, err error) {
- if unresolver, ok := __gen_s.service.(_gen_ipc.Unresolver); ok {
- return unresolver.UnresolveStep(call)
- }
- if call.Server() == nil {
- return
- }
- var published []string
- if published, err = call.Server().Published(); err != nil || published == nil {
- return
- }
- reply = make([]string, len(published))
- for i, p := range published {
- reply[i] = _gen_naming.Join(p, call.Name())
- }
- return
-}
-
-func (__gen_s *ServerStubViewer) Pipe(call _gen_ipc.ServerCall) (reply _gen_vdlutil.Any, err error) {
- stream := &implViewerServicePipeStream{reader: implViewerServicePipeStreamIterator{serverCall: call}}
- reply, err = __gen_s.service.Pipe(call, stream)
- return
-}