ref: Make vdl generation use Call instead of Context.
MultiPart: 1/6
Change-Id: Ie739b6bc4540474c8ec11c92aa147ad9793293f4
diff --git a/cmd/binary/impl_test.go b/cmd/binary/impl_test.go
index 62a52a1..8348e19 100644
--- a/cmd/binary/impl_test.go
+++ b/cmd/binary/impl_test.go
@@ -42,9 +42,9 @@
return nil
}
-func (s *server) Download(ctx repository.BinaryDownloadContext, _ int32) error {
+func (s *server) Download(call repository.BinaryDownloadServerCall, _ int32) error {
vlog.Infof("Download() was called. suffix=%v", s.suffix)
- sender := ctx.SendStream()
+ sender := call.SendStream()
sender.Send([]byte("Hello"))
sender.Send([]byte("World"))
return nil
@@ -67,9 +67,9 @@
return []binary.PartInfo{part}, repository.MediaInfo{Type: "text/plain"}, nil
}
-func (s *server) Upload(ctx repository.BinaryUploadContext, _ int32) error {
+func (s *server) Upload(call repository.BinaryUploadServerCall, _ int32) error {
vlog.Infof("Upload() was called. suffix=%v", s.suffix)
- rStream := ctx.RecvStream()
+ rStream := call.RecvStream()
for rStream.Advance() {
}
return nil
diff --git a/cmd/build/impl_test.go b/cmd/build/impl_test.go
index 1213aef..347ceca 100644
--- a/cmd/build/impl_test.go
+++ b/cmd/build/impl_test.go
@@ -20,14 +20,14 @@
type mock struct{}
-func (mock) Build(ctx build.BuilderBuildContext, arch build.Architecture, opsys build.OperatingSystem) ([]byte, error) {
+func (mock) Build(call build.BuilderBuildServerCall, arch build.Architecture, opsys build.OperatingSystem) ([]byte, error) {
vlog.VI(2).Infof("Build(%v, %v) was called", arch, opsys)
- iterator := ctx.RecvStream()
+ iterator := call.RecvStream()
for iterator.Advance() {
}
if err := iterator.Err(); err != nil {
vlog.Errorf("Advance() failed: %v", err)
- return nil, verror.New(verror.ErrInternal, ctx.Context())
+ return nil, verror.New(verror.ErrInternal, call.Context())
}
return nil, nil
}
diff --git a/cmd/mgmt/device/impl/local_install.go b/cmd/mgmt/device/impl/local_install.go
index e07c3e4..1781dc5 100644
--- a/cmd/mgmt/device/impl/local_install.go
+++ b/cmd/mgmt/device/impl/local_install.go
@@ -135,7 +135,7 @@
return errNotImplemented
}
-func (i binaryInvoker) Download(ctx repository.BinaryDownloadContext, _ int32) error {
+func (i binaryInvoker) Download(call repository.BinaryDownloadServerCall, _ int32) error {
fileName := string(i)
file, err := os.Open(fileName)
if err != nil {
@@ -144,7 +144,7 @@
defer file.Close()
bufferLength := 4096
buffer := make([]byte, bufferLength)
- sender := ctx.SendStream()
+ sender := call.SendStream()
for {
n, err := file.Read(buffer)
switch err {
@@ -176,7 +176,7 @@
return []binary.PartInfo{part}, pkglib.MediaInfoForFileName(fileName), nil
}
-func (binaryInvoker) Upload(repository.BinaryUploadContext, int32) error {
+func (binaryInvoker) Upload(repository.BinaryUploadServerCall, int32) error {
return errNotImplemented
}
diff --git a/cmd/vdl/arith_test.go b/cmd/vdl/arith_test.go
index ddc636e..b54cdf9 100644
--- a/cmd/vdl/arith_test.go
+++ b/cmd/vdl/arith_test.go
@@ -51,24 +51,24 @@
return nestedArgs.Args.A * nestedArgs.Args.B, nil
}
-func (*serverArith) Count(ctx arith.ArithCountContext, start int32) error {
+func (*serverArith) Count(call arith.ArithCountServerCall, start int32) error {
const kNum = 1000
for i := int32(0); i < kNum; i++ {
- if err := ctx.SendStream().Send(start + i); err != nil {
+ if err := call.SendStream().Send(start + i); err != nil {
return err
}
}
return nil
}
-func (*serverArith) StreamingAdd(ctx arith.ArithStreamingAddContext) (int32, error) {
+func (*serverArith) StreamingAdd(call arith.ArithStreamingAddServerCall) (int32, error) {
var total int32
- for ctx.RecvStream().Advance() {
- value := ctx.RecvStream().Value()
+ for call.RecvStream().Advance() {
+ value := call.RecvStream().Value()
total += value
- ctx.SendStream().Send(total)
+ call.SendStream().Send(total)
}
- return total, ctx.RecvStream().Err()
+ return total, call.RecvStream().Err()
}
func (*serverArith) GenError(_ ipc.ServerCall) error {
diff --git a/cmd/vrpc/test_base/test_base.vdl.go b/cmd/vrpc/test_base/test_base.vdl.go
index c55bffd..b53a928 100644
--- a/cmd/vrpc/test_base/test_base.vdl.go
+++ b/cmd/vrpc/test_base/test_base.vdl.go
@@ -288,21 +288,21 @@
Value() bool
Err() error
} {
- return implTypeTesterZStreamCallRecv{c}
+ return implTypeTesterZStreamClientCallRecv{c}
}
-type implTypeTesterZStreamCallRecv struct {
+type implTypeTesterZStreamClientCallRecv struct {
c *implTypeTesterZStreamClientCall
}
-func (c implTypeTesterZStreamCallRecv) Advance() bool {
+func (c implTypeTesterZStreamClientCallRecv) Advance() bool {
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implTypeTesterZStreamCallRecv) Value() bool {
+func (c implTypeTesterZStreamClientCallRecv) Value() bool {
return c.c.valRecv
}
-func (c implTypeTesterZStreamCallRecv) Err() error {
+func (c implTypeTesterZStreamClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -320,26 +320,26 @@
// test Signature output, which sorts methods alphabetically.
type TypeTesterServerMethods interface {
// Methods to test support for primitive types.
- EchoBool(ctx ipc.ServerCall, I1 bool) (O1 bool, err error)
- EchoFloat32(ctx ipc.ServerCall, I1 float32) (O1 float32, err error)
- EchoFloat64(ctx ipc.ServerCall, I1 float64) (O1 float64, err error)
- EchoInt32(ctx ipc.ServerCall, I1 int32) (O1 int32, err error)
- EchoInt64(ctx ipc.ServerCall, I1 int64) (O1 int64, err error)
- EchoString(ctx ipc.ServerCall, I1 string) (O1 string, err error)
- EchoByte(ctx ipc.ServerCall, I1 byte) (O1 byte, err error)
- EchoUint32(ctx ipc.ServerCall, I1 uint32) (O1 uint32, err error)
- EchoUint64(ctx ipc.ServerCall, I1 uint64) (O1 uint64, err error)
+ EchoBool(call ipc.ServerCall, I1 bool) (O1 bool, err error)
+ EchoFloat32(call ipc.ServerCall, I1 float32) (O1 float32, err error)
+ EchoFloat64(call ipc.ServerCall, I1 float64) (O1 float64, err error)
+ EchoInt32(call ipc.ServerCall, I1 int32) (O1 int32, err error)
+ EchoInt64(call ipc.ServerCall, I1 int64) (O1 int64, err error)
+ EchoString(call ipc.ServerCall, I1 string) (O1 string, err error)
+ EchoByte(call ipc.ServerCall, I1 byte) (O1 byte, err error)
+ EchoUint32(call ipc.ServerCall, I1 uint32) (O1 uint32, err error)
+ EchoUint64(call ipc.ServerCall, I1 uint64) (O1 uint64, err error)
// Methods to test support for composite types.
- XEchoArray(ctx ipc.ServerCall, I1 Array2Int) (O1 Array2Int, err error)
- XEchoMap(ctx ipc.ServerCall, I1 map[int32]string) (O1 map[int32]string, err error)
- XEchoSet(ctx ipc.ServerCall, I1 map[int32]struct{}) (O1 map[int32]struct{}, err error)
- XEchoSlice(ctx ipc.ServerCall, I1 []int32) (O1 []int32, err error)
- XEchoStruct(ctx ipc.ServerCall, I1 Struct) (O1 Struct, err error)
+ XEchoArray(call ipc.ServerCall, I1 Array2Int) (O1 Array2Int, err error)
+ XEchoMap(call ipc.ServerCall, I1 map[int32]string) (O1 map[int32]string, err error)
+ XEchoSet(call ipc.ServerCall, I1 map[int32]struct{}) (O1 map[int32]struct{}, err error)
+ XEchoSlice(call ipc.ServerCall, I1 []int32) (O1 []int32, err error)
+ XEchoStruct(call ipc.ServerCall, I1 Struct) (O1 Struct, err error)
// Methods to test support for different number of arguments.
- YMultiArg(ctx ipc.ServerCall, I1 int32, I2 int32) (O1 int32, O2 int32, err error)
+ YMultiArg(call ipc.ServerCall, I1 int32, I2 int32) (O1 int32, O2 int32, err error)
YNoArgs(ipc.ServerCall) error
// Methods to test support for streaming.
- ZStream(ctx TypeTesterZStreamContext, NumStreamItems int32, StreamItem bool) error
+ ZStream(call TypeTesterZStreamServerCall, NumStreamItems int32, StreamItem bool) error
}
// TypeTesterServerStubMethods is the server interface containing
@@ -348,26 +348,26 @@
// is the streaming methods.
type TypeTesterServerStubMethods interface {
// Methods to test support for primitive types.
- EchoBool(ctx ipc.ServerCall, I1 bool) (O1 bool, err error)
- EchoFloat32(ctx ipc.ServerCall, I1 float32) (O1 float32, err error)
- EchoFloat64(ctx ipc.ServerCall, I1 float64) (O1 float64, err error)
- EchoInt32(ctx ipc.ServerCall, I1 int32) (O1 int32, err error)
- EchoInt64(ctx ipc.ServerCall, I1 int64) (O1 int64, err error)
- EchoString(ctx ipc.ServerCall, I1 string) (O1 string, err error)
- EchoByte(ctx ipc.ServerCall, I1 byte) (O1 byte, err error)
- EchoUint32(ctx ipc.ServerCall, I1 uint32) (O1 uint32, err error)
- EchoUint64(ctx ipc.ServerCall, I1 uint64) (O1 uint64, err error)
+ EchoBool(call ipc.ServerCall, I1 bool) (O1 bool, err error)
+ EchoFloat32(call ipc.ServerCall, I1 float32) (O1 float32, err error)
+ EchoFloat64(call ipc.ServerCall, I1 float64) (O1 float64, err error)
+ EchoInt32(call ipc.ServerCall, I1 int32) (O1 int32, err error)
+ EchoInt64(call ipc.ServerCall, I1 int64) (O1 int64, err error)
+ EchoString(call ipc.ServerCall, I1 string) (O1 string, err error)
+ EchoByte(call ipc.ServerCall, I1 byte) (O1 byte, err error)
+ EchoUint32(call ipc.ServerCall, I1 uint32) (O1 uint32, err error)
+ EchoUint64(call ipc.ServerCall, I1 uint64) (O1 uint64, err error)
// Methods to test support for composite types.
- XEchoArray(ctx ipc.ServerCall, I1 Array2Int) (O1 Array2Int, err error)
- XEchoMap(ctx ipc.ServerCall, I1 map[int32]string) (O1 map[int32]string, err error)
- XEchoSet(ctx ipc.ServerCall, I1 map[int32]struct{}) (O1 map[int32]struct{}, err error)
- XEchoSlice(ctx ipc.ServerCall, I1 []int32) (O1 []int32, err error)
- XEchoStruct(ctx ipc.ServerCall, I1 Struct) (O1 Struct, err error)
+ XEchoArray(call ipc.ServerCall, I1 Array2Int) (O1 Array2Int, err error)
+ XEchoMap(call ipc.ServerCall, I1 map[int32]string) (O1 map[int32]string, err error)
+ XEchoSet(call ipc.ServerCall, I1 map[int32]struct{}) (O1 map[int32]struct{}, err error)
+ XEchoSlice(call ipc.ServerCall, I1 []int32) (O1 []int32, err error)
+ XEchoStruct(call ipc.ServerCall, I1 Struct) (O1 Struct, err error)
// Methods to test support for different number of arguments.
- YMultiArg(ctx ipc.ServerCall, I1 int32, I2 int32) (O1 int32, O2 int32, err error)
+ YMultiArg(call ipc.ServerCall, I1 int32, I2 int32) (O1 int32, O2 int32, err error)
YNoArgs(ipc.ServerCall) error
// Methods to test support for streaming.
- ZStream(ctx *TypeTesterZStreamContextStub, NumStreamItems int32, StreamItem bool) error
+ ZStream(call *TypeTesterZStreamServerCallStub, NumStreamItems int32, StreamItem bool) error
}
// TypeTesterServerStub adds universal methods to TypeTesterServerStubMethods.
@@ -399,72 +399,72 @@
gs *ipc.GlobState
}
-func (s implTypeTesterServerStub) EchoBool(ctx ipc.ServerCall, i0 bool) (bool, error) {
- return s.impl.EchoBool(ctx, i0)
+func (s implTypeTesterServerStub) EchoBool(call ipc.ServerCall, i0 bool) (bool, error) {
+ return s.impl.EchoBool(call, i0)
}
-func (s implTypeTesterServerStub) EchoFloat32(ctx ipc.ServerCall, i0 float32) (float32, error) {
- return s.impl.EchoFloat32(ctx, i0)
+func (s implTypeTesterServerStub) EchoFloat32(call ipc.ServerCall, i0 float32) (float32, error) {
+ return s.impl.EchoFloat32(call, i0)
}
-func (s implTypeTesterServerStub) EchoFloat64(ctx ipc.ServerCall, i0 float64) (float64, error) {
- return s.impl.EchoFloat64(ctx, i0)
+func (s implTypeTesterServerStub) EchoFloat64(call ipc.ServerCall, i0 float64) (float64, error) {
+ return s.impl.EchoFloat64(call, i0)
}
-func (s implTypeTesterServerStub) EchoInt32(ctx ipc.ServerCall, i0 int32) (int32, error) {
- return s.impl.EchoInt32(ctx, i0)
+func (s implTypeTesterServerStub) EchoInt32(call ipc.ServerCall, i0 int32) (int32, error) {
+ return s.impl.EchoInt32(call, i0)
}
-func (s implTypeTesterServerStub) EchoInt64(ctx ipc.ServerCall, i0 int64) (int64, error) {
- return s.impl.EchoInt64(ctx, i0)
+func (s implTypeTesterServerStub) EchoInt64(call ipc.ServerCall, i0 int64) (int64, error) {
+ return s.impl.EchoInt64(call, i0)
}
-func (s implTypeTesterServerStub) EchoString(ctx ipc.ServerCall, i0 string) (string, error) {
- return s.impl.EchoString(ctx, i0)
+func (s implTypeTesterServerStub) EchoString(call ipc.ServerCall, i0 string) (string, error) {
+ return s.impl.EchoString(call, i0)
}
-func (s implTypeTesterServerStub) EchoByte(ctx ipc.ServerCall, i0 byte) (byte, error) {
- return s.impl.EchoByte(ctx, i0)
+func (s implTypeTesterServerStub) EchoByte(call ipc.ServerCall, i0 byte) (byte, error) {
+ return s.impl.EchoByte(call, i0)
}
-func (s implTypeTesterServerStub) EchoUint32(ctx ipc.ServerCall, i0 uint32) (uint32, error) {
- return s.impl.EchoUint32(ctx, i0)
+func (s implTypeTesterServerStub) EchoUint32(call ipc.ServerCall, i0 uint32) (uint32, error) {
+ return s.impl.EchoUint32(call, i0)
}
-func (s implTypeTesterServerStub) EchoUint64(ctx ipc.ServerCall, i0 uint64) (uint64, error) {
- return s.impl.EchoUint64(ctx, i0)
+func (s implTypeTesterServerStub) EchoUint64(call ipc.ServerCall, i0 uint64) (uint64, error) {
+ return s.impl.EchoUint64(call, i0)
}
-func (s implTypeTesterServerStub) XEchoArray(ctx ipc.ServerCall, i0 Array2Int) (Array2Int, error) {
- return s.impl.XEchoArray(ctx, i0)
+func (s implTypeTesterServerStub) XEchoArray(call ipc.ServerCall, i0 Array2Int) (Array2Int, error) {
+ return s.impl.XEchoArray(call, i0)
}
-func (s implTypeTesterServerStub) XEchoMap(ctx ipc.ServerCall, i0 map[int32]string) (map[int32]string, error) {
- return s.impl.XEchoMap(ctx, i0)
+func (s implTypeTesterServerStub) XEchoMap(call ipc.ServerCall, i0 map[int32]string) (map[int32]string, error) {
+ return s.impl.XEchoMap(call, i0)
}
-func (s implTypeTesterServerStub) XEchoSet(ctx ipc.ServerCall, i0 map[int32]struct{}) (map[int32]struct{}, error) {
- return s.impl.XEchoSet(ctx, i0)
+func (s implTypeTesterServerStub) XEchoSet(call ipc.ServerCall, i0 map[int32]struct{}) (map[int32]struct{}, error) {
+ return s.impl.XEchoSet(call, i0)
}
-func (s implTypeTesterServerStub) XEchoSlice(ctx ipc.ServerCall, i0 []int32) ([]int32, error) {
- return s.impl.XEchoSlice(ctx, i0)
+func (s implTypeTesterServerStub) XEchoSlice(call ipc.ServerCall, i0 []int32) ([]int32, error) {
+ return s.impl.XEchoSlice(call, i0)
}
-func (s implTypeTesterServerStub) XEchoStruct(ctx ipc.ServerCall, i0 Struct) (Struct, error) {
- return s.impl.XEchoStruct(ctx, i0)
+func (s implTypeTesterServerStub) XEchoStruct(call ipc.ServerCall, i0 Struct) (Struct, error) {
+ return s.impl.XEchoStruct(call, i0)
}
-func (s implTypeTesterServerStub) YMultiArg(ctx ipc.ServerCall, i0 int32, i1 int32) (int32, int32, error) {
- return s.impl.YMultiArg(ctx, i0, i1)
+func (s implTypeTesterServerStub) YMultiArg(call ipc.ServerCall, i0 int32, i1 int32) (int32, int32, error) {
+ return s.impl.YMultiArg(call, i0, i1)
}
-func (s implTypeTesterServerStub) YNoArgs(ctx ipc.ServerCall) error {
- return s.impl.YNoArgs(ctx)
+func (s implTypeTesterServerStub) YNoArgs(call ipc.ServerCall) error {
+ return s.impl.YNoArgs(call)
}
-func (s implTypeTesterServerStub) ZStream(ctx *TypeTesterZStreamContextStub, i0 int32, i1 bool) error {
- return s.impl.ZStream(ctx, i0, i1)
+func (s implTypeTesterServerStub) ZStream(call *TypeTesterZStreamServerCallStub, i0 int32, i1 bool) error {
+ return s.impl.ZStream(call, i0, i1)
}
func (s implTypeTesterServerStub) Globber() *ipc.GlobState {
@@ -649,34 +649,34 @@
}
}
-// TypeTesterZStreamContext represents the context passed to TypeTester.ZStream.
-type TypeTesterZStreamContext interface {
+// TypeTesterZStreamServerCall represents the context passed to TypeTester.ZStream.
+type TypeTesterZStreamServerCall interface {
ipc.ServerCall
TypeTesterZStreamServerStream
}
-// TypeTesterZStreamContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements TypeTesterZStreamContext.
-type TypeTesterZStreamContextStub struct {
+// TypeTesterZStreamServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements TypeTesterZStreamServerCall.
+type TypeTesterZStreamServerCallStub struct {
ipc.StreamServerCall
}
-// Init initializes TypeTesterZStreamContextStub from ipc.StreamServerCall.
-func (s *TypeTesterZStreamContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes TypeTesterZStreamServerCallStub from ipc.StreamServerCall.
+func (s *TypeTesterZStreamServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// SendStream returns the send side of the TypeTester.ZStream server stream.
-func (s *TypeTesterZStreamContextStub) SendStream() interface {
+func (s *TypeTesterZStreamServerCallStub) SendStream() interface {
Send(item bool) error
} {
- return implTypeTesterZStreamContextSend{s}
+ return implTypeTesterZStreamServerCallSend{s}
}
-type implTypeTesterZStreamContextSend struct {
- s *TypeTesterZStreamContextStub
+type implTypeTesterZStreamServerCallSend struct {
+ s *TypeTesterZStreamServerCallStub
}
-func (s implTypeTesterZStreamContextSend) Send(item bool) error {
+func (s implTypeTesterZStreamServerCallSend) Send(item bool) error {
return s.s.Send(item)
}
diff --git a/cmd/vrpc/vrpc_test.go b/cmd/vrpc/vrpc_test.go
index 2b442ae..0c98bc1 100644
--- a/cmd/vrpc/vrpc_test.go
+++ b/cmd/vrpc/vrpc_test.go
@@ -98,9 +98,9 @@
return nil
}
-func (*server) ZStream(ctx test_base.TypeTesterZStreamContext, nStream int32, item bool) error {
+func (*server) ZStream(call test_base.TypeTesterZStreamServerCall, nStream int32, item bool) error {
vlog.VI(2).Info("ZStream(%v,%v) was called.", nStream, item)
- sender := ctx.SendStream()
+ sender := call.SendStream()
for i := int32(0); i < nStream; i++ {
sender.Send(item)
}
diff --git a/examples/rps/rpsbot/impl.go b/examples/rps/rpsbot/impl.go
index 15310b4..7fb6d02 100644
--- a/examples/rps/rpsbot/impl.go
+++ b/examples/rps/rpsbot/impl.go
@@ -46,13 +46,13 @@
return r.judge.createGame(names[0], opts)
}
-func (r *RPS) Play(ctx rps.JudgePlayContext, id rps.GameID) (rps.PlayResult, error) {
- names, _ := ctx.RemoteBlessings().ForCall(ctx)
+func (r *RPS) Play(call rps.JudgePlayServerCall, id rps.GameID) (rps.PlayResult, error) {
+ names, _ := call.RemoteBlessings().ForCall(call)
vlog.VI(1).Infof("Play %+v from %v", id, names)
if len(names) == 0 {
return rps.PlayResult{}, errors.New("no names provided for context")
}
- return r.judge.play(ctx, names[0], id)
+ return r.judge.play(call, names[0], id)
}
func (r *RPS) Challenge(call ipc.ServerCall, address string, id rps.GameID, opts rps.GameOptions) error {
diff --git a/examples/rps/rpsbot/judge.go b/examples/rps/rpsbot/judge.go
index d430507..6eec5e3 100644
--- a/examples/rps/rpsbot/judge.go
+++ b/examples/rps/rpsbot/judge.go
@@ -109,7 +109,7 @@
}
// play interacts with a player for the duration of a game.
-func (j *Judge) play(ctx rps.JudgePlayContext, name string, id rps.GameID) (rps.PlayResult, error) {
+func (j *Judge) play(call rps.JudgePlayServerCall, name string, id rps.GameID) (rps.PlayResult, error) {
vlog.VI(1).Infof("play from %q for %v", name, id)
nilResult := rps.PlayResult{}
@@ -117,7 +117,7 @@
if err != nil {
return nilResult, err
}
- playerNum, err := j.addPlayer(name, id, ctx)
+ playerNum, err := j.addPlayer(name, id, call)
if err != nil {
return nilResult, err
}
@@ -127,7 +127,7 @@
done := make(chan struct{})
defer close(done)
go func() {
- rStream := ctx.RecvStream()
+ rStream := call.RecvStream()
for rStream.Advance() {
action := rStream.Value()
select {
@@ -144,7 +144,7 @@
// Send all the output to the user.
go func() {
for packet := range pOut[playerNum-1] {
- if err := ctx.SendStream().Send(packet); err != nil {
+ if err := call.SendStream().Send(packet); err != nil {
vlog.Infof("error sending to player stream: %v", err)
}
}
@@ -155,7 +155,7 @@
// When the second player connects, we start the game.
if playerNum == 2 {
- go j.manageGame(ctx.Context(), id)
+ go j.manageGame(call.Context(), id)
}
// Wait for the ScoreCard.
scoreData := <-s
diff --git a/examples/rps/service.vdl.go b/examples/rps/service.vdl.go
index 387263f..b3f6829 100644
--- a/examples/rps/service.vdl.go
+++ b/examples/rps/service.vdl.go
@@ -359,21 +359,21 @@
Value() JudgeAction
Err() error
} {
- return implJudgePlayCallRecv{c}
+ return implJudgePlayClientCallRecv{c}
}
-type implJudgePlayCallRecv struct {
+type implJudgePlayClientCallRecv struct {
c *implJudgePlayClientCall
}
-func (c implJudgePlayCallRecv) Advance() bool {
+func (c implJudgePlayClientCallRecv) Advance() bool {
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implJudgePlayCallRecv) Value() JudgeAction {
+func (c implJudgePlayClientCallRecv) Value() JudgeAction {
return c.c.valRecv
}
-func (c implJudgePlayCallRecv) Err() error {
+func (c implJudgePlayClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -383,17 +383,17 @@
Send(item PlayerAction) error
Close() error
} {
- return implJudgePlayCallSend{c}
+ return implJudgePlayClientCallSend{c}
}
-type implJudgePlayCallSend struct {
+type implJudgePlayClientCallSend struct {
c *implJudgePlayClientCall
}
-func (c implJudgePlayCallSend) Send(item PlayerAction) error {
+func (c implJudgePlayClientCallSend) Send(item PlayerAction) error {
return c.c.Send(item)
}
-func (c implJudgePlayCallSend) Close() error {
+func (c implJudgePlayClientCallSend) Close() error {
return c.c.CloseSend()
}
func (c *implJudgePlayClientCall) Finish() (o0 PlayResult, err error) {
@@ -406,9 +406,9 @@
type JudgeServerMethods interface {
// CreateGame creates a new game with the given game options and returns a game
// identifier that can be used by the players to join the game.
- CreateGame(ctx ipc.ServerCall, Opts GameOptions) (GameID, error)
+ CreateGame(call ipc.ServerCall, Opts GameOptions) (GameID, error)
// Play lets a player join an existing game and play.
- Play(ctx JudgePlayContext, ID GameID) (PlayResult, error)
+ Play(call JudgePlayServerCall, ID GameID) (PlayResult, error)
}
// JudgeServerStubMethods is the server interface containing
@@ -418,9 +418,9 @@
type JudgeServerStubMethods interface {
// CreateGame creates a new game with the given game options and returns a game
// identifier that can be used by the players to join the game.
- CreateGame(ctx ipc.ServerCall, Opts GameOptions) (GameID, error)
+ CreateGame(call ipc.ServerCall, Opts GameOptions) (GameID, error)
// Play lets a player join an existing game and play.
- Play(ctx *JudgePlayContextStub, ID GameID) (PlayResult, error)
+ Play(call *JudgePlayServerCallStub, ID GameID) (PlayResult, error)
}
// JudgeServerStub adds universal methods to JudgeServerStubMethods.
@@ -452,12 +452,12 @@
gs *ipc.GlobState
}
-func (s implJudgeServerStub) CreateGame(ctx ipc.ServerCall, i0 GameOptions) (GameID, error) {
- return s.impl.CreateGame(ctx, i0)
+func (s implJudgeServerStub) CreateGame(call ipc.ServerCall, i0 GameOptions) (GameID, error) {
+ return s.impl.CreateGame(call, i0)
}
-func (s implJudgeServerStub) Play(ctx *JudgePlayContextStub, i0 GameID) (PlayResult, error) {
- return s.impl.Play(ctx, i0)
+func (s implJudgeServerStub) Play(call *JudgePlayServerCallStub, i0 GameID) (PlayResult, error) {
+ return s.impl.Play(call, i0)
}
func (s implJudgeServerStub) Globber() *ipc.GlobState {
@@ -524,46 +524,46 @@
}
}
-// JudgePlayContext represents the context passed to Judge.Play.
-type JudgePlayContext interface {
+// JudgePlayServerCall represents the context passed to Judge.Play.
+type JudgePlayServerCall interface {
ipc.ServerCall
JudgePlayServerStream
}
-// JudgePlayContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements JudgePlayContext.
-type JudgePlayContextStub struct {
+// JudgePlayServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements JudgePlayServerCall.
+type JudgePlayServerCallStub struct {
ipc.StreamServerCall
valRecv PlayerAction
errRecv error
}
-// Init initializes JudgePlayContextStub from ipc.StreamServerCall.
-func (s *JudgePlayContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes JudgePlayServerCallStub from ipc.StreamServerCall.
+func (s *JudgePlayServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// RecvStream returns the receiver side of the Judge.Play server stream.
-func (s *JudgePlayContextStub) RecvStream() interface {
+func (s *JudgePlayServerCallStub) RecvStream() interface {
Advance() bool
Value() PlayerAction
Err() error
} {
- return implJudgePlayContextRecv{s}
+ return implJudgePlayServerCallRecv{s}
}
-type implJudgePlayContextRecv struct {
- s *JudgePlayContextStub
+type implJudgePlayServerCallRecv struct {
+ s *JudgePlayServerCallStub
}
-func (s implJudgePlayContextRecv) Advance() bool {
+func (s implJudgePlayServerCallRecv) Advance() bool {
s.s.errRecv = s.s.Recv(&s.s.valRecv)
return s.s.errRecv == nil
}
-func (s implJudgePlayContextRecv) Value() PlayerAction {
+func (s implJudgePlayServerCallRecv) Value() PlayerAction {
return s.s.valRecv
}
-func (s implJudgePlayContextRecv) Err() error {
+func (s implJudgePlayServerCallRecv) Err() error {
if s.s.errRecv == io.EOF {
return nil
}
@@ -571,17 +571,17 @@
}
// SendStream returns the send side of the Judge.Play server stream.
-func (s *JudgePlayContextStub) SendStream() interface {
+func (s *JudgePlayServerCallStub) SendStream() interface {
Send(item JudgeAction) error
} {
- return implJudgePlayContextSend{s}
+ return implJudgePlayServerCallSend{s}
}
-type implJudgePlayContextSend struct {
- s *JudgePlayContextStub
+type implJudgePlayServerCallSend struct {
+ s *JudgePlayServerCallStub
}
-func (s implJudgePlayContextSend) Send(item JudgeAction) error {
+func (s implJudgePlayServerCallSend) Send(item JudgeAction) error {
return s.s.Send(item)
}
@@ -640,7 +640,7 @@
type PlayerServerMethods interface {
// Challenge is used by other players to challenge this player to a game. If
// the challenge is accepted, the method returns nil.
- Challenge(ctx ipc.ServerCall, Address string, ID GameID, Opts GameOptions) error
+ Challenge(call ipc.ServerCall, Address string, ID GameID, Opts GameOptions) error
}
// PlayerServerStubMethods is the server interface containing
@@ -678,8 +678,8 @@
gs *ipc.GlobState
}
-func (s implPlayerServerStub) Challenge(ctx ipc.ServerCall, i0 string, i1 GameID, i2 GameOptions) error {
- return s.impl.Challenge(ctx, i0, i1, i2)
+func (s implPlayerServerStub) Challenge(call ipc.ServerCall, i0 string, i1 GameID, i2 GameOptions) error {
+ return s.impl.Challenge(call, i0, i1, i2)
}
func (s implPlayerServerStub) Globber() *ipc.GlobState {
@@ -763,7 +763,7 @@
//
// ScoreKeeper receives the outcome of games from Judges.
type ScoreKeeperServerMethods interface {
- Record(ctx ipc.ServerCall, Score ScoreCard) error
+ Record(call ipc.ServerCall, Score ScoreCard) error
}
// ScoreKeeperServerStubMethods is the server interface containing
@@ -801,8 +801,8 @@
gs *ipc.GlobState
}
-func (s implScoreKeeperServerStub) Record(ctx ipc.ServerCall, i0 ScoreCard) error {
- return s.impl.Record(ctx, i0)
+func (s implScoreKeeperServerStub) Record(call ipc.ServerCall, i0 ScoreCard) error {
+ return s.impl.Record(call, i0)
}
func (s implScoreKeeperServerStub) Globber() *ipc.GlobState {
diff --git a/examples/tunnel/tunnel.vdl.go b/examples/tunnel/tunnel.vdl.go
index 2cd988e..b226941 100644
--- a/examples/tunnel/tunnel.vdl.go
+++ b/examples/tunnel/tunnel.vdl.go
@@ -270,21 +270,21 @@
Value() []byte
Err() error
} {
- return implTunnelForwardCallRecv{c}
+ return implTunnelForwardClientCallRecv{c}
}
-type implTunnelForwardCallRecv struct {
+type implTunnelForwardClientCallRecv struct {
c *implTunnelForwardClientCall
}
-func (c implTunnelForwardCallRecv) Advance() bool {
+func (c implTunnelForwardClientCallRecv) Advance() bool {
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implTunnelForwardCallRecv) Value() []byte {
+func (c implTunnelForwardClientCallRecv) Value() []byte {
return c.c.valRecv
}
-func (c implTunnelForwardCallRecv) Err() error {
+func (c implTunnelForwardClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -294,17 +294,17 @@
Send(item []byte) error
Close() error
} {
- return implTunnelForwardCallSend{c}
+ return implTunnelForwardClientCallSend{c}
}
-type implTunnelForwardCallSend struct {
+type implTunnelForwardClientCallSend struct {
c *implTunnelForwardClientCall
}
-func (c implTunnelForwardCallSend) Send(item []byte) error {
+func (c implTunnelForwardClientCallSend) Send(item []byte) error {
return c.c.Send(item)
}
-func (c implTunnelForwardCallSend) Close() error {
+func (c implTunnelForwardClientCallSend) Close() error {
return c.c.CloseSend()
}
func (c *implTunnelForwardClientCall) Finish() (err error) {
@@ -372,21 +372,21 @@
Value() ServerShellPacket
Err() error
} {
- return implTunnelShellCallRecv{c}
+ return implTunnelShellClientCallRecv{c}
}
-type implTunnelShellCallRecv struct {
+type implTunnelShellClientCallRecv struct {
c *implTunnelShellClientCall
}
-func (c implTunnelShellCallRecv) Advance() bool {
+func (c implTunnelShellClientCallRecv) Advance() bool {
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implTunnelShellCallRecv) Value() ServerShellPacket {
+func (c implTunnelShellClientCallRecv) Value() ServerShellPacket {
return c.c.valRecv
}
-func (c implTunnelShellCallRecv) Err() error {
+func (c implTunnelShellClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -396,17 +396,17 @@
Send(item ClientShellPacket) error
Close() error
} {
- return implTunnelShellCallSend{c}
+ return implTunnelShellClientCallSend{c}
}
-type implTunnelShellCallSend struct {
+type implTunnelShellClientCallSend struct {
c *implTunnelShellClientCall
}
-func (c implTunnelShellCallSend) Send(item ClientShellPacket) error {
+func (c implTunnelShellClientCallSend) Send(item ClientShellPacket) error {
return c.c.Send(item)
}
-func (c implTunnelShellCallSend) Close() error {
+func (c implTunnelShellClientCallSend) Close() error {
return c.c.CloseSend()
}
func (c *implTunnelShellClientCall) Finish() (o0 int32, err error) {
@@ -421,13 +421,13 @@
// the byte stream is forwarded to the requested network address and all the
// data received from that network connection is sent back in the reply
// stream.
- Forward(ctx TunnelForwardContext, network string, address string) error
+ Forward(call TunnelForwardServerCall, network string, address string) error
// The Shell method is used to either run shell commands remotely, or to open
// an interactive shell. The data received over the byte stream is sent to the
// shell's stdin, and the data received from the shell's stdout and stderr is
// sent back in the reply stream. It returns the exit status of the shell
// command.
- Shell(ctx TunnelShellContext, command string, shellOpts ShellOpts) (int32, error)
+ Shell(call TunnelShellServerCall, command string, shellOpts ShellOpts) (int32, error)
}
// TunnelServerStubMethods is the server interface containing
@@ -439,13 +439,13 @@
// the byte stream is forwarded to the requested network address and all the
// data received from that network connection is sent back in the reply
// stream.
- Forward(ctx *TunnelForwardContextStub, network string, address string) error
+ Forward(call *TunnelForwardServerCallStub, network string, address string) error
// The Shell method is used to either run shell commands remotely, or to open
// an interactive shell. The data received over the byte stream is sent to the
// shell's stdin, and the data received from the shell's stdout and stderr is
// sent back in the reply stream. It returns the exit status of the shell
// command.
- Shell(ctx *TunnelShellContextStub, command string, shellOpts ShellOpts) (int32, error)
+ Shell(call *TunnelShellServerCallStub, command string, shellOpts ShellOpts) (int32, error)
}
// TunnelServerStub adds universal methods to TunnelServerStubMethods.
@@ -477,12 +477,12 @@
gs *ipc.GlobState
}
-func (s implTunnelServerStub) Forward(ctx *TunnelForwardContextStub, i0 string, i1 string) error {
- return s.impl.Forward(ctx, i0, i1)
+func (s implTunnelServerStub) Forward(call *TunnelForwardServerCallStub, i0 string, i1 string) error {
+ return s.impl.Forward(call, i0, i1)
}
-func (s implTunnelServerStub) Shell(ctx *TunnelShellContextStub, i0 string, i1 ShellOpts) (int32, error) {
- return s.impl.Shell(ctx, i0, i1)
+func (s implTunnelServerStub) Shell(call *TunnelShellServerCallStub, i0 string, i1 ShellOpts) (int32, error) {
+ return s.impl.Shell(call, i0, i1)
}
func (s implTunnelServerStub) Globber() *ipc.GlobState {
@@ -548,46 +548,46 @@
}
}
-// TunnelForwardContext represents the context passed to Tunnel.Forward.
-type TunnelForwardContext interface {
+// TunnelForwardServerCall represents the context passed to Tunnel.Forward.
+type TunnelForwardServerCall interface {
ipc.ServerCall
TunnelForwardServerStream
}
-// TunnelForwardContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements TunnelForwardContext.
-type TunnelForwardContextStub struct {
+// TunnelForwardServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements TunnelForwardServerCall.
+type TunnelForwardServerCallStub struct {
ipc.StreamServerCall
valRecv []byte
errRecv error
}
-// Init initializes TunnelForwardContextStub from ipc.StreamServerCall.
-func (s *TunnelForwardContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes TunnelForwardServerCallStub from ipc.StreamServerCall.
+func (s *TunnelForwardServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// RecvStream returns the receiver side of the Tunnel.Forward server stream.
-func (s *TunnelForwardContextStub) RecvStream() interface {
+func (s *TunnelForwardServerCallStub) RecvStream() interface {
Advance() bool
Value() []byte
Err() error
} {
- return implTunnelForwardContextRecv{s}
+ return implTunnelForwardServerCallRecv{s}
}
-type implTunnelForwardContextRecv struct {
- s *TunnelForwardContextStub
+type implTunnelForwardServerCallRecv struct {
+ s *TunnelForwardServerCallStub
}
-func (s implTunnelForwardContextRecv) Advance() bool {
+func (s implTunnelForwardServerCallRecv) Advance() bool {
s.s.errRecv = s.s.Recv(&s.s.valRecv)
return s.s.errRecv == nil
}
-func (s implTunnelForwardContextRecv) Value() []byte {
+func (s implTunnelForwardServerCallRecv) Value() []byte {
return s.s.valRecv
}
-func (s implTunnelForwardContextRecv) Err() error {
+func (s implTunnelForwardServerCallRecv) Err() error {
if s.s.errRecv == io.EOF {
return nil
}
@@ -595,17 +595,17 @@
}
// SendStream returns the send side of the Tunnel.Forward server stream.
-func (s *TunnelForwardContextStub) SendStream() interface {
+func (s *TunnelForwardServerCallStub) SendStream() interface {
Send(item []byte) error
} {
- return implTunnelForwardContextSend{s}
+ return implTunnelForwardServerCallSend{s}
}
-type implTunnelForwardContextSend struct {
- s *TunnelForwardContextStub
+type implTunnelForwardServerCallSend struct {
+ s *TunnelForwardServerCallStub
}
-func (s implTunnelForwardContextSend) Send(item []byte) error {
+func (s implTunnelForwardServerCallSend) Send(item []byte) error {
return s.s.Send(item)
}
@@ -632,46 +632,46 @@
}
}
-// TunnelShellContext represents the context passed to Tunnel.Shell.
-type TunnelShellContext interface {
+// TunnelShellServerCall represents the context passed to Tunnel.Shell.
+type TunnelShellServerCall interface {
ipc.ServerCall
TunnelShellServerStream
}
-// TunnelShellContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements TunnelShellContext.
-type TunnelShellContextStub struct {
+// TunnelShellServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements TunnelShellServerCall.
+type TunnelShellServerCallStub struct {
ipc.StreamServerCall
valRecv ClientShellPacket
errRecv error
}
-// Init initializes TunnelShellContextStub from ipc.StreamServerCall.
-func (s *TunnelShellContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes TunnelShellServerCallStub from ipc.StreamServerCall.
+func (s *TunnelShellServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// RecvStream returns the receiver side of the Tunnel.Shell server stream.
-func (s *TunnelShellContextStub) RecvStream() interface {
+func (s *TunnelShellServerCallStub) RecvStream() interface {
Advance() bool
Value() ClientShellPacket
Err() error
} {
- return implTunnelShellContextRecv{s}
+ return implTunnelShellServerCallRecv{s}
}
-type implTunnelShellContextRecv struct {
- s *TunnelShellContextStub
+type implTunnelShellServerCallRecv struct {
+ s *TunnelShellServerCallStub
}
-func (s implTunnelShellContextRecv) Advance() bool {
+func (s implTunnelShellServerCallRecv) Advance() bool {
s.s.errRecv = s.s.Recv(&s.s.valRecv)
return s.s.errRecv == nil
}
-func (s implTunnelShellContextRecv) Value() ClientShellPacket {
+func (s implTunnelShellServerCallRecv) Value() ClientShellPacket {
return s.s.valRecv
}
-func (s implTunnelShellContextRecv) Err() error {
+func (s implTunnelShellServerCallRecv) Err() error {
if s.s.errRecv == io.EOF {
return nil
}
@@ -679,16 +679,16 @@
}
// SendStream returns the send side of the Tunnel.Shell server stream.
-func (s *TunnelShellContextStub) SendStream() interface {
+func (s *TunnelShellServerCallStub) SendStream() interface {
Send(item ServerShellPacket) error
} {
- return implTunnelShellContextSend{s}
+ return implTunnelShellServerCallSend{s}
}
-type implTunnelShellContextSend struct {
- s *TunnelShellContextStub
+type implTunnelShellServerCallSend struct {
+ s *TunnelShellServerCallStub
}
-func (s implTunnelShellContextSend) Send(item ServerShellPacket) error {
+func (s implTunnelShellServerCallSend) Send(item ServerShellPacket) error {
return s.s.Send(item)
}
diff --git a/examples/tunnel/tunneld/impl.go b/examples/tunnel/tunneld/impl.go
index c2516fb..48231aa 100644
--- a/examples/tunnel/tunneld/impl.go
+++ b/examples/tunnel/tunneld/impl.go
@@ -23,21 +23,21 @@
const nonShellErrorCode = 255
-func (t *T) Forward(ctx tunnel.TunnelForwardContext, network, address string) error {
+func (t *T) Forward(call tunnel.TunnelForwardServerCall, network, address string) error {
conn, err := net.Dial(network, address)
if err != nil {
return err
}
- b, _ := ctx.RemoteBlessings().ForCall(ctx)
+ b, _ := call.RemoteBlessings().ForCall(call)
name := fmt.Sprintf("RemoteBlessings:%v LocalAddr:%v RemoteAddr:%v", b, conn.LocalAddr(), conn.RemoteAddr())
vlog.Infof("TUNNEL START: %v", name)
- err = tunnelutil.Forward(conn, ctx.SendStream(), ctx.RecvStream())
+ err = tunnelutil.Forward(conn, call.SendStream(), call.RecvStream())
vlog.Infof("TUNNEL END : %v (%v)", name, err)
return err
}
-func (t *T) Shell(ctx tunnel.TunnelShellContext, command string, shellOpts tunnel.ShellOpts) (int32, error) {
- b, _ := ctx.RemoteBlessings().ForCall(ctx)
+func (t *T) Shell(call tunnel.TunnelShellServerCall, command string, shellOpts tunnel.ShellOpts) (int32, error) {
+ b, _ := call.RemoteBlessings().ForCall(call)
vlog.Infof("SHELL START for %v: %q", b, command)
shell, err := findShell()
if err != nil {
@@ -47,7 +47,7 @@
// An empty command means that we need an interactive shell.
if len(command) == 0 {
c = exec.Command(shell, "-i")
- sendMotd(ctx)
+ sendMotd(call)
} else {
c = exec.Command(shell, "-c", command)
}
@@ -107,11 +107,11 @@
defer c.Process.Kill()
select {
- case runErr := <-runIOManager(stdin, stdout, stderr, ptyFd, ctx):
- b, _ := ctx.RemoteBlessings().ForCall(ctx)
+ case runErr := <-runIOManager(stdin, stdout, stderr, ptyFd, call):
+ b, _ := call.RemoteBlessings().ForCall(call)
vlog.Infof("SHELL END for %v: %q (%v)", b, command, runErr)
return harvestExitcode(c.Process, runErr)
- case <-ctx.Context().Done():
+ case <-call.Context().Done():
return nonShellErrorCode, fmt.Errorf("remote end exited")
}
}
diff --git a/lib/appcycle/appcycle.go b/lib/appcycle/appcycle.go
index 3567fbf..2ae5af4 100644
--- a/lib/appcycle/appcycle.go
+++ b/lib/appcycle/appcycle.go
@@ -118,9 +118,9 @@
return stub.AppCycleServer(m.disp)
}
-func (d *invoker) Stop(ctx stub.AppCycleStopContext) error {
- blessings, _ := ctx.RemoteBlessings().ForCall(ctx)
- vlog.Infof("AppCycle Stop requested by %v", blessings)
+func (d *invoker) Stop(call stub.AppCycleStopServerCall) error {
+ blessings, _ := call.RemoteBlessings().ForCall(call)
+ vlog.Infof("AppCycle Stop request from %v", blessings)
// The size of the channel should be reasonably sized to expect not to
// miss updates while we're waiting for the stream to unblock.
ch := make(chan v23.Task, 10)
@@ -135,7 +135,7 @@
}
actask := stub.Task{Progress: task.Progress, Goal: task.Goal}
vlog.Infof("AppCycle Stop progress %d/%d", task.Progress, task.Goal)
- ctx.SendStream().Send(actask)
+ call.SendStream().Send(actask)
}
vlog.Infof("AppCycle Stop done")
return nil
diff --git a/lib/vdl/codegen/golang/gen.go b/lib/vdl/codegen/golang/gen.go
index 2a65794..f83e0b0 100644
--- a/lib/vdl/codegen/golang/gen.go
+++ b/lib/vdl/codegen/golang/gen.go
@@ -158,8 +158,8 @@
"argParens": argParens,
"uniqueName": uniqueName,
"uniqueNameImpl": uniqueNameImpl,
- "serverContextType": serverContextType,
- "serverContextStubType": serverContextStubType,
+ "serverCallType": serverCallType,
+ "serverCallStubType": serverCallStubType,
"outArgsClient": outArgsClient,
"clientStubImpl": clientStubImpl,
"clientFinishImpl": clientFinishImpl,
@@ -305,18 +305,18 @@
// The first arg of every server method is a context; the type is either a typed
// context for streams, or ipc.ServerCall for non-streams.
-func serverContextType(prefix string, data goData, iface *compile.Interface, method *compile.Method) string {
+func serverCallType(prefix string, data goData, iface *compile.Interface, method *compile.Method) string {
if isStreamingMethod(method) {
- return prefix + uniqueName(iface, method, "Context")
+ return prefix + uniqueName(iface, method, "ServerCall")
}
return prefix + data.Pkg("v.io/v23/ipc") + "ServerCall"
}
// The first arg of every server stub method is a context; the type is either a
// typed context stub for streams, or ipc.ServerCall for non-streams.
-func serverContextStubType(prefix string, data goData, iface *compile.Interface, method *compile.Method) string {
+func serverCallStubType(prefix string, data goData, iface *compile.Interface, method *compile.Method) string {
if isStreamingMethod(method) {
- return prefix + "*" + uniqueName(iface, method, "ContextStub")
+ return prefix + "*" + uniqueName(iface, method, "ServerCallStub")
}
return prefix + data.Pkg("v.io/v23/ipc") + "ServerCall"
}
@@ -360,7 +360,7 @@
// serverStubImpl returns the interface method server stub implementation.
func serverStubImpl(data goData, iface *compile.Interface, method *compile.Method) string {
var buf bytes.Buffer
- inargs := argNames("", "i", "ctx", "", method.InArgs)
+ inargs := argNames("", "i", "call", "", method.InArgs)
fmt.Fprintf(&buf, "\treturn s.impl.%s(%s)", method.Name, inargs)
return buf.String() // the caller writes the trailing newline
}
@@ -505,8 +505,8 @@
{{$clientStream := uniqueName $iface $method "ClientStream"}}
{{$clientCall := uniqueName $iface $method "ClientCall"}}
{{$clientCallImpl := uniqueNameImpl $iface $method "ClientCall"}}
-{{$clientRecvImpl := uniqueNameImpl $iface $method "CallRecv"}}
-{{$clientSendImpl := uniqueNameImpl $iface $method "CallSend"}}
+{{$clientRecvImpl := uniqueNameImpl $iface $method "ClientCallRecv"}}
+{{$clientSendImpl := uniqueNameImpl $iface $method "ClientCallSend"}}
// {{$clientStream}} is the client stream for {{$iface.Name}}.{{$method.Name}}.
type {{$clientStream}} interface { {{if $method.OutStream}}
@@ -617,7 +617,7 @@
// implements for {{$iface.Name}}.
{{docBreak $iface.Doc}}type {{$iface.Name}}ServerMethods interface { {{range $embed := $iface.Embeds}}
{{$embed.Doc}}{{embedGo $data $embed}}ServerMethods{{$embed.DocSuffix}}{{end}}{{range $method := $iface.Methods}}
- {{$method.Doc}}{{$method.Name}}({{argNameTypes "" (serverContextType "ctx " $data $iface $method) "" $data $method.InArgs}}) {{argParens (argNameTypes "" "" "err error" $data $method.OutArgs)}}{{$method.DocSuffix}}{{end}}
+ {{$method.Doc}}{{$method.Name}}({{argNameTypes "" (serverCallType "call " $data $iface $method) "" $data $method.InArgs}}) {{argParens (argNameTypes "" "" "err error" $data $method.OutArgs)}}{{$method.DocSuffix}}{{end}}
}
// {{$iface.Name}}ServerStubMethods is the server interface containing
@@ -628,7 +628,7 @@
// since there are no streaming methods.{{end}}
type {{$iface.Name}}ServerStubMethods {{if $ifaceStreaming}}interface { {{range $embed := $iface.Embeds}}
{{$embed.Doc}}{{embedGo $data $embed}}ServerStubMethods{{$embed.DocSuffix}}{{end}}{{range $method := $iface.Methods}}
- {{$method.Doc}}{{$method.Name}}({{argNameTypes "" (serverContextStubType "ctx " $data $iface $method) "" $data $method.InArgs}}) {{argParens (argNameTypes "" "" "err error" $data $method.OutArgs)}}{{$method.DocSuffix}}{{end}}
+ {{$method.Doc}}{{$method.Name}}({{argNameTypes "" (serverCallStubType "call " $data $iface $method) "" $data $method.InArgs}}) {{argParens (argNameTypes "" "" "err error" $data $method.OutArgs)}}{{$method.DocSuffix}}{{end}}
}
{{else}}{{$iface.Name}}ServerMethods
{{end}}
@@ -665,7 +665,7 @@
}
{{range $method := $iface.Methods}}
-func (s impl{{$iface.Name}}ServerStub) {{$method.Name}}({{argNameTypes "i" (serverContextStubType "ctx " $data $iface $method) "" $data $method.InArgs}}) {{argParens (argTypes "" "error" $data $method.OutArgs)}} {
+func (s impl{{$iface.Name}}ServerStub) {{$method.Name}}({{argNameTypes "i" (serverCallStubType "call " $data $iface $method) "" $data $method.InArgs}}) {{argParens (argTypes "" "error" $data $method.OutArgs)}} {
{{serverStubImpl $data $iface $method}}
}
{{end}}
@@ -707,10 +707,10 @@
{{range $method := $iface.Methods}}
{{if isStreamingMethod $method}}
{{$serverStream := uniqueName $iface $method "ServerStream"}}
-{{$serverContext := uniqueName $iface $method "Context"}}
-{{$serverContextStub := uniqueName $iface $method "ContextStub"}}
-{{$serverRecvImpl := uniqueNameImpl $iface $method "ContextRecv"}}
-{{$serverSendImpl := uniqueNameImpl $iface $method "ContextSend"}}
+{{$serverCall := uniqueName $iface $method "ServerCall"}}
+{{$serverCallStub := uniqueName $iface $method "ServerCallStub"}}
+{{$serverRecvImpl := uniqueNameImpl $iface $method "ServerCallRecv"}}
+{{$serverSendImpl := uniqueNameImpl $iface $method "ServerCallSend"}}
// {{$serverStream}} is the server stream for {{$iface.Name}}.{{$method.Name}}.
type {{$serverStream}} interface { {{if $method.InStream}}
@@ -735,27 +735,27 @@
} {{end}}
}
-// {{$serverContext}} represents the context passed to {{$iface.Name}}.{{$method.Name}}.
-type {{$serverContext}} interface {
+// {{$serverCall}} represents the context passed to {{$iface.Name}}.{{$method.Name}}.
+type {{$serverCall}} interface {
{{$ipc_}}ServerCall
{{$serverStream}}
}
-// {{$serverContextStub}} is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements {{$serverContext}}.
-type {{$serverContextStub}} struct {
+// {{$serverCallStub}} is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements {{$serverCall}}.
+type {{$serverCallStub}} struct {
{{$ipc_}}StreamServerCall{{if $method.InStream}}
valRecv {{typeGo $data $method.InStream}}
errRecv error{{end}}
}
-// Init initializes {{$serverContextStub}} from ipc.StreamServerCall.
-func (s *{{$serverContextStub}}) Init(call {{$ipc_}}StreamServerCall) {
+// Init initializes {{$serverCallStub}} from ipc.StreamServerCall.
+func (s *{{$serverCallStub}}) Init(call {{$ipc_}}StreamServerCall) {
s.StreamServerCall = call
}
{{if $method.InStream}}// RecvStream returns the receiver side of the {{$iface.Name}}.{{$method.Name}} server stream.
-func (s *{{$serverContextStub}}) RecvStream() interface {
+func (s *{{$serverCallStub}}) RecvStream() interface {
Advance() bool
Value() {{typeGo $data $method.InStream}}
Err() error
@@ -764,7 +764,7 @@
}
type {{$serverRecvImpl}} struct {
- s *{{$serverContextStub}}
+ s *{{$serverCallStub}}
}
func (s {{$serverRecvImpl}}) Advance() bool {
@@ -781,14 +781,14 @@
return s.s.errRecv
}
{{end}}{{if $method.OutStream}}// SendStream returns the send side of the {{$iface.Name}}.{{$method.Name}} server stream.
-func (s *{{$serverContextStub}}) SendStream() interface {
+func (s *{{$serverCallStub}}) SendStream() interface {
Send(item {{typeGo $data $method.OutStream}}) error
} {
return {{$serverSendImpl}}{s}
}
type {{$serverSendImpl}} struct {
- s *{{$serverContextStub}}
+ s *{{$serverCallStub}}
}
func (s {{$serverSendImpl}}) Send(item {{typeGo $data $method.OutStream}}) error {
diff --git a/lib/vdl/testdata/arith/advanced.vdl.go b/lib/vdl/testdata/arith/advanced.vdl.go
index c972c21..49504f5 100644
--- a/lib/vdl/testdata/arith/advanced.vdl.go
+++ b/lib/vdl/testdata/arith/advanced.vdl.go
@@ -74,8 +74,8 @@
//
// Trigonometry is an interface that specifies a couple trigonometric functions.
type TrigonometryServerMethods interface {
- Sine(ctx ipc.ServerCall, angle float64) (float64, error)
- Cosine(ctx ipc.ServerCall, angle float64) (float64, error)
+ Sine(call ipc.ServerCall, angle float64) (float64, error)
+ Cosine(call ipc.ServerCall, angle float64) (float64, error)
}
// TrigonometryServerStubMethods is the server interface containing
@@ -113,12 +113,12 @@
gs *ipc.GlobState
}
-func (s implTrigonometryServerStub) Sine(ctx ipc.ServerCall, i0 float64) (float64, error) {
- return s.impl.Sine(ctx, i0)
+func (s implTrigonometryServerStub) Sine(call ipc.ServerCall, i0 float64) (float64, error) {
+ return s.impl.Sine(call, i0)
}
-func (s implTrigonometryServerStub) Cosine(ctx ipc.ServerCall, i0 float64) (float64, error) {
- return s.impl.Cosine(ctx, i0)
+func (s implTrigonometryServerStub) Cosine(call ipc.ServerCall, i0 float64) (float64, error) {
+ return s.impl.Cosine(call, i0)
}
func (s implTrigonometryServerStub) Globber() *ipc.GlobState {
diff --git a/lib/vdl/testdata/arith/arith.vdl.go b/lib/vdl/testdata/arith/arith.vdl.go
index e8324e1..08c4b7f 100644
--- a/lib/vdl/testdata/arith/arith.vdl.go
+++ b/lib/vdl/testdata/arith/arith.vdl.go
@@ -233,21 +233,21 @@
Value() int32
Err() error
} {
- return implArithCountCallRecv{c}
+ return implArithCountClientCallRecv{c}
}
-type implArithCountCallRecv struct {
+type implArithCountClientCallRecv struct {
c *implArithCountClientCall
}
-func (c implArithCountCallRecv) Advance() bool {
+func (c implArithCountClientCallRecv) Advance() bool {
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implArithCountCallRecv) Value() int32 {
+func (c implArithCountClientCallRecv) Value() int32 {
return c.c.valRecv
}
-func (c implArithCountCallRecv) Err() error {
+func (c implArithCountClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -318,21 +318,21 @@
Value() int32
Err() error
} {
- return implArithStreamingAddCallRecv{c}
+ return implArithStreamingAddClientCallRecv{c}
}
-type implArithStreamingAddCallRecv struct {
+type implArithStreamingAddClientCallRecv struct {
c *implArithStreamingAddClientCall
}
-func (c implArithStreamingAddCallRecv) Advance() bool {
+func (c implArithStreamingAddClientCallRecv) Advance() bool {
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implArithStreamingAddCallRecv) Value() int32 {
+func (c implArithStreamingAddClientCallRecv) Value() int32 {
return c.c.valRecv
}
-func (c implArithStreamingAddCallRecv) Err() error {
+func (c implArithStreamingAddClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -342,17 +342,17 @@
Send(item int32) error
Close() error
} {
- return implArithStreamingAddCallSend{c}
+ return implArithStreamingAddClientCallSend{c}
}
-type implArithStreamingAddCallSend struct {
+type implArithStreamingAddClientCallSend struct {
c *implArithStreamingAddClientCall
}
-func (c implArithStreamingAddCallSend) Send(item int32) error {
+func (c implArithStreamingAddClientCallSend) Send(item int32) error {
return c.c.Send(item)
}
-func (c implArithStreamingAddCallSend) Close() error {
+func (c implArithStreamingAddClientCallSend) Close() error {
return c.c.CloseSend()
}
func (c *implArithStreamingAddClientCall) Finish() (o0 int32, err error) {
@@ -368,25 +368,25 @@
// * There must be at least 1 out-arg, and the last out-arg must be error.
type ArithServerMethods interface {
// Add is a typical method with multiple input and output arguments.
- Add(ctx ipc.ServerCall, a int32, b int32) (int32, error)
+ Add(call ipc.ServerCall, a int32, b int32) (int32, error)
// DivMod shows that runs of args with the same type can use the short form,
// just like Go.
- DivMod(ctx ipc.ServerCall, a int32, b int32) (quot int32, rem int32, err error)
+ DivMod(call ipc.ServerCall, a int32, b int32) (quot int32, rem int32, err error)
// Sub shows that you can use data types defined in other packages.
- Sub(ctx ipc.ServerCall, args base.Args) (int32, error)
+ Sub(call ipc.ServerCall, args base.Args) (int32, error)
// Mul tries another data type defined in another package.
- Mul(ctx ipc.ServerCall, nested base.NestedArgs) (int32, error)
+ Mul(call ipc.ServerCall, nested base.NestedArgs) (int32, error)
// GenError shows that it's fine to have no in args, and no out args other
// than "error". In addition GenError shows the usage of tags. Tags are a
// sequence of constants. There's no requirement on uniqueness of types or
// values, and regular const expressions may also be used.
GenError(ipc.ServerCall) error
// Count shows using only an int32 out-stream type, with no in-stream type.
- Count(ctx ArithCountContext, start int32) error
+ Count(call ArithCountServerCall, start int32) error
// StreamingAdd shows a bidirectional stream.
- StreamingAdd(ArithStreamingAddContext) (total int32, err error)
+ StreamingAdd(ArithStreamingAddServerCall) (total int32, err error)
// QuoteAny shows the any built-in type, representing a value of any type.
- QuoteAny(ctx ipc.ServerCall, a *vdl.Value) (*vdl.Value, error)
+ QuoteAny(call ipc.ServerCall, a *vdl.Value) (*vdl.Value, error)
}
// ArithServerStubMethods is the server interface containing
@@ -395,25 +395,25 @@
// is the streaming methods.
type ArithServerStubMethods interface {
// Add is a typical method with multiple input and output arguments.
- Add(ctx ipc.ServerCall, a int32, b int32) (int32, error)
+ Add(call ipc.ServerCall, a int32, b int32) (int32, error)
// DivMod shows that runs of args with the same type can use the short form,
// just like Go.
- DivMod(ctx ipc.ServerCall, a int32, b int32) (quot int32, rem int32, err error)
+ DivMod(call ipc.ServerCall, a int32, b int32) (quot int32, rem int32, err error)
// Sub shows that you can use data types defined in other packages.
- Sub(ctx ipc.ServerCall, args base.Args) (int32, error)
+ Sub(call ipc.ServerCall, args base.Args) (int32, error)
// Mul tries another data type defined in another package.
- Mul(ctx ipc.ServerCall, nested base.NestedArgs) (int32, error)
+ Mul(call ipc.ServerCall, nested base.NestedArgs) (int32, error)
// GenError shows that it's fine to have no in args, and no out args other
// than "error". In addition GenError shows the usage of tags. Tags are a
// sequence of constants. There's no requirement on uniqueness of types or
// values, and regular const expressions may also be used.
GenError(ipc.ServerCall) error
// Count shows using only an int32 out-stream type, with no in-stream type.
- Count(ctx *ArithCountContextStub, start int32) error
+ Count(call *ArithCountServerCallStub, start int32) error
// StreamingAdd shows a bidirectional stream.
- StreamingAdd(*ArithStreamingAddContextStub) (total int32, err error)
+ StreamingAdd(*ArithStreamingAddServerCallStub) (total int32, err error)
// QuoteAny shows the any built-in type, representing a value of any type.
- QuoteAny(ctx ipc.ServerCall, a *vdl.Value) (*vdl.Value, error)
+ QuoteAny(call ipc.ServerCall, a *vdl.Value) (*vdl.Value, error)
}
// ArithServerStub adds universal methods to ArithServerStubMethods.
@@ -445,36 +445,36 @@
gs *ipc.GlobState
}
-func (s implArithServerStub) Add(ctx ipc.ServerCall, i0 int32, i1 int32) (int32, error) {
- return s.impl.Add(ctx, i0, i1)
+func (s implArithServerStub) Add(call ipc.ServerCall, i0 int32, i1 int32) (int32, error) {
+ return s.impl.Add(call, i0, i1)
}
-func (s implArithServerStub) DivMod(ctx ipc.ServerCall, i0 int32, i1 int32) (int32, int32, error) {
- return s.impl.DivMod(ctx, i0, i1)
+func (s implArithServerStub) DivMod(call ipc.ServerCall, i0 int32, i1 int32) (int32, int32, error) {
+ return s.impl.DivMod(call, i0, i1)
}
-func (s implArithServerStub) Sub(ctx ipc.ServerCall, i0 base.Args) (int32, error) {
- return s.impl.Sub(ctx, i0)
+func (s implArithServerStub) Sub(call ipc.ServerCall, i0 base.Args) (int32, error) {
+ return s.impl.Sub(call, i0)
}
-func (s implArithServerStub) Mul(ctx ipc.ServerCall, i0 base.NestedArgs) (int32, error) {
- return s.impl.Mul(ctx, i0)
+func (s implArithServerStub) Mul(call ipc.ServerCall, i0 base.NestedArgs) (int32, error) {
+ return s.impl.Mul(call, i0)
}
-func (s implArithServerStub) GenError(ctx ipc.ServerCall) error {
- return s.impl.GenError(ctx)
+func (s implArithServerStub) GenError(call ipc.ServerCall) error {
+ return s.impl.GenError(call)
}
-func (s implArithServerStub) Count(ctx *ArithCountContextStub, i0 int32) error {
- return s.impl.Count(ctx, i0)
+func (s implArithServerStub) Count(call *ArithCountServerCallStub, i0 int32) error {
+ return s.impl.Count(call, i0)
}
-func (s implArithServerStub) StreamingAdd(ctx *ArithStreamingAddContextStub) (int32, error) {
- return s.impl.StreamingAdd(ctx)
+func (s implArithServerStub) StreamingAdd(call *ArithStreamingAddServerCallStub) (int32, error) {
+ return s.impl.StreamingAdd(call)
}
-func (s implArithServerStub) QuoteAny(ctx ipc.ServerCall, i0 *vdl.Value) (*vdl.Value, error) {
- return s.impl.QuoteAny(ctx, i0)
+func (s implArithServerStub) QuoteAny(call ipc.ServerCall, i0 *vdl.Value) (*vdl.Value, error) {
+ return s.impl.QuoteAny(call, i0)
}
func (s implArithServerStub) Globber() *ipc.GlobState {
@@ -580,35 +580,35 @@
}
}
-// ArithCountContext represents the context passed to Arith.Count.
-type ArithCountContext interface {
+// ArithCountServerCall represents the context passed to Arith.Count.
+type ArithCountServerCall interface {
ipc.ServerCall
ArithCountServerStream
}
-// ArithCountContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements ArithCountContext.
-type ArithCountContextStub struct {
+// ArithCountServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements ArithCountServerCall.
+type ArithCountServerCallStub struct {
ipc.StreamServerCall
}
-// Init initializes ArithCountContextStub from ipc.StreamServerCall.
-func (s *ArithCountContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes ArithCountServerCallStub from ipc.StreamServerCall.
+func (s *ArithCountServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// SendStream returns the send side of the Arith.Count server stream.
-func (s *ArithCountContextStub) SendStream() interface {
+func (s *ArithCountServerCallStub) SendStream() interface {
Send(item int32) error
} {
- return implArithCountContextSend{s}
+ return implArithCountServerCallSend{s}
}
-type implArithCountContextSend struct {
- s *ArithCountContextStub
+type implArithCountServerCallSend struct {
+ s *ArithCountServerCallStub
}
-func (s implArithCountContextSend) Send(item int32) error {
+func (s implArithCountServerCallSend) Send(item int32) error {
return s.s.Send(item)
}
@@ -635,46 +635,46 @@
}
}
-// ArithStreamingAddContext represents the context passed to Arith.StreamingAdd.
-type ArithStreamingAddContext interface {
+// ArithStreamingAddServerCall represents the context passed to Arith.StreamingAdd.
+type ArithStreamingAddServerCall interface {
ipc.ServerCall
ArithStreamingAddServerStream
}
-// ArithStreamingAddContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements ArithStreamingAddContext.
-type ArithStreamingAddContextStub struct {
+// ArithStreamingAddServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements ArithStreamingAddServerCall.
+type ArithStreamingAddServerCallStub struct {
ipc.StreamServerCall
valRecv int32
errRecv error
}
-// Init initializes ArithStreamingAddContextStub from ipc.StreamServerCall.
-func (s *ArithStreamingAddContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes ArithStreamingAddServerCallStub from ipc.StreamServerCall.
+func (s *ArithStreamingAddServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// RecvStream returns the receiver side of the Arith.StreamingAdd server stream.
-func (s *ArithStreamingAddContextStub) RecvStream() interface {
+func (s *ArithStreamingAddServerCallStub) RecvStream() interface {
Advance() bool
Value() int32
Err() error
} {
- return implArithStreamingAddContextRecv{s}
+ return implArithStreamingAddServerCallRecv{s}
}
-type implArithStreamingAddContextRecv struct {
- s *ArithStreamingAddContextStub
+type implArithStreamingAddServerCallRecv struct {
+ s *ArithStreamingAddServerCallStub
}
-func (s implArithStreamingAddContextRecv) Advance() bool {
+func (s implArithStreamingAddServerCallRecv) Advance() bool {
s.s.errRecv = s.s.Recv(&s.s.valRecv)
return s.s.errRecv == nil
}
-func (s implArithStreamingAddContextRecv) Value() int32 {
+func (s implArithStreamingAddServerCallRecv) Value() int32 {
return s.s.valRecv
}
-func (s implArithStreamingAddContextRecv) Err() error {
+func (s implArithStreamingAddServerCallRecv) Err() error {
if s.s.errRecv == io.EOF {
return nil
}
@@ -682,17 +682,17 @@
}
// SendStream returns the send side of the Arith.StreamingAdd server stream.
-func (s *ArithStreamingAddContextStub) SendStream() interface {
+func (s *ArithStreamingAddServerCallStub) SendStream() interface {
Send(item int32) error
} {
- return implArithStreamingAddContextSend{s}
+ return implArithStreamingAddServerCallSend{s}
}
-type implArithStreamingAddContextSend struct {
- s *ArithStreamingAddContextStub
+type implArithStreamingAddServerCallSend struct {
+ s *ArithStreamingAddServerCallStub
}
-func (s implArithStreamingAddContextSend) Send(item int32) error {
+func (s implArithStreamingAddServerCallSend) Send(item int32) error {
return s.s.Send(item)
}
@@ -829,12 +829,12 @@
gs *ipc.GlobState
}
-func (s implCalculatorServerStub) On(ctx ipc.ServerCall) error {
- return s.impl.On(ctx)
+func (s implCalculatorServerStub) On(call ipc.ServerCall) error {
+ return s.impl.On(call)
}
-func (s implCalculatorServerStub) Off(ctx ipc.ServerCall) error {
- return s.impl.Off(ctx)
+func (s implCalculatorServerStub) Off(call ipc.ServerCall) error {
+ return s.impl.Off(call)
}
func (s implCalculatorServerStub) Globber() *ipc.GlobState {
diff --git a/lib/vdl/testdata/arith/exp/exp.vdl.go b/lib/vdl/testdata/arith/exp/exp.vdl.go
index a808cbc..e34d68f 100644
--- a/lib/vdl/testdata/arith/exp/exp.vdl.go
+++ b/lib/vdl/testdata/arith/exp/exp.vdl.go
@@ -59,7 +59,7 @@
// ExpServerMethods is the interface a server writer
// implements for Exp.
type ExpServerMethods interface {
- Exp(ctx ipc.ServerCall, x float64) (float64, error)
+ Exp(call ipc.ServerCall, x float64) (float64, error)
}
// ExpServerStubMethods is the server interface containing
@@ -97,8 +97,8 @@
gs *ipc.GlobState
}
-func (s implExpServerStub) Exp(ctx ipc.ServerCall, i0 float64) (float64, error) {
- return s.impl.Exp(ctx, i0)
+func (s implExpServerStub) Exp(call ipc.ServerCall, i0 float64) (float64, error) {
+ return s.impl.Exp(call, i0)
}
func (s implExpServerStub) Globber() *ipc.GlobState {
diff --git a/lib/vdl/testdata/base/base.vdl.go b/lib/vdl/testdata/base/base.vdl.go
index f3f0124..efd34fd 100644
--- a/lib/vdl/testdata/base/base.vdl.go
+++ b/lib/vdl/testdata/base/base.vdl.go
@@ -716,22 +716,22 @@
Value() Scalars
Err() error
} {
- return implServiceAMethodA3CallRecv{c}
+ return implServiceAMethodA3ClientCallRecv{c}
}
-type implServiceAMethodA3CallRecv struct {
+type implServiceAMethodA3ClientCallRecv struct {
c *implServiceAMethodA3ClientCall
}
-func (c implServiceAMethodA3CallRecv) Advance() bool {
+func (c implServiceAMethodA3ClientCallRecv) Advance() bool {
c.c.valRecv = Scalars{}
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implServiceAMethodA3CallRecv) Value() Scalars {
+func (c implServiceAMethodA3ClientCallRecv) Value() Scalars {
return c.c.valRecv
}
-func (c implServiceAMethodA3CallRecv) Err() error {
+func (c implServiceAMethodA3ClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -802,21 +802,21 @@
Value() string
Err() error
} {
- return implServiceAMethodA4CallRecv{c}
+ return implServiceAMethodA4ClientCallRecv{c}
}
-type implServiceAMethodA4CallRecv struct {
+type implServiceAMethodA4ClientCallRecv struct {
c *implServiceAMethodA4ClientCall
}
-func (c implServiceAMethodA4CallRecv) Advance() bool {
+func (c implServiceAMethodA4ClientCallRecv) Advance() bool {
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implServiceAMethodA4CallRecv) Value() string {
+func (c implServiceAMethodA4ClientCallRecv) Value() string {
return c.c.valRecv
}
-func (c implServiceAMethodA4CallRecv) Err() error {
+func (c implServiceAMethodA4ClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -826,17 +826,17 @@
Send(item int32) error
Close() error
} {
- return implServiceAMethodA4CallSend{c}
+ return implServiceAMethodA4ClientCallSend{c}
}
-type implServiceAMethodA4CallSend struct {
+type implServiceAMethodA4ClientCallSend struct {
c *implServiceAMethodA4ClientCall
}
-func (c implServiceAMethodA4CallSend) Send(item int32) error {
+func (c implServiceAMethodA4ClientCallSend) Send(item int32) error {
return c.c.Send(item)
}
-func (c implServiceAMethodA4CallSend) Close() error {
+func (c implServiceAMethodA4ClientCallSend) Close() error {
return c.c.CloseSend()
}
func (c *implServiceAMethodA4ClientCall) Finish() (err error) {
@@ -848,9 +848,9 @@
// implements for ServiceA.
type ServiceAServerMethods interface {
MethodA1(ipc.ServerCall) error
- MethodA2(ctx ipc.ServerCall, a int32, b string) (s string, err error)
- MethodA3(ctx ServiceAMethodA3Context, a int32) (s string, err error)
- MethodA4(ctx ServiceAMethodA4Context, a int32) error
+ MethodA2(call ipc.ServerCall, a int32, b string) (s string, err error)
+ MethodA3(call ServiceAMethodA3ServerCall, a int32) (s string, err error)
+ MethodA4(call ServiceAMethodA4ServerCall, a int32) error
}
// ServiceAServerStubMethods is the server interface containing
@@ -859,9 +859,9 @@
// is the streaming methods.
type ServiceAServerStubMethods interface {
MethodA1(ipc.ServerCall) error
- MethodA2(ctx ipc.ServerCall, a int32, b string) (s string, err error)
- MethodA3(ctx *ServiceAMethodA3ContextStub, a int32) (s string, err error)
- MethodA4(ctx *ServiceAMethodA4ContextStub, a int32) error
+ MethodA2(call ipc.ServerCall, a int32, b string) (s string, err error)
+ MethodA3(call *ServiceAMethodA3ServerCallStub, a int32) (s string, err error)
+ MethodA4(call *ServiceAMethodA4ServerCallStub, a int32) error
}
// ServiceAServerStub adds universal methods to ServiceAServerStubMethods.
@@ -893,20 +893,20 @@
gs *ipc.GlobState
}
-func (s implServiceAServerStub) MethodA1(ctx ipc.ServerCall) error {
- return s.impl.MethodA1(ctx)
+func (s implServiceAServerStub) MethodA1(call ipc.ServerCall) error {
+ return s.impl.MethodA1(call)
}
-func (s implServiceAServerStub) MethodA2(ctx ipc.ServerCall, i0 int32, i1 string) (string, error) {
- return s.impl.MethodA2(ctx, i0, i1)
+func (s implServiceAServerStub) MethodA2(call ipc.ServerCall, i0 int32, i1 string) (string, error) {
+ return s.impl.MethodA2(call, i0, i1)
}
-func (s implServiceAServerStub) MethodA3(ctx *ServiceAMethodA3ContextStub, i0 int32) (string, error) {
- return s.impl.MethodA3(ctx, i0)
+func (s implServiceAServerStub) MethodA3(call *ServiceAMethodA3ServerCallStub, i0 int32) (string, error) {
+ return s.impl.MethodA3(call, i0)
}
-func (s implServiceAServerStub) MethodA4(ctx *ServiceAMethodA4ContextStub, i0 int32) error {
- return s.impl.MethodA4(ctx, i0)
+func (s implServiceAServerStub) MethodA4(call *ServiceAMethodA4ServerCallStub, i0 int32) error {
+ return s.impl.MethodA4(call, i0)
}
func (s implServiceAServerStub) Globber() *ipc.GlobState {
@@ -968,35 +968,35 @@
}
}
-// ServiceAMethodA3Context represents the context passed to ServiceA.MethodA3.
-type ServiceAMethodA3Context interface {
+// ServiceAMethodA3ServerCall represents the context passed to ServiceA.MethodA3.
+type ServiceAMethodA3ServerCall interface {
ipc.ServerCall
ServiceAMethodA3ServerStream
}
-// ServiceAMethodA3ContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements ServiceAMethodA3Context.
-type ServiceAMethodA3ContextStub struct {
+// ServiceAMethodA3ServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements ServiceAMethodA3ServerCall.
+type ServiceAMethodA3ServerCallStub struct {
ipc.StreamServerCall
}
-// Init initializes ServiceAMethodA3ContextStub from ipc.StreamServerCall.
-func (s *ServiceAMethodA3ContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes ServiceAMethodA3ServerCallStub from ipc.StreamServerCall.
+func (s *ServiceAMethodA3ServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// SendStream returns the send side of the ServiceA.MethodA3 server stream.
-func (s *ServiceAMethodA3ContextStub) SendStream() interface {
+func (s *ServiceAMethodA3ServerCallStub) SendStream() interface {
Send(item Scalars) error
} {
- return implServiceAMethodA3ContextSend{s}
+ return implServiceAMethodA3ServerCallSend{s}
}
-type implServiceAMethodA3ContextSend struct {
- s *ServiceAMethodA3ContextStub
+type implServiceAMethodA3ServerCallSend struct {
+ s *ServiceAMethodA3ServerCallStub
}
-func (s implServiceAMethodA3ContextSend) Send(item Scalars) error {
+func (s implServiceAMethodA3ServerCallSend) Send(item Scalars) error {
return s.s.Send(item)
}
@@ -1023,46 +1023,46 @@
}
}
-// ServiceAMethodA4Context represents the context passed to ServiceA.MethodA4.
-type ServiceAMethodA4Context interface {
+// ServiceAMethodA4ServerCall represents the context passed to ServiceA.MethodA4.
+type ServiceAMethodA4ServerCall interface {
ipc.ServerCall
ServiceAMethodA4ServerStream
}
-// ServiceAMethodA4ContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements ServiceAMethodA4Context.
-type ServiceAMethodA4ContextStub struct {
+// ServiceAMethodA4ServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements ServiceAMethodA4ServerCall.
+type ServiceAMethodA4ServerCallStub struct {
ipc.StreamServerCall
valRecv int32
errRecv error
}
-// Init initializes ServiceAMethodA4ContextStub from ipc.StreamServerCall.
-func (s *ServiceAMethodA4ContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes ServiceAMethodA4ServerCallStub from ipc.StreamServerCall.
+func (s *ServiceAMethodA4ServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// RecvStream returns the receiver side of the ServiceA.MethodA4 server stream.
-func (s *ServiceAMethodA4ContextStub) RecvStream() interface {
+func (s *ServiceAMethodA4ServerCallStub) RecvStream() interface {
Advance() bool
Value() int32
Err() error
} {
- return implServiceAMethodA4ContextRecv{s}
+ return implServiceAMethodA4ServerCallRecv{s}
}
-type implServiceAMethodA4ContextRecv struct {
- s *ServiceAMethodA4ContextStub
+type implServiceAMethodA4ServerCallRecv struct {
+ s *ServiceAMethodA4ServerCallStub
}
-func (s implServiceAMethodA4ContextRecv) Advance() bool {
+func (s implServiceAMethodA4ServerCallRecv) Advance() bool {
s.s.errRecv = s.s.Recv(&s.s.valRecv)
return s.s.errRecv == nil
}
-func (s implServiceAMethodA4ContextRecv) Value() int32 {
+func (s implServiceAMethodA4ServerCallRecv) Value() int32 {
return s.s.valRecv
}
-func (s implServiceAMethodA4ContextRecv) Err() error {
+func (s implServiceAMethodA4ServerCallRecv) Err() error {
if s.s.errRecv == io.EOF {
return nil
}
@@ -1070,17 +1070,17 @@
}
// SendStream returns the send side of the ServiceA.MethodA4 server stream.
-func (s *ServiceAMethodA4ContextStub) SendStream() interface {
+func (s *ServiceAMethodA4ServerCallStub) SendStream() interface {
Send(item string) error
} {
- return implServiceAMethodA4ContextSend{s}
+ return implServiceAMethodA4ServerCallSend{s}
}
-type implServiceAMethodA4ContextSend struct {
- s *ServiceAMethodA4ContextStub
+type implServiceAMethodA4ServerCallSend struct {
+ s *ServiceAMethodA4ServerCallStub
}
-func (s implServiceAMethodA4ContextSend) Send(item string) error {
+func (s implServiceAMethodA4ServerCallSend) Send(item string) error {
return s.s.Send(item)
}
@@ -1135,7 +1135,7 @@
// implements for ServiceB.
type ServiceBServerMethods interface {
ServiceAServerMethods
- MethodB1(ctx ipc.ServerCall, a Scalars, b Composites) (c CompComp, err error)
+ MethodB1(call ipc.ServerCall, a Scalars, b Composites) (c CompComp, err error)
}
// ServiceBServerStubMethods is the server interface containing
@@ -1144,7 +1144,7 @@
// is the streaming methods.
type ServiceBServerStubMethods interface {
ServiceAServerStubMethods
- MethodB1(ctx ipc.ServerCall, a Scalars, b Composites) (c CompComp, err error)
+ MethodB1(call ipc.ServerCall, a Scalars, b Composites) (c CompComp, err error)
}
// ServiceBServerStub adds universal methods to ServiceBServerStubMethods.
@@ -1178,8 +1178,8 @@
gs *ipc.GlobState
}
-func (s implServiceBServerStub) MethodB1(ctx ipc.ServerCall, i0 Scalars, i1 Composites) (CompComp, error) {
- return s.impl.MethodB1(ctx, i0, i1)
+func (s implServiceBServerStub) MethodB1(call ipc.ServerCall, i0 Scalars, i1 Composites) (CompComp, error) {
+ return s.impl.MethodB1(call, i0, i1)
}
func (s implServiceBServerStub) Globber() *ipc.GlobState {
diff --git a/profiles/internal/ipc/benchmark/benchmark.vdl.go b/profiles/internal/ipc/benchmark/benchmark.vdl.go
index 69c808b..51be41c 100644
--- a/profiles/internal/ipc/benchmark/benchmark.vdl.go
+++ b/profiles/internal/ipc/benchmark/benchmark.vdl.go
@@ -133,21 +133,21 @@
Value() []byte
Err() error
} {
- return implBenchmarkEchoStreamCallRecv{c}
+ return implBenchmarkEchoStreamClientCallRecv{c}
}
-type implBenchmarkEchoStreamCallRecv struct {
+type implBenchmarkEchoStreamClientCallRecv struct {
c *implBenchmarkEchoStreamClientCall
}
-func (c implBenchmarkEchoStreamCallRecv) Advance() bool {
+func (c implBenchmarkEchoStreamClientCallRecv) Advance() bool {
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implBenchmarkEchoStreamCallRecv) Value() []byte {
+func (c implBenchmarkEchoStreamClientCallRecv) Value() []byte {
return c.c.valRecv
}
-func (c implBenchmarkEchoStreamCallRecv) Err() error {
+func (c implBenchmarkEchoStreamClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -157,17 +157,17 @@
Send(item []byte) error
Close() error
} {
- return implBenchmarkEchoStreamCallSend{c}
+ return implBenchmarkEchoStreamClientCallSend{c}
}
-type implBenchmarkEchoStreamCallSend struct {
+type implBenchmarkEchoStreamClientCallSend struct {
c *implBenchmarkEchoStreamClientCall
}
-func (c implBenchmarkEchoStreamCallSend) Send(item []byte) error {
+func (c implBenchmarkEchoStreamClientCallSend) Send(item []byte) error {
return c.c.Send(item)
}
-func (c implBenchmarkEchoStreamCallSend) Close() error {
+func (c implBenchmarkEchoStreamClientCallSend) Close() error {
return c.c.CloseSend()
}
func (c *implBenchmarkEchoStreamClientCall) Finish() (err error) {
@@ -179,9 +179,9 @@
// implements for Benchmark.
type BenchmarkServerMethods interface {
// Echo returns the payload that it receives.
- Echo(ctx ipc.ServerCall, Payload []byte) ([]byte, error)
+ Echo(call ipc.ServerCall, Payload []byte) ([]byte, error)
// EchoStream returns the payload that it receives via the stream.
- EchoStream(BenchmarkEchoStreamContext) error
+ EchoStream(BenchmarkEchoStreamServerCall) error
}
// BenchmarkServerStubMethods is the server interface containing
@@ -190,9 +190,9 @@
// is the streaming methods.
type BenchmarkServerStubMethods interface {
// Echo returns the payload that it receives.
- Echo(ctx ipc.ServerCall, Payload []byte) ([]byte, error)
+ Echo(call ipc.ServerCall, Payload []byte) ([]byte, error)
// EchoStream returns the payload that it receives via the stream.
- EchoStream(*BenchmarkEchoStreamContextStub) error
+ EchoStream(*BenchmarkEchoStreamServerCallStub) error
}
// BenchmarkServerStub adds universal methods to BenchmarkServerStubMethods.
@@ -224,12 +224,12 @@
gs *ipc.GlobState
}
-func (s implBenchmarkServerStub) Echo(ctx ipc.ServerCall, i0 []byte) ([]byte, error) {
- return s.impl.Echo(ctx, i0)
+func (s implBenchmarkServerStub) Echo(call ipc.ServerCall, i0 []byte) ([]byte, error) {
+ return s.impl.Echo(call, i0)
}
-func (s implBenchmarkServerStub) EchoStream(ctx *BenchmarkEchoStreamContextStub) error {
- return s.impl.EchoStream(ctx)
+func (s implBenchmarkServerStub) EchoStream(call *BenchmarkEchoStreamServerCallStub) error {
+ return s.impl.EchoStream(call)
}
func (s implBenchmarkServerStub) Globber() *ipc.GlobState {
@@ -290,46 +290,46 @@
}
}
-// BenchmarkEchoStreamContext represents the context passed to Benchmark.EchoStream.
-type BenchmarkEchoStreamContext interface {
+// BenchmarkEchoStreamServerCall represents the context passed to Benchmark.EchoStream.
+type BenchmarkEchoStreamServerCall interface {
ipc.ServerCall
BenchmarkEchoStreamServerStream
}
-// BenchmarkEchoStreamContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements BenchmarkEchoStreamContext.
-type BenchmarkEchoStreamContextStub struct {
+// BenchmarkEchoStreamServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements BenchmarkEchoStreamServerCall.
+type BenchmarkEchoStreamServerCallStub struct {
ipc.StreamServerCall
valRecv []byte
errRecv error
}
-// Init initializes BenchmarkEchoStreamContextStub from ipc.StreamServerCall.
-func (s *BenchmarkEchoStreamContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes BenchmarkEchoStreamServerCallStub from ipc.StreamServerCall.
+func (s *BenchmarkEchoStreamServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// RecvStream returns the receiver side of the Benchmark.EchoStream server stream.
-func (s *BenchmarkEchoStreamContextStub) RecvStream() interface {
+func (s *BenchmarkEchoStreamServerCallStub) RecvStream() interface {
Advance() bool
Value() []byte
Err() error
} {
- return implBenchmarkEchoStreamContextRecv{s}
+ return implBenchmarkEchoStreamServerCallRecv{s}
}
-type implBenchmarkEchoStreamContextRecv struct {
- s *BenchmarkEchoStreamContextStub
+type implBenchmarkEchoStreamServerCallRecv struct {
+ s *BenchmarkEchoStreamServerCallStub
}
-func (s implBenchmarkEchoStreamContextRecv) Advance() bool {
+func (s implBenchmarkEchoStreamServerCallRecv) Advance() bool {
s.s.errRecv = s.s.Recv(&s.s.valRecv)
return s.s.errRecv == nil
}
-func (s implBenchmarkEchoStreamContextRecv) Value() []byte {
+func (s implBenchmarkEchoStreamServerCallRecv) Value() []byte {
return s.s.valRecv
}
-func (s implBenchmarkEchoStreamContextRecv) Err() error {
+func (s implBenchmarkEchoStreamServerCallRecv) Err() error {
if s.s.errRecv == io.EOF {
return nil
}
@@ -337,16 +337,16 @@
}
// SendStream returns the send side of the Benchmark.EchoStream server stream.
-func (s *BenchmarkEchoStreamContextStub) SendStream() interface {
+func (s *BenchmarkEchoStreamServerCallStub) SendStream() interface {
Send(item []byte) error
} {
- return implBenchmarkEchoStreamContextSend{s}
+ return implBenchmarkEchoStreamServerCallSend{s}
}
-type implBenchmarkEchoStreamContextSend struct {
- s *BenchmarkEchoStreamContextStub
+type implBenchmarkEchoStreamServerCallSend struct {
+ s *BenchmarkEchoStreamServerCallStub
}
-func (s implBenchmarkEchoStreamContextSend) Send(item []byte) error {
+func (s implBenchmarkEchoStreamServerCallSend) Send(item []byte) error {
return s.s.Send(item)
}
diff --git a/profiles/internal/ipc/benchmark/internal/server.go b/profiles/internal/ipc/benchmark/internal/server.go
index d65f35f..5228f5b 100644
--- a/profiles/internal/ipc/benchmark/internal/server.go
+++ b/profiles/internal/ipc/benchmark/internal/server.go
@@ -18,9 +18,9 @@
return payload, nil
}
-func (i *impl) EchoStream(ctx benchmark.BenchmarkEchoStreamContext) error {
- rStream := ctx.RecvStream()
- sStream := ctx.SendStream()
+func (i *impl) EchoStream(call benchmark.BenchmarkEchoStreamServerCall) error {
+ rStream := call.RecvStream()
+ sStream := call.SendStream()
for rStream.Advance() {
sStream.Send(rStream.Value())
}
diff --git a/profiles/internal/ipc/stress/internal/server.go b/profiles/internal/ipc/stress/internal/server.go
index 3cab901..1dbc300 100644
--- a/profiles/internal/ipc/stress/internal/server.go
+++ b/profiles/internal/ipc/stress/internal/server.go
@@ -26,10 +26,10 @@
return doSum(arg)
}
-func (s *impl) SumStream(ctx stress.StressSumStreamContext) error {
+func (s *impl) SumStream(call stress.StressSumStreamServerCall) error {
defer s.incSumStreamCount()
- rStream := ctx.RecvStream()
- sStream := ctx.SendStream()
+ rStream := call.RecvStream()
+ sStream := call.SendStream()
for rStream.Advance() {
sum, err := doSum(rStream.Value())
if err != nil {
diff --git a/profiles/internal/ipc/stress/stress.vdl.go b/profiles/internal/ipc/stress/stress.vdl.go
index 90c38f3..c8cd486 100644
--- a/profiles/internal/ipc/stress/stress.vdl.go
+++ b/profiles/internal/ipc/stress/stress.vdl.go
@@ -179,21 +179,21 @@
Value() []byte
Err() error
} {
- return implStressSumStreamCallRecv{c}
+ return implStressSumStreamClientCallRecv{c}
}
-type implStressSumStreamCallRecv struct {
+type implStressSumStreamClientCallRecv struct {
c *implStressSumStreamClientCall
}
-func (c implStressSumStreamCallRecv) Advance() bool {
+func (c implStressSumStreamClientCallRecv) Advance() bool {
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implStressSumStreamCallRecv) Value() []byte {
+func (c implStressSumStreamClientCallRecv) Value() []byte {
return c.c.valRecv
}
-func (c implStressSumStreamCallRecv) Err() error {
+func (c implStressSumStreamClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -203,17 +203,17 @@
Send(item Arg) error
Close() error
} {
- return implStressSumStreamCallSend{c}
+ return implStressSumStreamClientCallSend{c}
}
-type implStressSumStreamCallSend struct {
+type implStressSumStreamClientCallSend struct {
c *implStressSumStreamClientCall
}
-func (c implStressSumStreamCallSend) Send(item Arg) error {
+func (c implStressSumStreamClientCallSend) Send(item Arg) error {
return c.c.Send(item)
}
-func (c implStressSumStreamCallSend) Close() error {
+func (c implStressSumStreamClientCallSend) Close() error {
return c.c.CloseSend()
}
func (c *implStressSumStreamClientCall) Finish() (err error) {
@@ -225,9 +225,9 @@
// implements for Stress.
type StressServerMethods interface {
// Do returns the checksum of the payload that it receives.
- Sum(ctx ipc.ServerCall, arg Arg) ([]byte, error)
+ Sum(call ipc.ServerCall, arg Arg) ([]byte, error)
// DoStream returns the checksum of the payload that it receives via the stream.
- SumStream(StressSumStreamContext) error
+ SumStream(StressSumStreamServerCall) error
// GetStats returns the stats on the calls that the server received.
GetStats(ipc.ServerCall) (Stats, error)
// Stop stops the server.
@@ -240,9 +240,9 @@
// is the streaming methods.
type StressServerStubMethods interface {
// Do returns the checksum of the payload that it receives.
- Sum(ctx ipc.ServerCall, arg Arg) ([]byte, error)
+ Sum(call ipc.ServerCall, arg Arg) ([]byte, error)
// DoStream returns the checksum of the payload that it receives via the stream.
- SumStream(*StressSumStreamContextStub) error
+ SumStream(*StressSumStreamServerCallStub) error
// GetStats returns the stats on the calls that the server received.
GetStats(ipc.ServerCall) (Stats, error)
// Stop stops the server.
@@ -278,20 +278,20 @@
gs *ipc.GlobState
}
-func (s implStressServerStub) Sum(ctx ipc.ServerCall, i0 Arg) ([]byte, error) {
- return s.impl.Sum(ctx, i0)
+func (s implStressServerStub) Sum(call ipc.ServerCall, i0 Arg) ([]byte, error) {
+ return s.impl.Sum(call, i0)
}
-func (s implStressServerStub) SumStream(ctx *StressSumStreamContextStub) error {
- return s.impl.SumStream(ctx)
+func (s implStressServerStub) SumStream(call *StressSumStreamServerCallStub) error {
+ return s.impl.SumStream(call)
}
-func (s implStressServerStub) GetStats(ctx ipc.ServerCall) (Stats, error) {
- return s.impl.GetStats(ctx)
+func (s implStressServerStub) GetStats(call ipc.ServerCall) (Stats, error) {
+ return s.impl.GetStats(call)
}
-func (s implStressServerStub) Stop(ctx ipc.ServerCall) error {
- return s.impl.Stop(ctx)
+func (s implStressServerStub) Stop(call ipc.ServerCall) error {
+ return s.impl.Stop(call)
}
func (s implStressServerStub) Globber() *ipc.GlobState {
@@ -365,47 +365,47 @@
}
}
-// StressSumStreamContext represents the context passed to Stress.SumStream.
-type StressSumStreamContext interface {
+// StressSumStreamServerCall represents the context passed to Stress.SumStream.
+type StressSumStreamServerCall interface {
ipc.ServerCall
StressSumStreamServerStream
}
-// StressSumStreamContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements StressSumStreamContext.
-type StressSumStreamContextStub struct {
+// StressSumStreamServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements StressSumStreamServerCall.
+type StressSumStreamServerCallStub struct {
ipc.StreamServerCall
valRecv Arg
errRecv error
}
-// Init initializes StressSumStreamContextStub from ipc.StreamServerCall.
-func (s *StressSumStreamContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes StressSumStreamServerCallStub from ipc.StreamServerCall.
+func (s *StressSumStreamServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// RecvStream returns the receiver side of the Stress.SumStream server stream.
-func (s *StressSumStreamContextStub) RecvStream() interface {
+func (s *StressSumStreamServerCallStub) RecvStream() interface {
Advance() bool
Value() Arg
Err() error
} {
- return implStressSumStreamContextRecv{s}
+ return implStressSumStreamServerCallRecv{s}
}
-type implStressSumStreamContextRecv struct {
- s *StressSumStreamContextStub
+type implStressSumStreamServerCallRecv struct {
+ s *StressSumStreamServerCallStub
}
-func (s implStressSumStreamContextRecv) Advance() bool {
+func (s implStressSumStreamServerCallRecv) Advance() bool {
s.s.valRecv = Arg{}
s.s.errRecv = s.s.Recv(&s.s.valRecv)
return s.s.errRecv == nil
}
-func (s implStressSumStreamContextRecv) Value() Arg {
+func (s implStressSumStreamServerCallRecv) Value() Arg {
return s.s.valRecv
}
-func (s implStressSumStreamContextRecv) Err() error {
+func (s implStressSumStreamServerCallRecv) Err() error {
if s.s.errRecv == io.EOF {
return nil
}
@@ -413,16 +413,16 @@
}
// SendStream returns the send side of the Stress.SumStream server stream.
-func (s *StressSumStreamContextStub) SendStream() interface {
+func (s *StressSumStreamServerCallStub) SendStream() interface {
Send(item []byte) error
} {
- return implStressSumStreamContextSend{s}
+ return implStressSumStreamServerCallSend{s}
}
-type implStressSumStreamContextSend struct {
- s *StressSumStreamContextStub
+type implStressSumStreamServerCallSend struct {
+ s *StressSumStreamServerCallStub
}
-func (s implStressSumStreamContextSend) Send(item []byte) error {
+func (s implStressSumStreamServerCallSend) Send(item []byte) error {
return s.s.Send(item)
}
diff --git a/security/agent/pingpong/wire.vdl.go b/security/agent/pingpong/wire.vdl.go
index ede4f0c..1897ee1 100644
--- a/security/agent/pingpong/wire.vdl.go
+++ b/security/agent/pingpong/wire.vdl.go
@@ -61,7 +61,7 @@
//
// Simple service used in the agent tests.
type PingPongServerMethods interface {
- Ping(ctx ipc.ServerCall, message string) (string, error)
+ Ping(call ipc.ServerCall, message string) (string, error)
}
// PingPongServerStubMethods is the server interface containing
@@ -99,8 +99,8 @@
gs *ipc.GlobState
}
-func (s implPingPongServerStub) Ping(ctx ipc.ServerCall, i0 string) (string, error) {
- return s.impl.Ping(ctx, i0)
+func (s implPingPongServerStub) Ping(call ipc.ServerCall, i0 string) (string, error) {
+ return s.impl.Ping(call, i0)
}
func (s implPingPongServerStub) Globber() *ipc.GlobState {
diff --git a/security/agent/server/server.go b/security/agent/server/server.go
index 580449b..c08d85d 100644
--- a/security/agent/server/server.go
+++ b/security/agent/server/server.go
@@ -426,20 +426,20 @@
return a.principal.Roots().DebugString(), nil
}
-func (a agentd) NotifyWhenChanged(ctx AgentNotifyWhenChangedContext) error {
+func (a agentd) NotifyWhenChanged(call AgentNotifyWhenChangedServerCall) error {
ch := a.w.register(a.id)
defer a.w.unregister(a.id, ch)
for {
select {
case <-a.ctx.Done():
return nil
- case <-ctx.Context().Done():
+ case <-call.Context().Done():
return nil
case _, ok := <-ch:
if !ok {
return nil
}
- if err := ctx.SendStream().Send(true); err != nil {
+ if err := call.SendStream().Send(true); err != nil {
return err
}
}
diff --git a/security/agent/server/wire.vdl.go b/security/agent/server/wire.vdl.go
index 401a360..5a19f30 100644
--- a/security/agent/server/wire.vdl.go
+++ b/security/agent/server/wire.vdl.go
@@ -275,21 +275,21 @@
Value() bool
Err() error
} {
- return implAgentNotifyWhenChangedCallRecv{c}
+ return implAgentNotifyWhenChangedClientCallRecv{c}
}
-type implAgentNotifyWhenChangedCallRecv struct {
+type implAgentNotifyWhenChangedClientCallRecv struct {
c *implAgentNotifyWhenChangedClientCall
}
-func (c implAgentNotifyWhenChangedCallRecv) Advance() bool {
+func (c implAgentNotifyWhenChangedClientCallRecv) Advance() bool {
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implAgentNotifyWhenChangedCallRecv) Value() bool {
+func (c implAgentNotifyWhenChangedClientCallRecv) Value() bool {
return c.c.valRecv
}
-func (c implAgentNotifyWhenChangedCallRecv) Err() error {
+func (c implAgentNotifyWhenChangedClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -303,28 +303,28 @@
// AgentServerMethods is the interface a server writer
// implements for Agent.
type AgentServerMethods interface {
- Bless(ctx ipc.ServerCall, key []byte, wit security.Blessings, extension string, caveat security.Caveat, additionalCaveats []security.Caveat) (security.Blessings, error)
- BlessSelf(ctx ipc.ServerCall, name string, caveats []security.Caveat) (security.Blessings, error)
- Sign(ctx ipc.ServerCall, message []byte) (security.Signature, error)
- MintDischarge(ctx ipc.ServerCall, forCaveat security.Caveat, caveatOnDischarge security.Caveat, additionalCaveatsOnDischarge []security.Caveat) (security.Discharge, error)
+ Bless(call ipc.ServerCall, key []byte, wit security.Blessings, extension string, caveat security.Caveat, additionalCaveats []security.Caveat) (security.Blessings, error)
+ BlessSelf(call ipc.ServerCall, name string, caveats []security.Caveat) (security.Blessings, error)
+ Sign(call ipc.ServerCall, message []byte) (security.Signature, error)
+ MintDischarge(call ipc.ServerCall, forCaveat security.Caveat, caveatOnDischarge security.Caveat, additionalCaveatsOnDischarge []security.Caveat) (security.Discharge, error)
PublicKey(ipc.ServerCall) ([]byte, error)
- BlessingsByName(ctx ipc.ServerCall, name security.BlessingPattern) ([]security.Blessings, error)
- BlessingsInfo(ctx ipc.ServerCall, blessings security.Blessings) (map[string][]security.Caveat, error)
- AddToRoots(ctx ipc.ServerCall, blessing security.Blessings) error
- BlessingStoreSet(ctx ipc.ServerCall, blessings security.Blessings, forPeers security.BlessingPattern) (security.Blessings, error)
- BlessingStoreForPeer(ctx ipc.ServerCall, peerBlessings []string) (security.Blessings, error)
- BlessingStoreSetDefault(ctx ipc.ServerCall, blessings security.Blessings) error
+ BlessingsByName(call ipc.ServerCall, name security.BlessingPattern) ([]security.Blessings, error)
+ BlessingsInfo(call ipc.ServerCall, blessings security.Blessings) (map[string][]security.Caveat, error)
+ AddToRoots(call ipc.ServerCall, blessing security.Blessings) error
+ BlessingStoreSet(call ipc.ServerCall, blessings security.Blessings, forPeers security.BlessingPattern) (security.Blessings, error)
+ BlessingStoreForPeer(call ipc.ServerCall, peerBlessings []string) (security.Blessings, error)
+ BlessingStoreSetDefault(call ipc.ServerCall, blessings security.Blessings) error
BlessingStoreDefault(ipc.ServerCall) (security.Blessings, error)
BlessingStorePeerBlessings(ipc.ServerCall) (map[security.BlessingPattern]security.Blessings, error)
BlessingStoreDebugString(ipc.ServerCall) (string, error)
- BlessingRootsAdd(ctx ipc.ServerCall, root []byte, pattern security.BlessingPattern) error
- BlessingRootsRecognized(ctx ipc.ServerCall, root []byte, blessing string) error
+ BlessingRootsAdd(call ipc.ServerCall, root []byte, pattern security.BlessingPattern) error
+ BlessingRootsRecognized(call ipc.ServerCall, root []byte, blessing string) error
BlessingRootsDebugString(ipc.ServerCall) (string, error)
// Clients using caching should call NotifyWhenChanged upon connecting to
// the server. The server will stream back values whenever the client should
// flush the cache. The streamed value is arbitrary, simply flush whenever
// recieving a new item.
- NotifyWhenChanged(AgentNotifyWhenChangedContext) error
+ NotifyWhenChanged(AgentNotifyWhenChangedServerCall) error
}
// AgentServerStubMethods is the server interface containing
@@ -332,28 +332,28 @@
// The only difference between this interface and AgentServerMethods
// is the streaming methods.
type AgentServerStubMethods interface {
- Bless(ctx ipc.ServerCall, key []byte, wit security.Blessings, extension string, caveat security.Caveat, additionalCaveats []security.Caveat) (security.Blessings, error)
- BlessSelf(ctx ipc.ServerCall, name string, caveats []security.Caveat) (security.Blessings, error)
- Sign(ctx ipc.ServerCall, message []byte) (security.Signature, error)
- MintDischarge(ctx ipc.ServerCall, forCaveat security.Caveat, caveatOnDischarge security.Caveat, additionalCaveatsOnDischarge []security.Caveat) (security.Discharge, error)
+ Bless(call ipc.ServerCall, key []byte, wit security.Blessings, extension string, caveat security.Caveat, additionalCaveats []security.Caveat) (security.Blessings, error)
+ BlessSelf(call ipc.ServerCall, name string, caveats []security.Caveat) (security.Blessings, error)
+ Sign(call ipc.ServerCall, message []byte) (security.Signature, error)
+ MintDischarge(call ipc.ServerCall, forCaveat security.Caveat, caveatOnDischarge security.Caveat, additionalCaveatsOnDischarge []security.Caveat) (security.Discharge, error)
PublicKey(ipc.ServerCall) ([]byte, error)
- BlessingsByName(ctx ipc.ServerCall, name security.BlessingPattern) ([]security.Blessings, error)
- BlessingsInfo(ctx ipc.ServerCall, blessings security.Blessings) (map[string][]security.Caveat, error)
- AddToRoots(ctx ipc.ServerCall, blessing security.Blessings) error
- BlessingStoreSet(ctx ipc.ServerCall, blessings security.Blessings, forPeers security.BlessingPattern) (security.Blessings, error)
- BlessingStoreForPeer(ctx ipc.ServerCall, peerBlessings []string) (security.Blessings, error)
- BlessingStoreSetDefault(ctx ipc.ServerCall, blessings security.Blessings) error
+ BlessingsByName(call ipc.ServerCall, name security.BlessingPattern) ([]security.Blessings, error)
+ BlessingsInfo(call ipc.ServerCall, blessings security.Blessings) (map[string][]security.Caveat, error)
+ AddToRoots(call ipc.ServerCall, blessing security.Blessings) error
+ BlessingStoreSet(call ipc.ServerCall, blessings security.Blessings, forPeers security.BlessingPattern) (security.Blessings, error)
+ BlessingStoreForPeer(call ipc.ServerCall, peerBlessings []string) (security.Blessings, error)
+ BlessingStoreSetDefault(call ipc.ServerCall, blessings security.Blessings) error
BlessingStoreDefault(ipc.ServerCall) (security.Blessings, error)
BlessingStorePeerBlessings(ipc.ServerCall) (map[security.BlessingPattern]security.Blessings, error)
BlessingStoreDebugString(ipc.ServerCall) (string, error)
- BlessingRootsAdd(ctx ipc.ServerCall, root []byte, pattern security.BlessingPattern) error
- BlessingRootsRecognized(ctx ipc.ServerCall, root []byte, blessing string) error
+ BlessingRootsAdd(call ipc.ServerCall, root []byte, pattern security.BlessingPattern) error
+ BlessingRootsRecognized(call ipc.ServerCall, root []byte, blessing string) error
BlessingRootsDebugString(ipc.ServerCall) (string, error)
// Clients using caching should call NotifyWhenChanged upon connecting to
// the server. The server will stream back values whenever the client should
// flush the cache. The streamed value is arbitrary, simply flush whenever
// recieving a new item.
- NotifyWhenChanged(*AgentNotifyWhenChangedContextStub) error
+ NotifyWhenChanged(*AgentNotifyWhenChangedServerCallStub) error
}
// AgentServerStub adds universal methods to AgentServerStubMethods.
@@ -385,76 +385,76 @@
gs *ipc.GlobState
}
-func (s implAgentServerStub) Bless(ctx ipc.ServerCall, i0 []byte, i1 security.Blessings, i2 string, i3 security.Caveat, i4 []security.Caveat) (security.Blessings, error) {
- return s.impl.Bless(ctx, i0, i1, i2, i3, i4)
+func (s implAgentServerStub) Bless(call ipc.ServerCall, i0 []byte, i1 security.Blessings, i2 string, i3 security.Caveat, i4 []security.Caveat) (security.Blessings, error) {
+ return s.impl.Bless(call, i0, i1, i2, i3, i4)
}
-func (s implAgentServerStub) BlessSelf(ctx ipc.ServerCall, i0 string, i1 []security.Caveat) (security.Blessings, error) {
- return s.impl.BlessSelf(ctx, i0, i1)
+func (s implAgentServerStub) BlessSelf(call ipc.ServerCall, i0 string, i1 []security.Caveat) (security.Blessings, error) {
+ return s.impl.BlessSelf(call, i0, i1)
}
-func (s implAgentServerStub) Sign(ctx ipc.ServerCall, i0 []byte) (security.Signature, error) {
- return s.impl.Sign(ctx, i0)
+func (s implAgentServerStub) Sign(call ipc.ServerCall, i0 []byte) (security.Signature, error) {
+ return s.impl.Sign(call, i0)
}
-func (s implAgentServerStub) MintDischarge(ctx ipc.ServerCall, i0 security.Caveat, i1 security.Caveat, i2 []security.Caveat) (security.Discharge, error) {
- return s.impl.MintDischarge(ctx, i0, i1, i2)
+func (s implAgentServerStub) MintDischarge(call ipc.ServerCall, i0 security.Caveat, i1 security.Caveat, i2 []security.Caveat) (security.Discharge, error) {
+ return s.impl.MintDischarge(call, i0, i1, i2)
}
-func (s implAgentServerStub) PublicKey(ctx ipc.ServerCall) ([]byte, error) {
- return s.impl.PublicKey(ctx)
+func (s implAgentServerStub) PublicKey(call ipc.ServerCall) ([]byte, error) {
+ return s.impl.PublicKey(call)
}
-func (s implAgentServerStub) BlessingsByName(ctx ipc.ServerCall, i0 security.BlessingPattern) ([]security.Blessings, error) {
- return s.impl.BlessingsByName(ctx, i0)
+func (s implAgentServerStub) BlessingsByName(call ipc.ServerCall, i0 security.BlessingPattern) ([]security.Blessings, error) {
+ return s.impl.BlessingsByName(call, i0)
}
-func (s implAgentServerStub) BlessingsInfo(ctx ipc.ServerCall, i0 security.Blessings) (map[string][]security.Caveat, error) {
- return s.impl.BlessingsInfo(ctx, i0)
+func (s implAgentServerStub) BlessingsInfo(call ipc.ServerCall, i0 security.Blessings) (map[string][]security.Caveat, error) {
+ return s.impl.BlessingsInfo(call, i0)
}
-func (s implAgentServerStub) AddToRoots(ctx ipc.ServerCall, i0 security.Blessings) error {
- return s.impl.AddToRoots(ctx, i0)
+func (s implAgentServerStub) AddToRoots(call ipc.ServerCall, i0 security.Blessings) error {
+ return s.impl.AddToRoots(call, i0)
}
-func (s implAgentServerStub) BlessingStoreSet(ctx ipc.ServerCall, i0 security.Blessings, i1 security.BlessingPattern) (security.Blessings, error) {
- return s.impl.BlessingStoreSet(ctx, i0, i1)
+func (s implAgentServerStub) BlessingStoreSet(call ipc.ServerCall, i0 security.Blessings, i1 security.BlessingPattern) (security.Blessings, error) {
+ return s.impl.BlessingStoreSet(call, i0, i1)
}
-func (s implAgentServerStub) BlessingStoreForPeer(ctx ipc.ServerCall, i0 []string) (security.Blessings, error) {
- return s.impl.BlessingStoreForPeer(ctx, i0)
+func (s implAgentServerStub) BlessingStoreForPeer(call ipc.ServerCall, i0 []string) (security.Blessings, error) {
+ return s.impl.BlessingStoreForPeer(call, i0)
}
-func (s implAgentServerStub) BlessingStoreSetDefault(ctx ipc.ServerCall, i0 security.Blessings) error {
- return s.impl.BlessingStoreSetDefault(ctx, i0)
+func (s implAgentServerStub) BlessingStoreSetDefault(call ipc.ServerCall, i0 security.Blessings) error {
+ return s.impl.BlessingStoreSetDefault(call, i0)
}
-func (s implAgentServerStub) BlessingStoreDefault(ctx ipc.ServerCall) (security.Blessings, error) {
- return s.impl.BlessingStoreDefault(ctx)
+func (s implAgentServerStub) BlessingStoreDefault(call ipc.ServerCall) (security.Blessings, error) {
+ return s.impl.BlessingStoreDefault(call)
}
-func (s implAgentServerStub) BlessingStorePeerBlessings(ctx ipc.ServerCall) (map[security.BlessingPattern]security.Blessings, error) {
- return s.impl.BlessingStorePeerBlessings(ctx)
+func (s implAgentServerStub) BlessingStorePeerBlessings(call ipc.ServerCall) (map[security.BlessingPattern]security.Blessings, error) {
+ return s.impl.BlessingStorePeerBlessings(call)
}
-func (s implAgentServerStub) BlessingStoreDebugString(ctx ipc.ServerCall) (string, error) {
- return s.impl.BlessingStoreDebugString(ctx)
+func (s implAgentServerStub) BlessingStoreDebugString(call ipc.ServerCall) (string, error) {
+ return s.impl.BlessingStoreDebugString(call)
}
-func (s implAgentServerStub) BlessingRootsAdd(ctx ipc.ServerCall, i0 []byte, i1 security.BlessingPattern) error {
- return s.impl.BlessingRootsAdd(ctx, i0, i1)
+func (s implAgentServerStub) BlessingRootsAdd(call ipc.ServerCall, i0 []byte, i1 security.BlessingPattern) error {
+ return s.impl.BlessingRootsAdd(call, i0, i1)
}
-func (s implAgentServerStub) BlessingRootsRecognized(ctx ipc.ServerCall, i0 []byte, i1 string) error {
- return s.impl.BlessingRootsRecognized(ctx, i0, i1)
+func (s implAgentServerStub) BlessingRootsRecognized(call ipc.ServerCall, i0 []byte, i1 string) error {
+ return s.impl.BlessingRootsRecognized(call, i0, i1)
}
-func (s implAgentServerStub) BlessingRootsDebugString(ctx ipc.ServerCall) (string, error) {
- return s.impl.BlessingRootsDebugString(ctx)
+func (s implAgentServerStub) BlessingRootsDebugString(call ipc.ServerCall) (string, error) {
+ return s.impl.BlessingRootsDebugString(call)
}
-func (s implAgentServerStub) NotifyWhenChanged(ctx *AgentNotifyWhenChangedContextStub) error {
- return s.impl.NotifyWhenChanged(ctx)
+func (s implAgentServerStub) NotifyWhenChanged(call *AgentNotifyWhenChangedServerCallStub) error {
+ return s.impl.NotifyWhenChanged(call)
}
func (s implAgentServerStub) Globber() *ipc.GlobState {
@@ -627,34 +627,34 @@
}
}
-// AgentNotifyWhenChangedContext represents the context passed to Agent.NotifyWhenChanged.
-type AgentNotifyWhenChangedContext interface {
+// AgentNotifyWhenChangedServerCall represents the context passed to Agent.NotifyWhenChanged.
+type AgentNotifyWhenChangedServerCall interface {
ipc.ServerCall
AgentNotifyWhenChangedServerStream
}
-// AgentNotifyWhenChangedContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements AgentNotifyWhenChangedContext.
-type AgentNotifyWhenChangedContextStub struct {
+// AgentNotifyWhenChangedServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements AgentNotifyWhenChangedServerCall.
+type AgentNotifyWhenChangedServerCallStub struct {
ipc.StreamServerCall
}
-// Init initializes AgentNotifyWhenChangedContextStub from ipc.StreamServerCall.
-func (s *AgentNotifyWhenChangedContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes AgentNotifyWhenChangedServerCallStub from ipc.StreamServerCall.
+func (s *AgentNotifyWhenChangedServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// SendStream returns the send side of the Agent.NotifyWhenChanged server stream.
-func (s *AgentNotifyWhenChangedContextStub) SendStream() interface {
+func (s *AgentNotifyWhenChangedServerCallStub) SendStream() interface {
Send(item bool) error
} {
- return implAgentNotifyWhenChangedContextSend{s}
+ return implAgentNotifyWhenChangedServerCallSend{s}
}
-type implAgentNotifyWhenChangedContextSend struct {
- s *AgentNotifyWhenChangedContextStub
+type implAgentNotifyWhenChangedServerCallSend struct {
+ s *AgentNotifyWhenChangedServerCallStub
}
-func (s implAgentNotifyWhenChangedContextSend) Send(item bool) error {
+func (s implAgentNotifyWhenChangedServerCallSend) Send(item bool) error {
return s.s.Send(item)
}
diff --git a/services/identity/identity.vdl.go b/services/identity/identity.vdl.go
index 46ed9a3..9243b32 100644
--- a/services/identity/identity.vdl.go
+++ b/services/identity/identity.vdl.go
@@ -93,7 +93,7 @@
type OAuthBlesserServerMethods interface {
// BlessUsingAccessToken uses the provided access token to obtain the email
// address and returns a blessing along with the email address.
- BlessUsingAccessToken(ctx ipc.ServerCall, token string) (blessing security.Blessings, email string, err error)
+ BlessUsingAccessToken(call ipc.ServerCall, token string) (blessing security.Blessings, email string, err error)
}
// OAuthBlesserServerStubMethods is the server interface containing
@@ -131,8 +131,8 @@
gs *ipc.GlobState
}
-func (s implOAuthBlesserServerStub) BlessUsingAccessToken(ctx ipc.ServerCall, i0 string) (security.Blessings, string, error) {
- return s.impl.BlessUsingAccessToken(ctx, i0)
+func (s implOAuthBlesserServerStub) BlessUsingAccessToken(call ipc.ServerCall, i0 string) (security.Blessings, string, error) {
+ return s.impl.BlessUsingAccessToken(call, i0)
}
func (s implOAuthBlesserServerStub) Globber() *ipc.GlobState {
@@ -221,7 +221,7 @@
type MacaroonBlesserServerMethods interface {
// Bless uses the provided macaroon (which contains email and caveats)
// to return a blessing for the client.
- Bless(ctx ipc.ServerCall, macaroon string) (blessing security.Blessings, err error)
+ Bless(call ipc.ServerCall, macaroon string) (blessing security.Blessings, err error)
}
// MacaroonBlesserServerStubMethods is the server interface containing
@@ -259,8 +259,8 @@
gs *ipc.GlobState
}
-func (s implMacaroonBlesserServerStub) Bless(ctx ipc.ServerCall, i0 string) (security.Blessings, error) {
- return s.impl.Bless(ctx, i0)
+func (s implMacaroonBlesserServerStub) Bless(call ipc.ServerCall, i0 string) (security.Blessings, error) {
+ return s.impl.Bless(call, i0)
}
func (s implMacaroonBlesserServerStub) Globber() *ipc.GlobState {
diff --git a/services/mgmt/binary/impl/service.go b/services/mgmt/binary/impl/service.go
index e258c30..75b4a98 100644
--- a/services/mgmt/binary/impl/service.go
+++ b/services/mgmt/binary/impl/service.go
@@ -217,7 +217,7 @@
return nil
}
-func (i *binaryService) Download(context repository.BinaryDownloadContext, part int32) error {
+func (i *binaryService) Download(call repository.BinaryDownloadServerCall, part int32) error {
vlog.Infof("%v.Download(%v)", i.suffix, part)
path := i.generatePartPath(int(part))
if err := checksumExists(path); err != nil {
@@ -227,23 +227,23 @@
file, err := os.Open(dataPath)
if err != nil {
vlog.Errorf("Open(%v) failed: %v", dataPath, err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
defer file.Close()
buffer := make([]byte, BufferLength)
- sender := context.SendStream()
+ sender := call.SendStream()
for {
n, err := file.Read(buffer)
if err != nil && err != io.EOF {
vlog.Errorf("Read() failed: %v", err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
if n == 0 {
break
}
if err := sender.Send(buffer[:n]); err != nil {
vlog.Errorf("Send() failed: %v", err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
}
return nil
@@ -300,12 +300,12 @@
return result, mediaInfo, nil
}
-func (i *binaryService) Upload(context repository.BinaryUploadContext, part int32) error {
+func (i *binaryService) Upload(call repository.BinaryUploadServerCall, part int32) error {
vlog.Infof("%v.Upload(%v)", i.suffix, part)
path, suffix := i.generatePartPath(int(part)), ""
err := checksumExists(path)
if err == nil {
- return verror.New(verror.ErrExist, context.Context(), path)
+ return verror.New(verror.ErrExist, call.Context(), path)
} else if !verror.Is(err, verror.ErrNoExist.ID) {
return err
}
@@ -314,21 +314,21 @@
lockFile, err := os.OpenFile(lockPath, flags, perm)
if err != nil {
if os.IsExist(err) {
- return verror.New(ErrInProgress, context.Context(), path)
+ return verror.New(ErrInProgress, call.Context(), path)
}
vlog.Errorf("OpenFile(%v, %v, %v) failed: %v", lockPath, flags, suffix, err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
defer os.Remove(lockFile.Name())
defer lockFile.Close()
file, err := ioutil.TempFile(path, suffix)
if err != nil {
vlog.Errorf("TempFile(%v, %v) failed: %v", path, suffix, err)
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
defer file.Close()
h := md5.New()
- rStream := context.RecvStream()
+ rStream := call.RecvStream()
for rStream.Advance() {
bytes := rStream.Value()
if _, err := file.Write(bytes); err != nil {
@@ -336,7 +336,7 @@
if err := os.Remove(file.Name()); err != nil {
vlog.Errorf("Remove(%v) failed: %v", file.Name(), err)
}
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
h.Write(bytes)
}
@@ -346,7 +346,7 @@
if err := os.Remove(file.Name()); err != nil {
vlog.Errorf("Remove(%v) failed: %v", file.Name(), err)
}
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
hash := hex.EncodeToString(h.Sum(nil))
@@ -356,7 +356,7 @@
if err := os.Remove(file.Name()); err != nil {
vlog.Errorf("Remove(%v) failed: %v", file.Name(), err)
}
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
dataFile := filepath.Join(path, dataFileName)
if err := os.Rename(file.Name(), dataFile); err != nil {
@@ -364,7 +364,7 @@
if err := os.Remove(file.Name()); err != nil {
vlog.Errorf("Remove(%v) failed: %v", file.Name(), err)
}
- return verror.New(ErrOperationFailed, context.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
return nil
}
diff --git a/services/mgmt/build/impl/service.go b/services/mgmt/build/impl/service.go
index a35224b..757f987 100644
--- a/services/mgmt/build/impl/service.go
+++ b/services/mgmt/build/impl/service.go
@@ -42,14 +42,14 @@
//
// TODO(jsimsa): Analyze the binary files for shared library
// dependencies and ship these back.
-func (i *builderService) Build(ctx build.BuilderBuildContext, arch build.Architecture, opsys build.OperatingSystem) ([]byte, error) {
+func (i *builderService) Build(call build.BuilderBuildServerCall, arch build.Architecture, opsys build.OperatingSystem) ([]byte, error) {
vlog.VI(1).Infof("Build(%v, %v) called.", arch, opsys)
dir, prefix := "", ""
dirPerm, filePerm := os.FileMode(0700), os.FileMode(0600)
root, err := ioutil.TempDir(dir, prefix)
if err != nil {
vlog.Errorf("TempDir(%v, %v) failed: %v", dir, prefix, err)
- return nil, verror.New(verror.ErrInternal, ctx.Context())
+ return nil, verror.New(verror.ErrInternal, call.Context())
}
defer os.RemoveAll(root)
if err := os.Chdir(root); err != nil {
@@ -58,25 +58,25 @@
srcDir := filepath.Join(root, "go", "src")
if err := os.MkdirAll(srcDir, dirPerm); err != nil {
vlog.Errorf("MkdirAll(%v, %v) failed: %v", srcDir, dirPerm, err)
- return nil, verror.New(verror.ErrInternal, ctx.Context())
+ return nil, verror.New(verror.ErrInternal, call.Context())
}
- iterator := ctx.RecvStream()
+ iterator := call.RecvStream()
for iterator.Advance() {
srcFile := iterator.Value()
filePath := filepath.Join(srcDir, filepath.FromSlash(srcFile.Name))
dir := filepath.Dir(filePath)
if err := os.MkdirAll(dir, dirPerm); err != nil {
vlog.Errorf("MkdirAll(%v, %v) failed: %v", dir, dirPerm, err)
- return nil, verror.New(verror.ErrInternal, ctx.Context())
+ return nil, verror.New(verror.ErrInternal, call.Context())
}
if err := ioutil.WriteFile(filePath, srcFile.Contents, filePerm); err != nil {
vlog.Errorf("WriteFile(%v, %v) failed: %v", filePath, filePerm, err)
- return nil, verror.New(verror.ErrInternal, ctx.Context())
+ return nil, verror.New(verror.ErrInternal, call.Context())
}
}
if err := iterator.Err(); err != nil {
vlog.Errorf("Advance() failed: %v", err)
- return nil, verror.New(verror.ErrInternal, ctx.Context())
+ return nil, verror.New(verror.ErrInternal, call.Context())
}
cmd := exec.Command(i.gobin, "install", "-v", "./...")
cmd.Env = append(cmd.Env, "GOARCH="+string(arch))
@@ -93,7 +93,7 @@
if output.Len() != 0 {
vlog.Errorf("%v", output.String())
}
- return output.Bytes(), verror.New(errBuildFailed, ctx.Context())
+ return output.Bytes(), verror.New(errBuildFailed, call.Context())
}
binDir := filepath.Join(root, "go", "bin")
if runtime.GOARCH != string(arch) || runtime.GOOS != string(opsys) {
@@ -102,22 +102,22 @@
files, err := ioutil.ReadDir(binDir)
if err != nil && !os.IsNotExist(err) {
vlog.Errorf("ReadDir(%v) failed: %v", binDir, err)
- return nil, verror.New(verror.ErrInternal, ctx.Context())
+ return nil, verror.New(verror.ErrInternal, call.Context())
}
for _, file := range files {
binPath := filepath.Join(binDir, file.Name())
bytes, err := ioutil.ReadFile(binPath)
if err != nil {
vlog.Errorf("ReadFile(%v) failed: %v", binPath, err)
- return nil, verror.New(verror.ErrInternal, ctx.Context())
+ return nil, verror.New(verror.ErrInternal, call.Context())
}
result := build.File{
Name: "bin/" + file.Name(),
Contents: bytes,
}
- if err := ctx.SendStream().Send(result); err != nil {
+ if err := call.SendStream().Send(result); err != nil {
vlog.Errorf("Send() failed: %v", err)
- return nil, verror.New(verror.ErrInternal, ctx.Context())
+ return nil, verror.New(verror.ErrInternal, call.Context())
}
}
return output.Bytes(), nil
diff --git a/services/mgmt/device/config.vdl.go b/services/mgmt/device/config.vdl.go
index e9c48a9..a087027 100644
--- a/services/mgmt/device/config.vdl.go
+++ b/services/mgmt/device/config.vdl.go
@@ -63,7 +63,7 @@
// Config is an RPC API to the config service.
type ConfigServerMethods interface {
// Set sets the value for key.
- Set(ctx ipc.ServerCall, key string, value string) error
+ Set(call ipc.ServerCall, key string, value string) error
}
// ConfigServerStubMethods is the server interface containing
@@ -101,8 +101,8 @@
gs *ipc.GlobState
}
-func (s implConfigServerStub) Set(ctx ipc.ServerCall, i0 string, i1 string) error {
- return s.impl.Set(ctx, i0, i1)
+func (s implConfigServerStub) Set(call ipc.ServerCall, i0 string, i1 string) error {
+ return s.impl.Set(call, i0, i1)
}
func (s implConfigServerStub) Globber() *ipc.GlobState {
diff --git a/services/mgmt/device/impl/mock_repo_test.go b/services/mgmt/device/impl/mock_repo_test.go
index 834474b..8eb3e4e 100644
--- a/services/mgmt/device/impl/mock_repo_test.go
+++ b/services/mgmt/device/impl/mock_repo_test.go
@@ -117,17 +117,17 @@
return nil
}
-func (i *brInvoker) Download(ctx repository.BinaryDownloadContext, _ int32) error {
+func (i *brInvoker) Download(call repository.BinaryDownloadServerCall, _ int32) error {
vlog.VI(1).Infof("Download()")
file, err := os.Open(os.Args[0])
if err != nil {
vlog.Errorf("Open() failed: %v", err)
- return verror.New(ErrOperationFailed, ctx.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
defer file.Close()
bufferLength := 4096
buffer := make([]byte, bufferLength)
- sender := ctx.SendStream()
+ sender := call.SendStream()
for {
n, err := file.Read(buffer)
switch err {
@@ -136,11 +136,11 @@
case nil:
if err := sender.Send(buffer[:n]); err != nil {
vlog.Errorf("Send() failed: %v", err)
- return verror.New(ErrOperationFailed, ctx.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
default:
vlog.Errorf("Read() failed: %v", err)
- return verror.New(ErrOperationFailed, ctx.Context())
+ return verror.New(ErrOperationFailed, call.Context())
}
}
}
@@ -162,7 +162,7 @@
return []binary.PartInfo{part}, repository.MediaInfo{Type: "application/octet-stream"}, nil
}
-func (i *brInvoker) Upload(repository.BinaryUploadContext, int32) error {
+func (i *brInvoker) Upload(repository.BinaryUploadServerCall, int32) error {
vlog.VI(1).Infof("Upload()")
return nil
}
diff --git a/services/mgmt/logreader/impl/logfile.go b/services/mgmt/logreader/impl/logfile.go
index 6013859..b3f536b 100644
--- a/services/mgmt/logreader/impl/logfile.go
+++ b/services/mgmt/logreader/impl/logfile.go
@@ -74,7 +74,7 @@
}
// ReadLog returns log entries from the log file.
-func (i *logfileService) ReadLog(ctx logreader.LogFileReadLogContext, startpos int64, numEntries int32, follow bool) (int64, error) {
+func (i *logfileService) ReadLog(call logreader.LogFileReadLogServerCall, startpos int64, numEntries int32, follow bool) (int64, error) {
vlog.VI(1).Infof("%v.ReadLog(%v, %v, %v)", i.suffix, startpos, numEntries, follow)
fname, err := translateNameToFilename(i.root, i.suffix)
if err != nil {
@@ -83,11 +83,11 @@
f, err := os.Open(fname)
if err != nil {
if os.IsNotExist(err) {
- return 0, verror.New(verror.ErrNoExist, ctx.Context(), fname)
+ return 0, verror.New(verror.ErrNoExist, call.Context(), fname)
}
- return 0, verror.New(errOperationFailed, ctx.Context(), fname)
+ return 0, verror.New(errOperationFailed, call.Context(), fname)
}
- reader := newFollowReader(ctx, f, startpos, follow)
+ reader := newFollowReader(call, f, startpos, follow)
if numEntries == types.AllEntries {
numEntries = int32(math.MaxInt32)
}
@@ -97,12 +97,12 @@
return reader.tell(), nil
}
if err == io.EOF {
- return reader.tell(), types.NewErrEOF(ctx.Context())
+ return reader.tell(), types.NewErrEOF(call.Context())
}
if err != nil {
- return reader.tell(), verror.New(errOperationFailed, ctx.Context(), fname)
+ return reader.tell(), verror.New(errOperationFailed, call.Context(), fname)
}
- if err := ctx.SendStream().Send(types.LogEntry{Position: offset, Line: line}); err != nil {
+ if err := call.SendStream().Send(types.LogEntry{Position: offset, Line: line}); err != nil {
return reader.tell(), err
}
}
diff --git a/services/mgmt/pprof/impl/server.go b/services/mgmt/pprof/impl/server.go
index 2a4fbc5..d83cf04 100644
--- a/services/mgmt/pprof/impl/server.go
+++ b/services/mgmt/pprof/impl/server.go
@@ -48,25 +48,25 @@
// addresses that pprof needs. Passing debug=1 adds comments translating
// addresses to function names and line numbers, so that a programmer
// can read the profile without tools.
-func (pprofService) Profile(ctx spprof.PProfProfileContext, name string, debug int32) error {
+func (pprofService) Profile(call spprof.PProfProfileServerCall, name string, debug int32) error {
profile := pprof.Lookup(name)
if profile == nil {
- return verror.New(errNoProfile, ctx.Context(), name)
+ return verror.New(errNoProfile, call.Context(), name)
}
- if err := profile.WriteTo(&streamWriter{ctx.SendStream()}, int(debug)); err != nil {
- return verror.Convert(verror.ErrUnknown, ctx.Context(), err)
+ if err := profile.WriteTo(&streamWriter{call.SendStream()}, int(debug)); err != nil {
+ return verror.Convert(verror.ErrUnknown, call.Context(), err)
}
return nil
}
// CPUProfile enables CPU profiling for the requested duration and
// streams the profile data.
-func (pprofService) CPUProfile(ctx spprof.PProfCPUProfileContext, seconds int32) error {
+func (pprofService) CPUProfile(call spprof.PProfCPUProfileServerCall, seconds int32) error {
if seconds <= 0 || seconds > 3600 {
- return verror.New(errInvalidSeconds, ctx.Context(), seconds)
+ return verror.New(errInvalidSeconds, call.Context(), seconds)
}
- if err := pprof.StartCPUProfile(&streamWriter{ctx.SendStream()}); err != nil {
- return verror.Convert(verror.ErrUnknown, ctx.Context(), err)
+ if err := pprof.StartCPUProfile(&streamWriter{call.SendStream()}); err != nil {
+ return verror.Convert(verror.ErrUnknown, call.Context(), err)
}
time.Sleep(time.Duration(seconds) * time.Second)
pprof.StopCPUProfile()
diff --git a/services/mgmt/repository/repository.vdl.go b/services/mgmt/repository/repository.vdl.go
index 68122fd..d3c3fa6 100644
--- a/services/mgmt/repository/repository.vdl.go
+++ b/services/mgmt/repository/repository.vdl.go
@@ -122,7 +122,7 @@
// Put adds the given tuple of application version (specified
// through the object name suffix) and application envelope to all
// of the given application profiles.
- Put(ctx ipc.ServerCall, Profiles []string, Envelope application.Envelope) error
+ Put(call ipc.ServerCall, Profiles []string, Envelope application.Envelope) error
// Remove removes the application envelope for the given profile
// name and application version (specified through the object name
// suffix). If no version is specified as part of the suffix, the
@@ -130,7 +130,7 @@
//
// TODO(jsimsa): Add support for using "*" to specify all profiles
// when Matt implements Globing (or Ken implements querying).
- Remove(ctx ipc.ServerCall, Profile string) error
+ Remove(call ipc.ServerCall, Profile string) error
}
// ApplicationServerStubMethods is the server interface containing
@@ -170,12 +170,12 @@
gs *ipc.GlobState
}
-func (s implApplicationServerStub) Put(ctx ipc.ServerCall, i0 []string, i1 application.Envelope) error {
- return s.impl.Put(ctx, i0, i1)
+func (s implApplicationServerStub) Put(call ipc.ServerCall, i0 []string, i1 application.Envelope) error {
+ return s.impl.Put(call, i0, i1)
}
-func (s implApplicationServerStub) Remove(ctx ipc.ServerCall, i0 string) error {
- return s.impl.Remove(ctx, i0)
+func (s implApplicationServerStub) Remove(call ipc.ServerCall, i0 string) error {
+ return s.impl.Remove(call, i0)
}
func (s implApplicationServerStub) Globber() *ipc.GlobState {
@@ -314,7 +314,7 @@
Specification(ipc.ServerCall) (profile.Specification, error)
// Put sets the profile specification for the profile identified
// through the object name suffix.
- Put(ctx ipc.ServerCall, Specification profile.Specification) error
+ Put(call ipc.ServerCall, Specification profile.Specification) error
// Remove removes the profile specification for the profile
// identified through the object name suffix.
Remove(ipc.ServerCall) error
@@ -357,16 +357,16 @@
gs *ipc.GlobState
}
-func (s implProfileServerStub) Specification(ctx ipc.ServerCall) (profile.Specification, error) {
- return s.impl.Specification(ctx)
+func (s implProfileServerStub) Specification(call ipc.ServerCall) (profile.Specification, error) {
+ return s.impl.Specification(call)
}
-func (s implProfileServerStub) Put(ctx ipc.ServerCall, i0 profile.Specification) error {
- return s.impl.Put(ctx, i0)
+func (s implProfileServerStub) Put(call ipc.ServerCall, i0 profile.Specification) error {
+ return s.impl.Put(call, i0)
}
-func (s implProfileServerStub) Remove(ctx ipc.ServerCall) error {
- return s.impl.Remove(ctx)
+func (s implProfileServerStub) Remove(call ipc.ServerCall) error {
+ return s.impl.Remove(call)
}
func (s implProfileServerStub) Globber() *ipc.GlobState {
diff --git a/services/mgmt/stats/impl/stats.go b/services/mgmt/stats/impl/stats.go
index caf1ee6..32abd7c 100644
--- a/services/mgmt/stats/impl/stats.go
+++ b/services/mgmt/stats/impl/stats.go
@@ -55,7 +55,7 @@
// WatchGlob returns the name and value of the objects that match the request,
// followed by periodic updates when values change.
-func (i *statsService) WatchGlob(ctx watch.GlobWatcherWatchGlobContext, req watchtypes.GlobRequest) error {
+func (i *statsService) WatchGlob(call watch.GlobWatcherWatchGlobServerCall, req watchtypes.GlobRequest) error {
vlog.VI(1).Infof("%v.WatchGlob(%+v)", i.suffix, req)
var t time.Time
@@ -76,17 +76,17 @@
}
if err := it.Err(); err != nil {
if err == libstats.ErrNotFound {
- return verror.New(verror.ErrNoExist, ctx.Context(), i.suffix)
+ return verror.New(verror.ErrNoExist, call.Context(), i.suffix)
}
- return verror.New(errOperationFailed, ctx.Context(), i.suffix)
+ return verror.New(errOperationFailed, call.Context(), i.suffix)
}
for _, change := range changes {
- if err := ctx.SendStream().Send(change); err != nil {
+ if err := call.SendStream().Send(change); err != nil {
return err
}
}
select {
- case <-ctx.Context().Done():
+ case <-call.Context().Done():
break Loop
case <-time.After(i.watchFreq):
}
diff --git a/services/mgmt/vtrace/impl/vtrace.go b/services/mgmt/vtrace/impl/vtrace.go
index 3f33148..c344825 100644
--- a/services/mgmt/vtrace/impl/vtrace.go
+++ b/services/mgmt/vtrace/impl/vtrace.go
@@ -19,13 +19,13 @@
return *tr, nil
}
-func (v *vtraceService) AllTraces(ctx svtrace.StoreAllTracesContext) error {
+func (v *vtraceService) AllTraces(call svtrace.StoreAllTracesServerCall) error {
// TODO(mattr): Consider changing the store to allow us to iterate through traces
// when there are many.
- store := vtrace.GetStore(ctx.Context())
+ store := vtrace.GetStore(call.Context())
traces := store.TraceRecords()
for i := range traces {
- if err := ctx.SendStream().Send(traces[i]); err != nil {
+ if err := call.SendStream().Send(traces[i]); err != nil {
return err
}
}
diff --git a/services/mounttable/lib/collection_test_interface.vdl.go b/services/mounttable/lib/collection_test_interface.vdl.go
index 493f246..4d4a232 100644
--- a/services/mounttable/lib/collection_test_interface.vdl.go
+++ b/services/mounttable/lib/collection_test_interface.vdl.go
@@ -77,7 +77,7 @@
// an entry exists, if Overwrite is true, then the binding is replaced,
// otherwise the call fails with an error. The Val must be no larger than
// MaxSize bytes.
- Export(ctx ipc.ServerCall, Val string, Overwrite bool) error
+ Export(call ipc.ServerCall, Val string, Overwrite bool) error
// Lookup retrieves the value associated with a name. Returns an error if
// there is no such binding.
Lookup(ipc.ServerCall) ([]byte, error)
@@ -118,12 +118,12 @@
gs *ipc.GlobState
}
-func (s implCollectionServerStub) Export(ctx ipc.ServerCall, i0 string, i1 bool) error {
- return s.impl.Export(ctx, i0, i1)
+func (s implCollectionServerStub) Export(call ipc.ServerCall, i0 string, i1 bool) error {
+ return s.impl.Export(call, i0, i1)
}
-func (s implCollectionServerStub) Lookup(ctx ipc.ServerCall) ([]byte, error) {
- return s.impl.Lookup(ctx)
+func (s implCollectionServerStub) Lookup(call ipc.ServerCall) ([]byte, error) {
+ return s.impl.Lookup(call)
}
func (s implCollectionServerStub) Globber() *ipc.GlobState {
diff --git a/services/security/discharger.vdl.go b/services/security/discharger.vdl.go
index 3ea61b1..8c53b45 100644
--- a/services/security/discharger.vdl.go
+++ b/services/security/discharger.vdl.go
@@ -70,7 +70,7 @@
// Discharge is called by a principal that holds a blessing with a third
// party caveat and seeks to get a discharge that proves the fulfillment of
// this caveat.
- Discharge(ctx ipc.ServerCall, Caveat security.Caveat, Impetus security.DischargeImpetus) (Discharge security.Discharge, err error)
+ Discharge(call ipc.ServerCall, Caveat security.Caveat, Impetus security.DischargeImpetus) (Discharge security.Discharge, err error)
}
// DischargerServerStubMethods is the server interface containing
@@ -108,8 +108,8 @@
gs *ipc.GlobState
}
-func (s implDischargerServerStub) Discharge(ctx ipc.ServerCall, i0 security.Caveat, i1 security.DischargeImpetus) (security.Discharge, error) {
- return s.impl.Discharge(ctx, i0, i1)
+func (s implDischargerServerStub) Discharge(call ipc.ServerCall, i0 security.Caveat, i1 security.DischargeImpetus) (security.Discharge, error) {
+ return s.impl.Discharge(call, i0, i1)
}
func (s implDischargerServerStub) Globber() *ipc.GlobState {
diff --git a/services/wsprd/app/controller.vdl.go b/services/wsprd/app/controller.vdl.go
index 61951f1..73e5e3d 100644
--- a/services/wsprd/app/controller.vdl.go
+++ b/services/wsprd/app/controller.vdl.go
@@ -156,24 +156,24 @@
type ControllerServerMethods interface {
// Serve instructs WSPR to start listening for calls on behalf
// of a javascript server.
- Serve(ctx ipc.ServerCall, name string, serverId uint32) error
+ Serve(call ipc.ServerCall, name string, serverId uint32) error
// Stop instructs WSPR to stop listening for calls for the
// given javascript server.
- Stop(ctx ipc.ServerCall, serverId uint32) error
+ Stop(call ipc.ServerCall, serverId uint32) error
// AddName adds a published name to an existing server.
- AddName(ctx ipc.ServerCall, serverId uint32, name string) error
+ AddName(call ipc.ServerCall, serverId uint32, name string) error
// RemoveName removes a published name from an existing server.
- RemoveName(ctx ipc.ServerCall, serverId uint32, name string) error
+ RemoveName(call ipc.ServerCall, serverId uint32, name string) error
// UnlinkJSBlessings removes the given blessings from the blessings store.
- UnlinkJSBlessings(ctx ipc.ServerCall, handle int32) error
+ UnlinkJSBlessings(call ipc.ServerCall, handle int32) error
// BlessPublicKey creates a new blessing.
- BlessPublicKey(ctx ipc.ServerCall, fromHandle int32, caveats []security.Caveat, durationMs time.Duration, extension string) (handle int32, publicKey string, err error)
+ BlessPublicKey(call ipc.ServerCall, fromHandle int32, caveats []security.Caveat, durationMs time.Duration, extension string) (handle int32, publicKey string, err error)
// CreateBlessings creates a new principal self-blessed with the given extension.
- CreateBlessings(ctx ipc.ServerCall, extension string) (handle int32, publicKey string, err error)
+ CreateBlessings(call ipc.ServerCall, extension string) (handle int32, publicKey string, err error)
// RemoteBlessings fetches the remote blessings for a given name and method.
- RemoteBlessings(ctx ipc.ServerCall, name string, method string) ([]string, error)
+ RemoteBlessings(call ipc.ServerCall, name string, method string) ([]string, error)
// Signature fetches the signature for a given name.
- Signature(ctx ipc.ServerCall, name string) ([]signature.Interface, error)
+ Signature(call ipc.ServerCall, name string) ([]signature.Interface, error)
}
// ControllerServerStubMethods is the server interface containing
@@ -211,40 +211,40 @@
gs *ipc.GlobState
}
-func (s implControllerServerStub) Serve(ctx ipc.ServerCall, i0 string, i1 uint32) error {
- return s.impl.Serve(ctx, i0, i1)
+func (s implControllerServerStub) Serve(call ipc.ServerCall, i0 string, i1 uint32) error {
+ return s.impl.Serve(call, i0, i1)
}
-func (s implControllerServerStub) Stop(ctx ipc.ServerCall, i0 uint32) error {
- return s.impl.Stop(ctx, i0)
+func (s implControllerServerStub) Stop(call ipc.ServerCall, i0 uint32) error {
+ return s.impl.Stop(call, i0)
}
-func (s implControllerServerStub) AddName(ctx ipc.ServerCall, i0 uint32, i1 string) error {
- return s.impl.AddName(ctx, i0, i1)
+func (s implControllerServerStub) AddName(call ipc.ServerCall, i0 uint32, i1 string) error {
+ return s.impl.AddName(call, i0, i1)
}
-func (s implControllerServerStub) RemoveName(ctx ipc.ServerCall, i0 uint32, i1 string) error {
- return s.impl.RemoveName(ctx, i0, i1)
+func (s implControllerServerStub) RemoveName(call ipc.ServerCall, i0 uint32, i1 string) error {
+ return s.impl.RemoveName(call, i0, i1)
}
-func (s implControllerServerStub) UnlinkJSBlessings(ctx ipc.ServerCall, i0 int32) error {
- return s.impl.UnlinkJSBlessings(ctx, i0)
+func (s implControllerServerStub) UnlinkJSBlessings(call ipc.ServerCall, i0 int32) error {
+ return s.impl.UnlinkJSBlessings(call, i0)
}
-func (s implControllerServerStub) BlessPublicKey(ctx ipc.ServerCall, i0 int32, i1 []security.Caveat, i2 time.Duration, i3 string) (int32, string, error) {
- return s.impl.BlessPublicKey(ctx, i0, i1, i2, i3)
+func (s implControllerServerStub) BlessPublicKey(call ipc.ServerCall, i0 int32, i1 []security.Caveat, i2 time.Duration, i3 string) (int32, string, error) {
+ return s.impl.BlessPublicKey(call, i0, i1, i2, i3)
}
-func (s implControllerServerStub) CreateBlessings(ctx ipc.ServerCall, i0 string) (int32, string, error) {
- return s.impl.CreateBlessings(ctx, i0)
+func (s implControllerServerStub) CreateBlessings(call ipc.ServerCall, i0 string) (int32, string, error) {
+ return s.impl.CreateBlessings(call, i0)
}
-func (s implControllerServerStub) RemoteBlessings(ctx ipc.ServerCall, i0 string, i1 string) ([]string, error) {
- return s.impl.RemoteBlessings(ctx, i0, i1)
+func (s implControllerServerStub) RemoteBlessings(call ipc.ServerCall, i0 string, i1 string) ([]string, error) {
+ return s.impl.RemoteBlessings(call, i0, i1)
}
-func (s implControllerServerStub) Signature(ctx ipc.ServerCall, i0 string) ([]signature.Interface, error) {
- return s.impl.Signature(ctx, i0)
+func (s implControllerServerStub) Signature(call ipc.ServerCall, i0 string) ([]signature.Interface, error) {
+ return s.impl.Signature(call, i0)
}
func (s implControllerServerStub) Globber() *ipc.GlobState {
diff --git a/services/wsprd/namespace/namespace.vdl.go b/services/wsprd/namespace/namespace.vdl.go
index 143b005..082c19a 100644
--- a/services/wsprd/namespace/namespace.vdl.go
+++ b/services/wsprd/namespace/namespace.vdl.go
@@ -75,7 +75,7 @@
// TODO(nlacasse,bprosnitz): Remove this unused type and the security import
// once https://github.com/veyron/release-issues/issues/1202 is fixed.
type WorkaroundServerMethods interface {
- Unused(ctx ipc.ServerCall, unused security.BlessingPattern) error
+ Unused(call ipc.ServerCall, unused security.BlessingPattern) error
}
// WorkaroundServerStubMethods is the server interface containing
@@ -113,8 +113,8 @@
gs *ipc.GlobState
}
-func (s implWorkaroundServerStub) Unused(ctx ipc.ServerCall, i0 security.BlessingPattern) error {
- return s.impl.Unused(ctx, i0)
+func (s implWorkaroundServerStub) Unused(call ipc.ServerCall, i0 security.BlessingPattern) error {
+ return s.impl.Unused(call, i0)
}
func (s implWorkaroundServerStub) Globber() *ipc.GlobState {
@@ -353,21 +353,21 @@
Value() naming.VDLGlobReply
Err() error
} {
- return implNamespaceGlobCallRecv{c}
+ return implNamespaceGlobClientCallRecv{c}
}
-type implNamespaceGlobCallRecv struct {
+type implNamespaceGlobClientCallRecv struct {
c *implNamespaceGlobClientCall
}
-func (c implNamespaceGlobCallRecv) Advance() bool {
+func (c implNamespaceGlobClientCallRecv) Advance() bool {
c.c.errRecv = c.c.Recv(&c.c.valRecv)
return c.c.errRecv == nil
}
-func (c implNamespaceGlobCallRecv) Value() naming.VDLGlobReply {
+func (c implNamespaceGlobClientCallRecv) Value() naming.VDLGlobReply {
return c.c.valRecv
}
-func (c implNamespaceGlobCallRecv) Err() error {
+func (c implNamespaceGlobClientCallRecv) Err() error {
if c.c.errRecv == io.EOF {
return nil
}
@@ -382,30 +382,30 @@
// implements for Namespace.
type NamespaceServerMethods interface {
// Run a glob query and stream the results.
- Glob(ctx NamespaceGlobContext, pattern string) error
+ Glob(call NamespaceGlobServerCall, pattern string) error
// Mount mounts a server under the given name.
- Mount(ctx ipc.ServerCall, name string, server string, ttl time.Duration, replace bool) error
+ Mount(call ipc.ServerCall, name string, server string, ttl time.Duration, replace bool) error
// Unmount removes an existing mount point.
- Unmount(ctx ipc.ServerCall, name string, server string) error
+ Unmount(call ipc.ServerCall, name string, server string) error
// Resolve resolves a name to an address.
- Resolve(ctx ipc.ServerCall, name string) ([]string, error)
+ Resolve(call ipc.ServerCall, name string) ([]string, error)
// ResolveToMt resolves a name to the address of the mounttable directly
// hosting it.
- ResolveToMT(ctx ipc.ServerCall, name string) ([]string, error)
+ ResolveToMT(call ipc.ServerCall, name string) ([]string, error)
// FlushCacheEntry removes the namespace cache entry for a given name.
- FlushCacheEntry(ctx ipc.ServerCall, name string) (bool, error)
+ FlushCacheEntry(call ipc.ServerCall, name string) (bool, error)
// DisableCache disables the naming cache.
- DisableCache(ctx ipc.ServerCall, disable bool) error
+ DisableCache(call ipc.ServerCall, disable bool) error
// Roots returns the addresses of the current mounttable roots.
Roots(ipc.ServerCall) ([]string, error)
// SetRoots sets the current mounttable roots.
- SetRoots(ctx ipc.ServerCall, roots []string) error
+ SetRoots(call ipc.ServerCall, roots []string) error
// SetACL sets the ACL in a node in a mount table.
- SetACL(ctx ipc.ServerCall, name string, acl access.TaggedACLMap, etag string) error
+ SetACL(call ipc.ServerCall, name string, acl access.TaggedACLMap, etag string) error
// GetACL returns the ACL in a node in a mount table.
- GetACL(ctx ipc.ServerCall, name string) (acl access.TaggedACLMap, etag string, err error)
+ GetACL(call ipc.ServerCall, name string) (acl access.TaggedACLMap, etag string, err error)
// Delete deletes the name from the mounttable and, if requested, any subtree.
- Delete(ctx ipc.ServerCall, name string, deleteSubtree bool) error
+ Delete(call ipc.ServerCall, name string, deleteSubtree bool) error
}
// NamespaceServerStubMethods is the server interface containing
@@ -414,30 +414,30 @@
// is the streaming methods.
type NamespaceServerStubMethods interface {
// Run a glob query and stream the results.
- Glob(ctx *NamespaceGlobContextStub, pattern string) error
+ Glob(call *NamespaceGlobServerCallStub, pattern string) error
// Mount mounts a server under the given name.
- Mount(ctx ipc.ServerCall, name string, server string, ttl time.Duration, replace bool) error
+ Mount(call ipc.ServerCall, name string, server string, ttl time.Duration, replace bool) error
// Unmount removes an existing mount point.
- Unmount(ctx ipc.ServerCall, name string, server string) error
+ Unmount(call ipc.ServerCall, name string, server string) error
// Resolve resolves a name to an address.
- Resolve(ctx ipc.ServerCall, name string) ([]string, error)
+ Resolve(call ipc.ServerCall, name string) ([]string, error)
// ResolveToMt resolves a name to the address of the mounttable directly
// hosting it.
- ResolveToMT(ctx ipc.ServerCall, name string) ([]string, error)
+ ResolveToMT(call ipc.ServerCall, name string) ([]string, error)
// FlushCacheEntry removes the namespace cache entry for a given name.
- FlushCacheEntry(ctx ipc.ServerCall, name string) (bool, error)
+ FlushCacheEntry(call ipc.ServerCall, name string) (bool, error)
// DisableCache disables the naming cache.
- DisableCache(ctx ipc.ServerCall, disable bool) error
+ DisableCache(call ipc.ServerCall, disable bool) error
// Roots returns the addresses of the current mounttable roots.
Roots(ipc.ServerCall) ([]string, error)
// SetRoots sets the current mounttable roots.
- SetRoots(ctx ipc.ServerCall, roots []string) error
+ SetRoots(call ipc.ServerCall, roots []string) error
// SetACL sets the ACL in a node in a mount table.
- SetACL(ctx ipc.ServerCall, name string, acl access.TaggedACLMap, etag string) error
+ SetACL(call ipc.ServerCall, name string, acl access.TaggedACLMap, etag string) error
// GetACL returns the ACL in a node in a mount table.
- GetACL(ctx ipc.ServerCall, name string) (acl access.TaggedACLMap, etag string, err error)
+ GetACL(call ipc.ServerCall, name string) (acl access.TaggedACLMap, etag string, err error)
// Delete deletes the name from the mounttable and, if requested, any subtree.
- Delete(ctx ipc.ServerCall, name string, deleteSubtree bool) error
+ Delete(call ipc.ServerCall, name string, deleteSubtree bool) error
}
// NamespaceServerStub adds universal methods to NamespaceServerStubMethods.
@@ -469,52 +469,52 @@
gs *ipc.GlobState
}
-func (s implNamespaceServerStub) Glob(ctx *NamespaceGlobContextStub, i0 string) error {
- return s.impl.Glob(ctx, i0)
+func (s implNamespaceServerStub) Glob(call *NamespaceGlobServerCallStub, i0 string) error {
+ return s.impl.Glob(call, i0)
}
-func (s implNamespaceServerStub) Mount(ctx ipc.ServerCall, i0 string, i1 string, i2 time.Duration, i3 bool) error {
- return s.impl.Mount(ctx, i0, i1, i2, i3)
+func (s implNamespaceServerStub) Mount(call ipc.ServerCall, i0 string, i1 string, i2 time.Duration, i3 bool) error {
+ return s.impl.Mount(call, i0, i1, i2, i3)
}
-func (s implNamespaceServerStub) Unmount(ctx ipc.ServerCall, i0 string, i1 string) error {
- return s.impl.Unmount(ctx, i0, i1)
+func (s implNamespaceServerStub) Unmount(call ipc.ServerCall, i0 string, i1 string) error {
+ return s.impl.Unmount(call, i0, i1)
}
-func (s implNamespaceServerStub) Resolve(ctx ipc.ServerCall, i0 string) ([]string, error) {
- return s.impl.Resolve(ctx, i0)
+func (s implNamespaceServerStub) Resolve(call ipc.ServerCall, i0 string) ([]string, error) {
+ return s.impl.Resolve(call, i0)
}
-func (s implNamespaceServerStub) ResolveToMT(ctx ipc.ServerCall, i0 string) ([]string, error) {
- return s.impl.ResolveToMT(ctx, i0)
+func (s implNamespaceServerStub) ResolveToMT(call ipc.ServerCall, i0 string) ([]string, error) {
+ return s.impl.ResolveToMT(call, i0)
}
-func (s implNamespaceServerStub) FlushCacheEntry(ctx ipc.ServerCall, i0 string) (bool, error) {
- return s.impl.FlushCacheEntry(ctx, i0)
+func (s implNamespaceServerStub) FlushCacheEntry(call ipc.ServerCall, i0 string) (bool, error) {
+ return s.impl.FlushCacheEntry(call, i0)
}
-func (s implNamespaceServerStub) DisableCache(ctx ipc.ServerCall, i0 bool) error {
- return s.impl.DisableCache(ctx, i0)
+func (s implNamespaceServerStub) DisableCache(call ipc.ServerCall, i0 bool) error {
+ return s.impl.DisableCache(call, i0)
}
-func (s implNamespaceServerStub) Roots(ctx ipc.ServerCall) ([]string, error) {
- return s.impl.Roots(ctx)
+func (s implNamespaceServerStub) Roots(call ipc.ServerCall) ([]string, error) {
+ return s.impl.Roots(call)
}
-func (s implNamespaceServerStub) SetRoots(ctx ipc.ServerCall, i0 []string) error {
- return s.impl.SetRoots(ctx, i0)
+func (s implNamespaceServerStub) SetRoots(call ipc.ServerCall, i0 []string) error {
+ return s.impl.SetRoots(call, i0)
}
-func (s implNamespaceServerStub) SetACL(ctx ipc.ServerCall, i0 string, i1 access.TaggedACLMap, i2 string) error {
- return s.impl.SetACL(ctx, i0, i1, i2)
+func (s implNamespaceServerStub) SetACL(call ipc.ServerCall, i0 string, i1 access.TaggedACLMap, i2 string) error {
+ return s.impl.SetACL(call, i0, i1, i2)
}
-func (s implNamespaceServerStub) GetACL(ctx ipc.ServerCall, i0 string) (access.TaggedACLMap, string, error) {
- return s.impl.GetACL(ctx, i0)
+func (s implNamespaceServerStub) GetACL(call ipc.ServerCall, i0 string) (access.TaggedACLMap, string, error) {
+ return s.impl.GetACL(call, i0)
}
-func (s implNamespaceServerStub) Delete(ctx ipc.ServerCall, i0 string, i1 bool) error {
- return s.impl.Delete(ctx, i0, i1)
+func (s implNamespaceServerStub) Delete(call ipc.ServerCall, i0 string, i1 bool) error {
+ return s.impl.Delete(call, i0, i1)
}
func (s implNamespaceServerStub) Globber() *ipc.GlobState {
@@ -651,34 +651,34 @@
}
}
-// NamespaceGlobContext represents the context passed to Namespace.Glob.
-type NamespaceGlobContext interface {
+// NamespaceGlobServerCall represents the context passed to Namespace.Glob.
+type NamespaceGlobServerCall interface {
ipc.ServerCall
NamespaceGlobServerStream
}
-// NamespaceGlobContextStub is a wrapper that converts ipc.StreamServerCall into
-// a typesafe stub that implements NamespaceGlobContext.
-type NamespaceGlobContextStub struct {
+// NamespaceGlobServerCallStub is a wrapper that converts ipc.StreamServerCall into
+// a typesafe stub that implements NamespaceGlobServerCall.
+type NamespaceGlobServerCallStub struct {
ipc.StreamServerCall
}
-// Init initializes NamespaceGlobContextStub from ipc.StreamServerCall.
-func (s *NamespaceGlobContextStub) Init(call ipc.StreamServerCall) {
+// Init initializes NamespaceGlobServerCallStub from ipc.StreamServerCall.
+func (s *NamespaceGlobServerCallStub) Init(call ipc.StreamServerCall) {
s.StreamServerCall = call
}
// SendStream returns the send side of the Namespace.Glob server stream.
-func (s *NamespaceGlobContextStub) SendStream() interface {
+func (s *NamespaceGlobServerCallStub) SendStream() interface {
Send(item naming.VDLGlobReply) error
} {
- return implNamespaceGlobContextSend{s}
+ return implNamespaceGlobServerCallSend{s}
}
-type implNamespaceGlobContextSend struct {
- s *NamespaceGlobContextStub
+type implNamespaceGlobServerCallSend struct {
+ s *NamespaceGlobServerCallStub
}
-func (s implNamespaceGlobContextSend) Send(item naming.VDLGlobReply) error {
+func (s implNamespaceGlobServerCallSend) Send(item naming.VDLGlobReply) error {
return s.s.Send(item)
}
diff --git a/services/wsprd/namespace/request_handler.go b/services/wsprd/namespace/request_handler.go
index c20dc64..91d01bd 100644
--- a/services/wsprd/namespace/request_handler.go
+++ b/services/wsprd/namespace/request_handler.go
@@ -20,14 +20,14 @@
return &Server{v23.GetNamespace(ctx)}
}
-func (s *Server) Glob(ctx *NamespaceGlobContextStub, pattern string) error {
+func (s *Server) Glob(call *NamespaceGlobServerCallStub, pattern string) error {
// Call Glob on the namespace client instance
- ch, err := s.ns.Glob(ctx.Context(), pattern)
+ ch, err := s.ns.Glob(call.Context(), pattern)
if err != nil {
return err
}
- stream := ctx.SendStream()
+ stream := call.SendStream()
for mp := range ch {
var reply naming.VDLGlobReply