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/profile/impl/impl_test.go b/tools/profile/impl/impl_test.go
index 4de7fa8..9435742 100644
--- a/tools/profile/impl/impl_test.go
+++ b/tools/profile/impl/impl_test.go
@@ -31,7 +31,7 @@
suffix string
}
-func (s *server) Label(ipc.Context) (string, error) {
+func (s *server) Label(ipc.ServerContext) (string, error) {
vlog.VI(2).Infof("%v.Label() was called", s.suffix)
if s.suffix != "exists" {
return "", fmt.Errorf("profile doesn't exist: %v", s.suffix)
@@ -39,7 +39,7 @@
return spec.Label, nil
}
-func (s *server) Description(ipc.Context) (string, error) {
+func (s *server) Description(ipc.ServerContext) (string, error) {
vlog.VI(2).Infof("%v.Description() was called", s.suffix)
if s.suffix != "exists" {
return "", fmt.Errorf("profile doesn't exist: %v", s.suffix)
@@ -47,7 +47,7 @@
return spec.Description, nil
}
-func (s *server) Specification(ipc.Context) (profile.Specification, error) {
+func (s *server) Specification(ipc.ServerContext) (profile.Specification, error) {
vlog.VI(2).Infof("%v.Specification() was called", s.suffix)
if s.suffix != "exists" {
return profile.Specification{}, fmt.Errorf("profile doesn't exist: %v", s.suffix)
@@ -55,12 +55,12 @@
return spec, nil
}
-func (s *server) Put(_ ipc.Context, _ profile.Specification) error {
+func (s *server) Put(_ ipc.ServerContext, _ profile.Specification) error {
vlog.VI(2).Infof("%v.Put() was called", s.suffix)
return nil
}
-func (s *server) Remove(ipc.Context) error {
+func (s *server) Remove(ipc.ServerContext) error {
vlog.VI(2).Infof("%v.Remove() was called", s.suffix)
if s.suffix != "exists" {
return fmt.Errorf("profile doesn't exist: %v", s.suffix)