blob: 1897ee1fd936321a097b36b0df73901c7d52a4bf [file] [log] [blame]
// This file was auto-generated by the veyron vdl tool.
// Source: wire.vdl
package main
import (
// VDL system imports
"v.io/v23"
"v.io/v23/context"
"v.io/v23/ipc"
)
// PingPongClientMethods is the client interface
// containing PingPong methods.
//
// Simple service used in the agent tests.
type PingPongClientMethods interface {
Ping(ctx *context.T, message string, opts ...ipc.CallOpt) (string, error)
}
// PingPongClientStub adds universal methods to PingPongClientMethods.
type PingPongClientStub interface {
PingPongClientMethods
ipc.UniversalServiceMethods
}
// PingPongClient returns a client stub for PingPong.
func PingPongClient(name string, opts ...ipc.BindOpt) PingPongClientStub {
var client ipc.Client
for _, opt := range opts {
if clientOpt, ok := opt.(ipc.Client); ok {
client = clientOpt
}
}
return implPingPongClientStub{name, client}
}
type implPingPongClientStub struct {
name string
client ipc.Client
}
func (c implPingPongClientStub) c(ctx *context.T) ipc.Client {
if c.client != nil {
return c.client
}
return v23.GetClient(ctx)
}
func (c implPingPongClientStub) Ping(ctx *context.T, i0 string, opts ...ipc.CallOpt) (o0 string, err error) {
var call ipc.ClientCall
if call, err = c.c(ctx).StartCall(ctx, c.name, "Ping", []interface{}{i0}, opts...); err != nil {
return
}
err = call.Finish(&o0)
return
}
// PingPongServerMethods is the interface a server writer
// implements for PingPong.
//
// Simple service used in the agent tests.
type PingPongServerMethods interface {
Ping(call ipc.ServerCall, message string) (string, error)
}
// PingPongServerStubMethods is the server interface containing
// PingPong methods, as expected by ipc.Server.
// There is no difference between this interface and PingPongServerMethods
// since there are no streaming methods.
type PingPongServerStubMethods PingPongServerMethods
// PingPongServerStub adds universal methods to PingPongServerStubMethods.
type PingPongServerStub interface {
PingPongServerStubMethods
// Describe the PingPong interfaces.
Describe__() []ipc.InterfaceDesc
}
// PingPongServer returns a server stub for PingPong.
// It converts an implementation of PingPongServerMethods into
// an object that may be used by ipc.Server.
func PingPongServer(impl PingPongServerMethods) PingPongServerStub {
stub := implPingPongServerStub{
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 implPingPongServerStub struct {
impl PingPongServerMethods
gs *ipc.GlobState
}
func (s implPingPongServerStub) Ping(call ipc.ServerCall, i0 string) (string, error) {
return s.impl.Ping(call, i0)
}
func (s implPingPongServerStub) Globber() *ipc.GlobState {
return s.gs
}
func (s implPingPongServerStub) Describe__() []ipc.InterfaceDesc {
return []ipc.InterfaceDesc{PingPongDesc}
}
// PingPongDesc describes the PingPong interface.
var PingPongDesc ipc.InterfaceDesc = descPingPong
// descPingPong hides the desc to keep godoc clean.
var descPingPong = ipc.InterfaceDesc{
Name: "PingPong",
PkgPath: "v.io/x/ref/security/agent/pingpong",
Doc: "// Simple service used in the agent tests.",
Methods: []ipc.MethodDesc{
{
Name: "Ping",
InArgs: []ipc.ArgDesc{
{"message", ``}, // string
},
OutArgs: []ipc.ArgDesc{
{"", ``}, // string
},
},
},
}