| // This file was auto-generated by the veyron vdl tool. |
| // Source: test_base.vdl |
| |
| package test_base |
| |
| import ( |
| // The non-user imports are prefixed with "__" to prevent collisions. |
| __io "io" |
| __veyron2 "veyron.io/veyron/veyron2" |
| __context "veyron.io/veyron/veyron2/context" |
| __ipc "veyron.io/veyron/veyron2/ipc" |
| __vdlutil "veyron.io/veyron/veyron2/vdl/vdlutil" |
| __wiretype "veyron.io/veyron/veyron2/wiretype" |
| ) |
| |
| // TODO(toddw): Remove this line once the new signature support is done. |
| // It corrects a bug where __wiretype is unused in VDL pacakges where only |
| // bootstrap types are used on interfaces. |
| const _ = __wiretype.TypeIDInvalid |
| |
| type Struct struct { |
| X int32 |
| Y int32 |
| } |
| |
| // TypeTesterClientMethods is the client interface |
| // containing TypeTester methods. |
| type TypeTesterClientMethods interface { |
| // Methods to test support for generic types. |
| EchoBool(ctx __context.T, I1 bool, opts ...__ipc.CallOpt) (O1 bool, err error) |
| EchoFloat32(ctx __context.T, I1 float32, opts ...__ipc.CallOpt) (O1 float32, err error) |
| EchoFloat64(ctx __context.T, I1 float64, opts ...__ipc.CallOpt) (O1 float64, err error) |
| EchoInt32(ctx __context.T, I1 int32, opts ...__ipc.CallOpt) (O1 int32, err error) |
| EchoInt64(ctx __context.T, I1 int64, opts ...__ipc.CallOpt) (O1 int64, err error) |
| EchoString(ctx __context.T, I1 string, opts ...__ipc.CallOpt) (O1 string, err error) |
| EchoByte(ctx __context.T, I1 byte, opts ...__ipc.CallOpt) (O1 byte, err error) |
| EchoUInt32(ctx __context.T, I1 uint32, opts ...__ipc.CallOpt) (O1 uint32, err error) |
| EchoUInt64(ctx __context.T, I1 uint64, opts ...__ipc.CallOpt) (O1 uint64, err error) |
| // Methods to test support for composite types. |
| InputArray(ctx __context.T, I1 [2]byte, opts ...__ipc.CallOpt) error |
| InputMap(ctx __context.T, I1 map[byte]byte, opts ...__ipc.CallOpt) error |
| InputSlice(ctx __context.T, I1 []byte, opts ...__ipc.CallOpt) error |
| InputStruct(ctx __context.T, I1 Struct, opts ...__ipc.CallOpt) error |
| OutputArray(__context.T, ...__ipc.CallOpt) (O1 [2]byte, err error) |
| OutputMap(__context.T, ...__ipc.CallOpt) (O1 map[byte]byte, err error) |
| OutputSlice(__context.T, ...__ipc.CallOpt) (O1 []byte, err error) |
| OutputStruct(__context.T, ...__ipc.CallOpt) (O1 Struct, err error) |
| // Methods to test support for different number of arguments. |
| NoArguments(__context.T, ...__ipc.CallOpt) error |
| MultipleArguments(ctx __context.T, I1 int32, I2 int32, opts ...__ipc.CallOpt) (O1 int32, O2 int32, err error) |
| // Methods to test support for streaming. |
| StreamingOutput(ctx __context.T, NumStreamItems int32, StreamItem bool, opts ...__ipc.CallOpt) (TypeTesterStreamingOutputCall, error) |
| } |
| |
| // TypeTesterClientStub adds universal methods to TypeTesterClientMethods. |
| type TypeTesterClientStub interface { |
| TypeTesterClientMethods |
| __ipc.UniversalServiceMethods |
| } |
| |
| // TypeTesterClient returns a client stub for TypeTester. |
| func TypeTesterClient(name string, opts ...__ipc.BindOpt) TypeTesterClientStub { |
| var client __ipc.Client |
| for _, opt := range opts { |
| if clientOpt, ok := opt.(__ipc.Client); ok { |
| client = clientOpt |
| } |
| } |
| return implTypeTesterClientStub{name, client} |
| } |
| |
| type implTypeTesterClientStub struct { |
| name string |
| client __ipc.Client |
| } |
| |
| func (c implTypeTesterClientStub) c(ctx __context.T) __ipc.Client { |
| if c.client != nil { |
| return c.client |
| } |
| return __veyron2.RuntimeFromContext(ctx).Client() |
| } |
| |
| func (c implTypeTesterClientStub) EchoBool(ctx __context.T, i0 bool, opts ...__ipc.CallOpt) (o0 bool, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "EchoBool", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) EchoFloat32(ctx __context.T, i0 float32, opts ...__ipc.CallOpt) (o0 float32, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "EchoFloat32", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) EchoFloat64(ctx __context.T, i0 float64, opts ...__ipc.CallOpt) (o0 float64, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "EchoFloat64", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) EchoInt32(ctx __context.T, i0 int32, opts ...__ipc.CallOpt) (o0 int32, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "EchoInt32", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) EchoInt64(ctx __context.T, i0 int64, opts ...__ipc.CallOpt) (o0 int64, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "EchoInt64", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) EchoString(ctx __context.T, i0 string, opts ...__ipc.CallOpt) (o0 string, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "EchoString", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) EchoByte(ctx __context.T, i0 byte, opts ...__ipc.CallOpt) (o0 byte, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "EchoByte", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) EchoUInt32(ctx __context.T, i0 uint32, opts ...__ipc.CallOpt) (o0 uint32, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "EchoUInt32", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) EchoUInt64(ctx __context.T, i0 uint64, opts ...__ipc.CallOpt) (o0 uint64, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "EchoUInt64", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) InputArray(ctx __context.T, i0 [2]byte, opts ...__ipc.CallOpt) (err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "InputArray", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) InputMap(ctx __context.T, i0 map[byte]byte, opts ...__ipc.CallOpt) (err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "InputMap", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) InputSlice(ctx __context.T, i0 []byte, opts ...__ipc.CallOpt) (err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "InputSlice", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) InputStruct(ctx __context.T, i0 Struct, opts ...__ipc.CallOpt) (err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "InputStruct", []interface{}{i0}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) OutputArray(ctx __context.T, opts ...__ipc.CallOpt) (o0 [2]byte, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "OutputArray", nil, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) OutputMap(ctx __context.T, opts ...__ipc.CallOpt) (o0 map[byte]byte, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "OutputMap", nil, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) OutputSlice(ctx __context.T, opts ...__ipc.CallOpt) (o0 []byte, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "OutputSlice", nil, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) OutputStruct(ctx __context.T, opts ...__ipc.CallOpt) (o0 Struct, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "OutputStruct", nil, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) NoArguments(ctx __context.T, opts ...__ipc.CallOpt) (err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "NoArguments", nil, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) MultipleArguments(ctx __context.T, i0 int32, i1 int32, opts ...__ipc.CallOpt) (o0 int32, o1 int32, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "MultipleArguments", []interface{}{i0, i1}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &o1, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) StreamingOutput(ctx __context.T, i0 int32, i1 bool, opts ...__ipc.CallOpt) (ocall TypeTesterStreamingOutputCall, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "StreamingOutput", []interface{}{i0, i1}, opts...); err != nil { |
| return |
| } |
| ocall = &implTypeTesterStreamingOutputCall{call, implTypeTesterStreamingOutputClientRecv{call: call}} |
| return |
| } |
| |
| func (c implTypeTesterClientStub) Signature(ctx __context.T, opts ...__ipc.CallOpt) (o0 __ipc.ServiceSignature, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "Signature", nil, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| func (c implTypeTesterClientStub) GetMethodTags(ctx __context.T, method string, opts ...__ipc.CallOpt) (o0 []interface{}, err error) { |
| var call __ipc.Call |
| if call, err = c.c(ctx).StartCall(ctx, c.name, "GetMethodTags", []interface{}{method}, opts...); err != nil { |
| return |
| } |
| if ierr := call.Finish(&o0, &err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| |
| // TypeTesterStreamingOutputClientStream is the client stream for TypeTester.StreamingOutput. |
| type TypeTesterStreamingOutputClientStream interface { |
| // RecvStream returns the receiver side of the client stream. |
| RecvStream() interface { |
| // Advance stages an item so that it may be retrieved via Value. Returns |
| // true iff there is an item to retrieve. Advance must be called before |
| // Value is called. May block if an item is not available. |
| Advance() bool |
| // Value returns the item that was staged by Advance. May panic if Advance |
| // returned false or was not called. Never blocks. |
| Value() bool |
| // Err returns any error encountered by Advance. Never blocks. |
| Err() error |
| } |
| } |
| |
| // TypeTesterStreamingOutputCall represents the call returned from TypeTester.StreamingOutput. |
| type TypeTesterStreamingOutputCall interface { |
| TypeTesterStreamingOutputClientStream |
| // Finish blocks until the server is done, and returns the positional return |
| // values for call. |
| // |
| // Finish returns immediately if Cancel has been called; depending on the |
| // timing the output could either be an error signaling cancelation, or the |
| // valid positional return values from the server. |
| // |
| // Calling Finish is mandatory for releasing stream resources, unless Cancel |
| // has been called or any of the other methods return an error. Finish should |
| // be called at most once. |
| Finish() error |
| // Cancel cancels the RPC, notifying the server to stop processing. It is |
| // safe to call Cancel concurrently with any of the other stream methods. |
| // Calling Cancel after Finish has returned is a no-op. |
| Cancel() |
| } |
| |
| type implTypeTesterStreamingOutputClientRecv struct { |
| call __ipc.Call |
| val bool |
| err error |
| } |
| |
| func (c *implTypeTesterStreamingOutputClientRecv) Advance() bool { |
| c.err = c.call.Recv(&c.val) |
| return c.err == nil |
| } |
| func (c *implTypeTesterStreamingOutputClientRecv) Value() bool { |
| return c.val |
| } |
| func (c *implTypeTesterStreamingOutputClientRecv) Err() error { |
| if c.err == __io.EOF { |
| return nil |
| } |
| return c.err |
| } |
| |
| type implTypeTesterStreamingOutputCall struct { |
| call __ipc.Call |
| recv implTypeTesterStreamingOutputClientRecv |
| } |
| |
| func (c *implTypeTesterStreamingOutputCall) RecvStream() interface { |
| Advance() bool |
| Value() bool |
| Err() error |
| } { |
| return &c.recv |
| } |
| func (c *implTypeTesterStreamingOutputCall) Finish() (err error) { |
| if ierr := c.call.Finish(&err); ierr != nil { |
| err = ierr |
| } |
| return |
| } |
| func (c *implTypeTesterStreamingOutputCall) Cancel() { |
| c.call.Cancel() |
| } |
| |
| // TypeTesterServerMethods is the interface a server writer |
| // implements for TypeTester. |
| type TypeTesterServerMethods interface { |
| // Methods to test support for generic types. |
| EchoBool(ctx __ipc.ServerContext, I1 bool) (O1 bool, E error) |
| EchoFloat32(ctx __ipc.ServerContext, I1 float32) (O1 float32, E error) |
| EchoFloat64(ctx __ipc.ServerContext, I1 float64) (O1 float64, E error) |
| EchoInt32(ctx __ipc.ServerContext, I1 int32) (O1 int32, E error) |
| EchoInt64(ctx __ipc.ServerContext, I1 int64) (O1 int64, E error) |
| EchoString(ctx __ipc.ServerContext, I1 string) (O1 string, E error) |
| EchoByte(ctx __ipc.ServerContext, I1 byte) (O1 byte, E error) |
| EchoUInt32(ctx __ipc.ServerContext, I1 uint32) (O1 uint32, E error) |
| EchoUInt64(ctx __ipc.ServerContext, I1 uint64) (O1 uint64, E error) |
| // Methods to test support for composite types. |
| InputArray(ctx __ipc.ServerContext, I1 [2]byte) (E error) |
| InputMap(ctx __ipc.ServerContext, I1 map[byte]byte) (E error) |
| InputSlice(ctx __ipc.ServerContext, I1 []byte) (E error) |
| InputStruct(ctx __ipc.ServerContext, I1 Struct) (E error) |
| OutputArray(__ipc.ServerContext) (O1 [2]byte, E error) |
| OutputMap(__ipc.ServerContext) (O1 map[byte]byte, E error) |
| OutputSlice(__ipc.ServerContext) (O1 []byte, E error) |
| OutputStruct(__ipc.ServerContext) (O1 Struct, E error) |
| // Methods to test support for different number of arguments. |
| NoArguments(__ipc.ServerContext) error |
| MultipleArguments(ctx __ipc.ServerContext, I1 int32, I2 int32) (O1 int32, O2 int32, E error) |
| // Methods to test support for streaming. |
| StreamingOutput(ctx TypeTesterStreamingOutputContext, NumStreamItems int32, StreamItem bool) error |
| } |
| |
| // TypeTesterServerStubMethods is the server interface containing |
| // TypeTester methods, as expected by ipc.Server. The difference between |
| // this interface and TypeTesterServerMethods is that the first context |
| // argument for each method is always ipc.ServerCall here, while it is either |
| // ipc.ServerContext or a typed streaming context there. |
| type TypeTesterServerStubMethods interface { |
| // Methods to test support for generic types. |
| EchoBool(call __ipc.ServerCall, I1 bool) (O1 bool, E error) |
| EchoFloat32(call __ipc.ServerCall, I1 float32) (O1 float32, E error) |
| EchoFloat64(call __ipc.ServerCall, I1 float64) (O1 float64, E error) |
| EchoInt32(call __ipc.ServerCall, I1 int32) (O1 int32, E error) |
| EchoInt64(call __ipc.ServerCall, I1 int64) (O1 int64, E error) |
| EchoString(call __ipc.ServerCall, I1 string) (O1 string, E error) |
| EchoByte(call __ipc.ServerCall, I1 byte) (O1 byte, E error) |
| EchoUInt32(call __ipc.ServerCall, I1 uint32) (O1 uint32, E error) |
| EchoUInt64(call __ipc.ServerCall, I1 uint64) (O1 uint64, E error) |
| // Methods to test support for composite types. |
| InputArray(call __ipc.ServerCall, I1 [2]byte) (E error) |
| InputMap(call __ipc.ServerCall, I1 map[byte]byte) (E error) |
| InputSlice(call __ipc.ServerCall, I1 []byte) (E error) |
| InputStruct(call __ipc.ServerCall, I1 Struct) (E error) |
| OutputArray(__ipc.ServerCall) (O1 [2]byte, E error) |
| OutputMap(__ipc.ServerCall) (O1 map[byte]byte, E error) |
| OutputSlice(__ipc.ServerCall) (O1 []byte, E error) |
| OutputStruct(__ipc.ServerCall) (O1 Struct, E error) |
| // Methods to test support for different number of arguments. |
| NoArguments(__ipc.ServerCall) error |
| MultipleArguments(call __ipc.ServerCall, I1 int32, I2 int32) (O1 int32, O2 int32, E error) |
| // Methods to test support for streaming. |
| StreamingOutput(call __ipc.ServerCall, NumStreamItems int32, StreamItem bool) error |
| } |
| |
| // TypeTesterServerStub adds universal methods to TypeTesterServerStubMethods. |
| type TypeTesterServerStub interface { |
| TypeTesterServerStubMethods |
| // GetMethodTags will be replaced with DescribeInterfaces. |
| GetMethodTags(call __ipc.ServerCall, method string) ([]interface{}, error) |
| // Signature will be replaced with DescribeInterfaces. |
| Signature(call __ipc.ServerCall) (__ipc.ServiceSignature, error) |
| } |
| |
| // TypeTesterServer returns a server stub for TypeTester. |
| // It converts an implementation of TypeTesterServerMethods into |
| // an object that may be used by ipc.Server. |
| func TypeTesterServer(impl TypeTesterServerMethods) TypeTesterServerStub { |
| stub := implTypeTesterServerStub{ |
| impl: impl, |
| } |
| // Initialize GlobState; always check the stub itself first, to handle the |
| // case where the user has the Glob method defined in their VDL source. |
| if gs := __ipc.NewGlobState(stub); gs != nil { |
| stub.gs = gs |
| } else if gs := __ipc.NewGlobState(impl); gs != nil { |
| stub.gs = gs |
| } |
| return stub |
| } |
| |
| type implTypeTesterServerStub struct { |
| impl TypeTesterServerMethods |
| gs *__ipc.GlobState |
| } |
| |
| func (s implTypeTesterServerStub) EchoBool(call __ipc.ServerCall, i0 bool) (bool, error) { |
| return s.impl.EchoBool(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) EchoFloat32(call __ipc.ServerCall, i0 float32) (float32, error) { |
| return s.impl.EchoFloat32(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) EchoFloat64(call __ipc.ServerCall, i0 float64) (float64, error) { |
| return s.impl.EchoFloat64(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) EchoInt32(call __ipc.ServerCall, i0 int32) (int32, error) { |
| return s.impl.EchoInt32(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) EchoInt64(call __ipc.ServerCall, i0 int64) (int64, error) { |
| return s.impl.EchoInt64(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) EchoString(call __ipc.ServerCall, i0 string) (string, error) { |
| return s.impl.EchoString(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) EchoByte(call __ipc.ServerCall, i0 byte) (byte, error) { |
| return s.impl.EchoByte(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) EchoUInt32(call __ipc.ServerCall, i0 uint32) (uint32, error) { |
| return s.impl.EchoUInt32(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) EchoUInt64(call __ipc.ServerCall, i0 uint64) (uint64, error) { |
| return s.impl.EchoUInt64(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) InputArray(call __ipc.ServerCall, i0 [2]byte) error { |
| return s.impl.InputArray(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) InputMap(call __ipc.ServerCall, i0 map[byte]byte) error { |
| return s.impl.InputMap(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) InputSlice(call __ipc.ServerCall, i0 []byte) error { |
| return s.impl.InputSlice(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) InputStruct(call __ipc.ServerCall, i0 Struct) error { |
| return s.impl.InputStruct(call, i0) |
| } |
| |
| func (s implTypeTesterServerStub) OutputArray(call __ipc.ServerCall) ([2]byte, error) { |
| return s.impl.OutputArray(call) |
| } |
| |
| func (s implTypeTesterServerStub) OutputMap(call __ipc.ServerCall) (map[byte]byte, error) { |
| return s.impl.OutputMap(call) |
| } |
| |
| func (s implTypeTesterServerStub) OutputSlice(call __ipc.ServerCall) ([]byte, error) { |
| return s.impl.OutputSlice(call) |
| } |
| |
| func (s implTypeTesterServerStub) OutputStruct(call __ipc.ServerCall) (Struct, error) { |
| return s.impl.OutputStruct(call) |
| } |
| |
| func (s implTypeTesterServerStub) NoArguments(call __ipc.ServerCall) error { |
| return s.impl.NoArguments(call) |
| } |
| |
| func (s implTypeTesterServerStub) MultipleArguments(call __ipc.ServerCall, i0 int32, i1 int32) (int32, int32, error) { |
| return s.impl.MultipleArguments(call, i0, i1) |
| } |
| |
| func (s implTypeTesterServerStub) StreamingOutput(call __ipc.ServerCall, i0 int32, i1 bool) error { |
| ctx := &implTypeTesterStreamingOutputContext{call, implTypeTesterStreamingOutputServerSend{call}} |
| return s.impl.StreamingOutput(ctx, i0, i1) |
| } |
| |
| func (s implTypeTesterServerStub) VGlob() *__ipc.GlobState { |
| return s.gs |
| } |
| |
| func (s implTypeTesterServerStub) GetMethodTags(call __ipc.ServerCall, method string) ([]interface{}, error) { |
| // TODO(toddw): Replace with new DescribeInterfaces implementation. |
| switch method { |
| case "EchoBool": |
| return []interface{}{}, nil |
| case "EchoFloat32": |
| return []interface{}{}, nil |
| case "EchoFloat64": |
| return []interface{}{}, nil |
| case "EchoInt32": |
| return []interface{}{}, nil |
| case "EchoInt64": |
| return []interface{}{}, nil |
| case "EchoString": |
| return []interface{}{}, nil |
| case "EchoByte": |
| return []interface{}{}, nil |
| case "EchoUInt32": |
| return []interface{}{}, nil |
| case "EchoUInt64": |
| return []interface{}{}, nil |
| case "InputArray": |
| return []interface{}{}, nil |
| case "InputMap": |
| return []interface{}{}, nil |
| case "InputSlice": |
| return []interface{}{}, nil |
| case "InputStruct": |
| return []interface{}{}, nil |
| case "OutputArray": |
| return []interface{}{}, nil |
| case "OutputMap": |
| return []interface{}{}, nil |
| case "OutputSlice": |
| return []interface{}{}, nil |
| case "OutputStruct": |
| return []interface{}{}, nil |
| case "NoArguments": |
| return []interface{}{}, nil |
| case "MultipleArguments": |
| return []interface{}{}, nil |
| case "StreamingOutput": |
| return []interface{}{}, nil |
| default: |
| return nil, nil |
| } |
| } |
| |
| func (s implTypeTesterServerStub) Signature(call __ipc.ServerCall) (__ipc.ServiceSignature, error) { |
| // TODO(toddw) Replace with new DescribeInterfaces implementation. |
| result := __ipc.ServiceSignature{Methods: make(map[string]__ipc.MethodSignature)} |
| result.Methods["EchoBool"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 2}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 2}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["EchoByte"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 66}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 66}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["EchoFloat32"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 25}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 25}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["EchoFloat64"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 26}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 26}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["EchoInt32"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 36}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 36}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["EchoInt64"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 37}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 37}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["EchoString"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 3}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 3}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["EchoUInt32"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 52}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 52}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["EchoUInt64"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 53}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 53}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["InputArray"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 67}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["InputMap"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 68}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["InputSlice"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 69}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["InputStruct"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 70}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["MultipleArguments"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "I1", Type: 36}, |
| {Name: "I2", Type: 36}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 36}, |
| {Name: "O2", Type: 36}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["NoArguments"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{}, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "", Type: 65}, |
| }, |
| } |
| result.Methods["OutputArray"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{}, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 67}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["OutputMap"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{}, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 68}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["OutputSlice"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{}, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 69}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["OutputStruct"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{}, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "O1", Type: 70}, |
| {Name: "E", Type: 65}, |
| }, |
| } |
| result.Methods["StreamingOutput"] = __ipc.MethodSignature{ |
| InArgs: []__ipc.MethodArgument{ |
| {Name: "NumStreamItems", Type: 36}, |
| {Name: "StreamItem", Type: 2}, |
| }, |
| OutArgs: []__ipc.MethodArgument{ |
| {Name: "", Type: 65}, |
| }, |
| |
| OutStream: 2, |
| } |
| |
| result.TypeDefs = []__vdlutil.Any{ |
| __wiretype.NamedPrimitiveType{Type: 0x1, Name: "error", Tags: []string(nil)}, __wiretype.NamedPrimitiveType{Type: 0x32, Name: "byte", Tags: []string(nil)}, __wiretype.ArrayType{Elem: 0x42, Len: 0x2, Name: "", Tags: []string(nil)}, __wiretype.MapType{Key: 0x42, Elem: 0x42, Name: "", Tags: []string(nil)}, __wiretype.SliceType{Elem: 0x42, Name: "", Tags: []string(nil)}, __wiretype.StructType{ |
| []__wiretype.FieldType{ |
| __wiretype.FieldType{Type: 0x24, Name: "X"}, |
| __wiretype.FieldType{Type: 0x24, Name: "Y"}, |
| }, |
| "veyron.io/veyron/veyron/tools/vrpc/test_base.Struct", []string(nil)}, |
| } |
| |
| return result, nil |
| } |
| |
| // TypeTesterStreamingOutputServerStream is the server stream for TypeTester.StreamingOutput. |
| type TypeTesterStreamingOutputServerStream interface { |
| // SendStream returns the send side of the server stream. |
| SendStream() interface { |
| // Send places the item onto the output stream. Returns errors encountered |
| // while sending. Blocks if there is no buffer space; will unblock when |
| // buffer space is available. |
| Send(item bool) error |
| } |
| } |
| |
| // TypeTesterStreamingOutputContext represents the context passed to TypeTester.StreamingOutput. |
| type TypeTesterStreamingOutputContext interface { |
| __ipc.ServerContext |
| TypeTesterStreamingOutputServerStream |
| } |
| |
| type implTypeTesterStreamingOutputServerSend struct { |
| call __ipc.ServerCall |
| } |
| |
| func (s *implTypeTesterStreamingOutputServerSend) Send(item bool) error { |
| return s.call.Send(item) |
| } |
| |
| type implTypeTesterStreamingOutputContext struct { |
| __ipc.ServerContext |
| send implTypeTesterStreamingOutputServerSend |
| } |
| |
| func (s *implTypeTesterStreamingOutputContext) SendStream() interface { |
| Send(item bool) error |
| } { |
| return &s.send |
| } |