all: Create a new client context parameter that will be the first argument of every RPC call.
The important changes are in:
veyron2/model.go
veyron2/ipc/model.go
Most of the rest is wiring. I assume you'll want to suggest alternte names for the new API methods, I figured I'd just send something out to get the conversation going. I've added TODO() as a placeholder. Everywhere that occurs further changes are required to find the proper context to pass through. I just wanted to limit this change somehow.
I'll take another pass at this, but I wanted to give you a chance to give early feedback.
Change-Id: I0c508a0352d1d72ec60dc715d396e8724de9ab91
diff --git a/tools/content/impl/impl_test.go b/tools/content/impl/impl_test.go
index e61e550..3bc79a8 100644
--- a/tools/content/impl/impl_test.go
+++ b/tools/content/impl/impl_test.go
@@ -24,7 +24,7 @@
suffix string
}
-func (s *server) Delete(ipc.Context) error {
+func (s *server) Delete(ipc.ServerContext) error {
vlog.VI(2).Infof("Delete() was called. suffix=%v", s.suffix)
if s.suffix != "exists" {
return fmt.Errorf("content doesn't exist: %v", s.suffix)
@@ -32,14 +32,14 @@
return nil
}
-func (s *server) Download(_ ipc.Context, stream content.ContentServiceDownloadStream) error {
+func (s *server) Download(_ ipc.ServerContext, stream content.ContentServiceDownloadStream) error {
vlog.VI(2).Infof("Download() was called. suffix=%v", s.suffix)
stream.Send([]byte("Hello"))
stream.Send([]byte("World"))
return nil
}
-func (s *server) Upload(_ ipc.Context, stream content.ContentServiceUploadStream) (string, error) {
+func (s *server) Upload(_ ipc.ServerContext, stream content.ContentServiceUploadStream) (string, error) {
vlog.VI(2).Infof("Upload() was called. suffix=%v", s.suffix)
for {
if _, err := stream.Recv(); err != nil {