blob: 424ee58372a67700b6cf086a4a4632caf95e2ae4 [file] [log] [blame]
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.1.0
// - protoc v3.17.1
// source: chromiumos/config/api/test/tls/wiring.proto
package tls
import (
context "context"
longrunning "go.chromium.org/chromiumos/config/go/api/test/tls/dependencies/longrunning"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// WiringClient is the client API for Wiring service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type WiringClient interface {
// GetDut gets a DUT resource, which contains various information
// about a DUT.
GetDut(ctx context.Context, in *GetDutRequest, opts ...grpc.CallOption) (*Dut, error)
// Open a port on the DUT and return an address which the client can
// use to connect to the port on the DUT.
// The TLE SHOULD attempt to keep this address-to-port connection open for
// the duration of the RTD's runtime.
// The connection is not restarted if it is interrupted.
//
// If the connection from a previous call with the same arguments is
// still open, this RPC SHOULD do nothing and return the same
// response.
// If the previous connection was closed, the implementation SHOULD
// attempt to rebind and return the same address.
// If the implementation lost and cannot reobtain the previous
// address, it MAY return a new address.
//
// This RPC does NOT ensure that there is a service running on the
// DUT for the given port.
// A service running on the given port MUST NOT required for this RPC
// to succeed.
// It is not specified whether this RPC will open the given port in
// the DUT's firewall, if the DUT has a firewall.
OpenDutPort(ctx context.Context, in *OpenDutPortRequest, opts ...grpc.CallOption) (*OpenDutPortResponse, error)
// SetDutPowerSupply sets the connected power state for the DUT. It is
// the caller's responsibility to wait for the effects of the call
// to propagate, e.g. waiting in between calls to set the power OFF
// and ON.
//
// EXPERIMENTAL
SetDutPowerSupply(ctx context.Context, in *SetDutPowerSupplyRequest, opts ...grpc.CallOption) (*SetDutPowerSupplyResponse, error)
// CacheForDut caches some data to be accessible for the DUT.
// This will be made available to the DUT via a returned URL.
// The implementation MUST ensure the returned URL is usable at least for the
// lifetime of the RTD invocation.
CacheForDut(ctx context.Context, in *CacheForDutRequest, opts ...grpc.CallOption) (*longrunning.Operation, error)
// CallServo performs an XML-RPC call against the servod for
// the servo connected to a DUT.
//
// The implementation, not the caller, ensures that there is a
// running servod instance for the DUT's servo, or is otherwise able
// to provide identical functionality.
//
// This RPC mirrors the XML-RPC specification (http://xmlrpc.com/spec.md).
CallServo(ctx context.Context, in *CallServoRequest, opts ...grpc.CallOption) (*CallServoResponse, error)
// ExposePortToDut exposes an RTD port to the specified DUT.
//
// The TLE SHOULD attempt to keep this address-to-port connection open for
// the duration of the RTD's runtime.
// The connection is not restarted if it is interrupted.
// By default, the implementation MAY expose a port that cannot persist
// across DUT reboots.
// By default, the implementation MAY use 'localhost' as the exposed address.
ExposePortToDut(ctx context.Context, in *ExposePortToDutRequest, opts ...grpc.CallOption) (*ExposePortToDutResponse, error)
}
type wiringClient struct {
cc grpc.ClientConnInterface
}
func NewWiringClient(cc grpc.ClientConnInterface) WiringClient {
return &wiringClient{cc}
}
func (c *wiringClient) GetDut(ctx context.Context, in *GetDutRequest, opts ...grpc.CallOption) (*Dut, error) {
out := new(Dut)
err := c.cc.Invoke(ctx, "/chromiumos.config.api.test.tls.Wiring/GetDut", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wiringClient) OpenDutPort(ctx context.Context, in *OpenDutPortRequest, opts ...grpc.CallOption) (*OpenDutPortResponse, error) {
out := new(OpenDutPortResponse)
err := c.cc.Invoke(ctx, "/chromiumos.config.api.test.tls.Wiring/OpenDutPort", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wiringClient) SetDutPowerSupply(ctx context.Context, in *SetDutPowerSupplyRequest, opts ...grpc.CallOption) (*SetDutPowerSupplyResponse, error) {
out := new(SetDutPowerSupplyResponse)
err := c.cc.Invoke(ctx, "/chromiumos.config.api.test.tls.Wiring/SetDutPowerSupply", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wiringClient) CacheForDut(ctx context.Context, in *CacheForDutRequest, opts ...grpc.CallOption) (*longrunning.Operation, error) {
out := new(longrunning.Operation)
err := c.cc.Invoke(ctx, "/chromiumos.config.api.test.tls.Wiring/CacheForDut", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wiringClient) CallServo(ctx context.Context, in *CallServoRequest, opts ...grpc.CallOption) (*CallServoResponse, error) {
out := new(CallServoResponse)
err := c.cc.Invoke(ctx, "/chromiumos.config.api.test.tls.Wiring/CallServo", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wiringClient) ExposePortToDut(ctx context.Context, in *ExposePortToDutRequest, opts ...grpc.CallOption) (*ExposePortToDutResponse, error) {
out := new(ExposePortToDutResponse)
err := c.cc.Invoke(ctx, "/chromiumos.config.api.test.tls.Wiring/ExposePortToDut", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// WiringServer is the server API for Wiring service.
// All implementations should embed UnimplementedWiringServer
// for forward compatibility
type WiringServer interface {
// GetDut gets a DUT resource, which contains various information
// about a DUT.
GetDut(context.Context, *GetDutRequest) (*Dut, error)
// Open a port on the DUT and return an address which the client can
// use to connect to the port on the DUT.
// The TLE SHOULD attempt to keep this address-to-port connection open for
// the duration of the RTD's runtime.
// The connection is not restarted if it is interrupted.
//
// If the connection from a previous call with the same arguments is
// still open, this RPC SHOULD do nothing and return the same
// response.
// If the previous connection was closed, the implementation SHOULD
// attempt to rebind and return the same address.
// If the implementation lost and cannot reobtain the previous
// address, it MAY return a new address.
//
// This RPC does NOT ensure that there is a service running on the
// DUT for the given port.
// A service running on the given port MUST NOT required for this RPC
// to succeed.
// It is not specified whether this RPC will open the given port in
// the DUT's firewall, if the DUT has a firewall.
OpenDutPort(context.Context, *OpenDutPortRequest) (*OpenDutPortResponse, error)
// SetDutPowerSupply sets the connected power state for the DUT. It is
// the caller's responsibility to wait for the effects of the call
// to propagate, e.g. waiting in between calls to set the power OFF
// and ON.
//
// EXPERIMENTAL
SetDutPowerSupply(context.Context, *SetDutPowerSupplyRequest) (*SetDutPowerSupplyResponse, error)
// CacheForDut caches some data to be accessible for the DUT.
// This will be made available to the DUT via a returned URL.
// The implementation MUST ensure the returned URL is usable at least for the
// lifetime of the RTD invocation.
CacheForDut(context.Context, *CacheForDutRequest) (*longrunning.Operation, error)
// CallServo performs an XML-RPC call against the servod for
// the servo connected to a DUT.
//
// The implementation, not the caller, ensures that there is a
// running servod instance for the DUT's servo, or is otherwise able
// to provide identical functionality.
//
// This RPC mirrors the XML-RPC specification (http://xmlrpc.com/spec.md).
CallServo(context.Context, *CallServoRequest) (*CallServoResponse, error)
// ExposePortToDut exposes an RTD port to the specified DUT.
//
// The TLE SHOULD attempt to keep this address-to-port connection open for
// the duration of the RTD's runtime.
// The connection is not restarted if it is interrupted.
// By default, the implementation MAY expose a port that cannot persist
// across DUT reboots.
// By default, the implementation MAY use 'localhost' as the exposed address.
ExposePortToDut(context.Context, *ExposePortToDutRequest) (*ExposePortToDutResponse, error)
}
// UnimplementedWiringServer should be embedded to have forward compatible implementations.
type UnimplementedWiringServer struct {
}
func (UnimplementedWiringServer) GetDut(context.Context, *GetDutRequest) (*Dut, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetDut not implemented")
}
func (UnimplementedWiringServer) OpenDutPort(context.Context, *OpenDutPortRequest) (*OpenDutPortResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method OpenDutPort not implemented")
}
func (UnimplementedWiringServer) SetDutPowerSupply(context.Context, *SetDutPowerSupplyRequest) (*SetDutPowerSupplyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetDutPowerSupply not implemented")
}
func (UnimplementedWiringServer) CacheForDut(context.Context, *CacheForDutRequest) (*longrunning.Operation, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheForDut not implemented")
}
func (UnimplementedWiringServer) CallServo(context.Context, *CallServoRequest) (*CallServoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CallServo not implemented")
}
func (UnimplementedWiringServer) ExposePortToDut(context.Context, *ExposePortToDutRequest) (*ExposePortToDutResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ExposePortToDut not implemented")
}
// UnsafeWiringServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WiringServer will
// result in compilation errors.
type UnsafeWiringServer interface {
mustEmbedUnimplementedWiringServer()
}
func RegisterWiringServer(s grpc.ServiceRegistrar, srv WiringServer) {
s.RegisterService(&Wiring_ServiceDesc, srv)
}
func _Wiring_GetDut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetDutRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WiringServer).GetDut(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/chromiumos.config.api.test.tls.Wiring/GetDut",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WiringServer).GetDut(ctx, req.(*GetDutRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Wiring_OpenDutPort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(OpenDutPortRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WiringServer).OpenDutPort(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/chromiumos.config.api.test.tls.Wiring/OpenDutPort",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WiringServer).OpenDutPort(ctx, req.(*OpenDutPortRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Wiring_SetDutPowerSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetDutPowerSupplyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WiringServer).SetDutPowerSupply(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/chromiumos.config.api.test.tls.Wiring/SetDutPowerSupply",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WiringServer).SetDutPowerSupply(ctx, req.(*SetDutPowerSupplyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Wiring_CacheForDut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CacheForDutRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WiringServer).CacheForDut(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/chromiumos.config.api.test.tls.Wiring/CacheForDut",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WiringServer).CacheForDut(ctx, req.(*CacheForDutRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Wiring_CallServo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CallServoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WiringServer).CallServo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/chromiumos.config.api.test.tls.Wiring/CallServo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WiringServer).CallServo(ctx, req.(*CallServoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Wiring_ExposePortToDut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ExposePortToDutRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WiringServer).ExposePortToDut(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/chromiumos.config.api.test.tls.Wiring/ExposePortToDut",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WiringServer).ExposePortToDut(ctx, req.(*ExposePortToDutRequest))
}
return interceptor(ctx, in, info, handler)
}
// Wiring_ServiceDesc is the grpc.ServiceDesc for Wiring service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Wiring_ServiceDesc = grpc.ServiceDesc{
ServiceName: "chromiumos.config.api.test.tls.Wiring",
HandlerType: (*WiringServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetDut",
Handler: _Wiring_GetDut_Handler,
},
{
MethodName: "OpenDutPort",
Handler: _Wiring_OpenDutPort_Handler,
},
{
MethodName: "SetDutPowerSupply",
Handler: _Wiring_SetDutPowerSupply_Handler,
},
{
MethodName: "CacheForDut",
Handler: _Wiring_CacheForDut_Handler,
},
{
MethodName: "CallServo",
Handler: _Wiring_CallServo_Handler,
},
{
MethodName: "ExposePortToDut",
Handler: _Wiring_ExposePortToDut_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "chromiumos/config/api/test/tls/wiring.proto",
}