| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| // This file was auto-generated by the vanadium vdl tool. |
| // Source: native.vdl |
| |
| package test_service |
| |
| import ( |
| // VDL system imports |
| "v.io/v23" |
| "v.io/v23/context" |
| "v.io/v23/rpc" |
| |
| // VDL user imports |
| "time" |
| _ "v.io/v23/vdlroot/time" |
| ) |
| |
| // NativeTestClientMethods is the client interface |
| // containing NativeTest methods. |
| type NativeTestClientMethods interface { |
| PassTime(ctx *context.T, t time.Time, opts ...rpc.CallOpt) (time.Time, error) |
| PassError(ctx *context.T, e error, opts ...rpc.CallOpt) error |
| } |
| |
| // NativeTestClientStub adds universal methods to NativeTestClientMethods. |
| type NativeTestClientStub interface { |
| NativeTestClientMethods |
| rpc.UniversalServiceMethods |
| } |
| |
| // NativeTestClient returns a client stub for NativeTest. |
| func NativeTestClient(name string) NativeTestClientStub { |
| return implNativeTestClientStub{name} |
| } |
| |
| type implNativeTestClientStub struct { |
| name string |
| } |
| |
| func (c implNativeTestClientStub) PassTime(ctx *context.T, i0 time.Time, opts ...rpc.CallOpt) (o0 time.Time, err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "PassTime", []interface{}{i0}, []interface{}{&o0}, opts...) |
| return |
| } |
| |
| func (c implNativeTestClientStub) PassError(ctx *context.T, i0 error, opts ...rpc.CallOpt) (err error) { |
| err = v23.GetClient(ctx).Call(ctx, c.name, "PassError", []interface{}{&i0}, nil, opts...) |
| return |
| } |
| |
| // NativeTestServerMethods is the interface a server writer |
| // implements for NativeTest. |
| type NativeTestServerMethods interface { |
| PassTime(ctx *context.T, call rpc.ServerCall, t time.Time) (time.Time, error) |
| PassError(ctx *context.T, call rpc.ServerCall, e error) error |
| } |
| |
| // NativeTestServerStubMethods is the server interface containing |
| // NativeTest methods, as expected by rpc.Server. |
| // There is no difference between this interface and NativeTestServerMethods |
| // since there are no streaming methods. |
| type NativeTestServerStubMethods NativeTestServerMethods |
| |
| // NativeTestServerStub adds universal methods to NativeTestServerStubMethods. |
| type NativeTestServerStub interface { |
| NativeTestServerStubMethods |
| // Describe the NativeTest interfaces. |
| Describe__() []rpc.InterfaceDesc |
| } |
| |
| // NativeTestServer returns a server stub for NativeTest. |
| // It converts an implementation of NativeTestServerMethods into |
| // an object that may be used by rpc.Server. |
| func NativeTestServer(impl NativeTestServerMethods) NativeTestServerStub { |
| stub := implNativeTestServerStub{ |
| 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 := rpc.NewGlobState(stub); gs != nil { |
| stub.gs = gs |
| } else if gs := rpc.NewGlobState(impl); gs != nil { |
| stub.gs = gs |
| } |
| return stub |
| } |
| |
| type implNativeTestServerStub struct { |
| impl NativeTestServerMethods |
| gs *rpc.GlobState |
| } |
| |
| func (s implNativeTestServerStub) PassTime(ctx *context.T, call rpc.ServerCall, i0 time.Time) (time.Time, error) { |
| return s.impl.PassTime(ctx, call, i0) |
| } |
| |
| func (s implNativeTestServerStub) PassError(ctx *context.T, call rpc.ServerCall, i0 error) error { |
| return s.impl.PassError(ctx, call, i0) |
| } |
| |
| func (s implNativeTestServerStub) Globber() *rpc.GlobState { |
| return s.gs |
| } |
| |
| func (s implNativeTestServerStub) Describe__() []rpc.InterfaceDesc { |
| return []rpc.InterfaceDesc{NativeTestDesc} |
| } |
| |
| // NativeTestDesc describes the NativeTest interface. |
| var NativeTestDesc rpc.InterfaceDesc = descNativeTest |
| |
| // descNativeTest hides the desc to keep godoc clean. |
| var descNativeTest = rpc.InterfaceDesc{ |
| Name: "NativeTest", |
| PkgPath: "v.io/x/js.core/test_service", |
| Methods: []rpc.MethodDesc{ |
| { |
| Name: "PassTime", |
| InArgs: []rpc.ArgDesc{ |
| {"t", ``}, // time.Time |
| }, |
| OutArgs: []rpc.ArgDesc{ |
| {"", ``}, // time.Time |
| }, |
| }, |
| { |
| Name: "PassError", |
| InArgs: []rpc.ArgDesc{ |
| {"e", ``}, // error |
| }, |
| }, |
| }, |
| } |