blob: d7290a2690d0dd4bf7bb0a43466c955e2db1a29a [file] [log] [blame]
// 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: ping.vdl
package interfaces
import (
// VDL system imports
"v.io/v23"
"v.io/v23/context"
"v.io/v23/rpc"
)
// PingableClientMethods is the client interface
// containing Pingable methods.
//
// Pingable is a pingable RPC server.
type PingableClientMethods interface {
// Ping does a ping. The server-side implementation of Ping will never produce
// an error.
Ping(*context.T, ...rpc.CallOpt) error
}
// PingableClientStub adds universal methods to PingableClientMethods.
type PingableClientStub interface {
PingableClientMethods
rpc.UniversalServiceMethods
}
// PingableClient returns a client stub for Pingable.
func PingableClient(name string) PingableClientStub {
return implPingableClientStub{name}
}
type implPingableClientStub struct {
name string
}
func (c implPingableClientStub) Ping(ctx *context.T, opts ...rpc.CallOpt) (err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "Ping", nil, nil, opts...)
return
}
// PingableServerMethods is the interface a server writer
// implements for Pingable.
//
// Pingable is a pingable RPC server.
type PingableServerMethods interface {
// Ping does a ping. The server-side implementation of Ping will never produce
// an error.
Ping(*context.T, rpc.ServerCall) error
}
// PingableServerStubMethods is the server interface containing
// Pingable methods, as expected by rpc.Server.
// There is no difference between this interface and PingableServerMethods
// since there are no streaming methods.
type PingableServerStubMethods PingableServerMethods
// PingableServerStub adds universal methods to PingableServerStubMethods.
type PingableServerStub interface {
PingableServerStubMethods
// Describe the Pingable interfaces.
Describe__() []rpc.InterfaceDesc
}
// PingableServer returns a server stub for Pingable.
// It converts an implementation of PingableServerMethods into
// an object that may be used by rpc.Server.
func PingableServer(impl PingableServerMethods) PingableServerStub {
stub := implPingableServerStub{
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 implPingableServerStub struct {
impl PingableServerMethods
gs *rpc.GlobState
}
func (s implPingableServerStub) Ping(ctx *context.T, call rpc.ServerCall) error {
return s.impl.Ping(ctx, call)
}
func (s implPingableServerStub) Globber() *rpc.GlobState {
return s.gs
}
func (s implPingableServerStub) Describe__() []rpc.InterfaceDesc {
return []rpc.InterfaceDesc{PingableDesc}
}
// PingableDesc describes the Pingable interface.
var PingableDesc rpc.InterfaceDesc = descPingable
// descPingable hides the desc to keep godoc clean.
var descPingable = rpc.InterfaceDesc{
Name: "Pingable",
PkgPath: "v.io/x/ref/services/syncbase/server/interfaces",
Doc: "// Pingable is a pingable RPC server.",
Methods: []rpc.MethodDesc{
{
Name: "Ping",
Doc: "// Ping does a ping. The server-side implementation of Ping will never produce\n// an error.",
},
},
}