blob: 75691e3113b49bd8d02bc8dcce1c9535a4961505 [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: poolheater.vdl
package sample
import (
// VDL system imports
"v.io/v23"
"v.io/v23/context"
"v.io/v23/rpc"
)
// PoolHeaterClientMethods is the client interface
// containing PoolHeater methods.
//
// PoolHeater allows clients to control when the pool is being heated.
type PoolHeaterClientMethods interface {
// Status retrieves the PoolHeater's status (i.e., active, idle) and temperature.
Status(*context.T, ...rpc.CallOpt) (running string, temperature uint64, err error)
// Start informs the PoolHeater to heat the pool to the given temperature until the duration expires.
Start(ctx *context.T, temperature uint64, duration uint64, opts ...rpc.CallOpt) error
// Stop informs the PoolHeater to cease heating the pool.
Stop(*context.T, ...rpc.CallOpt) error
}
// PoolHeaterClientStub adds universal methods to PoolHeaterClientMethods.
type PoolHeaterClientStub interface {
PoolHeaterClientMethods
rpc.UniversalServiceMethods
}
// PoolHeaterClient returns a client stub for PoolHeater.
func PoolHeaterClient(name string) PoolHeaterClientStub {
return implPoolHeaterClientStub{name}
}
type implPoolHeaterClientStub struct {
name string
}
func (c implPoolHeaterClientStub) Status(ctx *context.T, opts ...rpc.CallOpt) (o0 string, o1 uint64, err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "Status", nil, []interface{}{&o0, &o1}, opts...)
return
}
func (c implPoolHeaterClientStub) Start(ctx *context.T, i0 uint64, i1 uint64, opts ...rpc.CallOpt) (err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "Start", []interface{}{i0, i1}, nil, opts...)
return
}
func (c implPoolHeaterClientStub) Stop(ctx *context.T, opts ...rpc.CallOpt) (err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "Stop", nil, nil, opts...)
return
}
// PoolHeaterServerMethods is the interface a server writer
// implements for PoolHeater.
//
// PoolHeater allows clients to control when the pool is being heated.
type PoolHeaterServerMethods interface {
// Status retrieves the PoolHeater's status (i.e., active, idle) and temperature.
Status(*context.T, rpc.ServerCall) (running string, temperature uint64, err error)
// Start informs the PoolHeater to heat the pool to the given temperature until the duration expires.
Start(ctx *context.T, call rpc.ServerCall, temperature uint64, duration uint64) error
// Stop informs the PoolHeater to cease heating the pool.
Stop(*context.T, rpc.ServerCall) error
}
// PoolHeaterServerStubMethods is the server interface containing
// PoolHeater methods, as expected by rpc.Server.
// There is no difference between this interface and PoolHeaterServerMethods
// since there are no streaming methods.
type PoolHeaterServerStubMethods PoolHeaterServerMethods
// PoolHeaterServerStub adds universal methods to PoolHeaterServerStubMethods.
type PoolHeaterServerStub interface {
PoolHeaterServerStubMethods
// Describe the PoolHeater interfaces.
Describe__() []rpc.InterfaceDesc
}
// PoolHeaterServer returns a server stub for PoolHeater.
// It converts an implementation of PoolHeaterServerMethods into
// an object that may be used by rpc.Server.
func PoolHeaterServer(impl PoolHeaterServerMethods) PoolHeaterServerStub {
stub := implPoolHeaterServerStub{
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 implPoolHeaterServerStub struct {
impl PoolHeaterServerMethods
gs *rpc.GlobState
}
func (s implPoolHeaterServerStub) Status(ctx *context.T, call rpc.ServerCall) (string, uint64, error) {
return s.impl.Status(ctx, call)
}
func (s implPoolHeaterServerStub) Start(ctx *context.T, call rpc.ServerCall, i0 uint64, i1 uint64) error {
return s.impl.Start(ctx, call, i0, i1)
}
func (s implPoolHeaterServerStub) Stop(ctx *context.T, call rpc.ServerCall) error {
return s.impl.Stop(ctx, call)
}
func (s implPoolHeaterServerStub) Globber() *rpc.GlobState {
return s.gs
}
func (s implPoolHeaterServerStub) Describe__() []rpc.InterfaceDesc {
return []rpc.InterfaceDesc{PoolHeaterDesc}
}
// PoolHeaterDesc describes the PoolHeater interface.
var PoolHeaterDesc rpc.InterfaceDesc = descPoolHeater
// descPoolHeater hides the desc to keep godoc clean.
var descPoolHeater = rpc.InterfaceDesc{
Name: "PoolHeater",
PkgPath: "v.io/x/browser/sample",
Doc: "// PoolHeater allows clients to control when the pool is being heated.",
Methods: []rpc.MethodDesc{
{
Name: "Status",
Doc: "// Status retrieves the PoolHeater's status (i.e., active, idle) and temperature.",
OutArgs: []rpc.ArgDesc{
{"running", ``}, // string
{"temperature", ``}, // uint64
},
},
{
Name: "Start",
Doc: "// Start informs the PoolHeater to heat the pool to the given temperature until the duration expires.",
InArgs: []rpc.ArgDesc{
{"temperature", ``}, // uint64
{"duration", ``}, // uint64
},
},
{
Name: "Stop",
Doc: "// Stop informs the PoolHeater to cease heating the pool.",
},
},
}