247 lines
8.7 KiB
Go
247 lines
8.7 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.2.0
|
|
// - protoc v5.28.2
|
|
// source: command.proto
|
|
|
|
package proto
|
|
|
|
import (
|
|
context "context"
|
|
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
|
|
|
|
// CommandProviderClient is the client API for CommandProvider 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 CommandProviderClient interface {
|
|
AddCommand(ctx context.Context, in *CommandInfo, opts ...grpc.CallOption) (*AddCommandResponse, error)
|
|
RemoveCommand(ctx context.Context, in *CommandLookupRequest, opts ...grpc.CallOption) (*RemoveCommandResponse, error)
|
|
SendCommand(ctx context.Context, in *CommandArgument, opts ...grpc.CallOption) (*CommandReturn, error)
|
|
SendStreamCommand(ctx context.Context, opts ...grpc.CallOption) (CommandProvider_SendStreamCommandClient, error)
|
|
}
|
|
|
|
type commandProviderClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewCommandProviderClient(cc grpc.ClientConnInterface) CommandProviderClient {
|
|
return &commandProviderClient{cc}
|
|
}
|
|
|
|
func (c *commandProviderClient) AddCommand(ctx context.Context, in *CommandInfo, opts ...grpc.CallOption) (*AddCommandResponse, error) {
|
|
out := new(AddCommandResponse)
|
|
err := c.cc.Invoke(ctx, "/proto.CommandProvider/AddCommand", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *commandProviderClient) RemoveCommand(ctx context.Context, in *CommandLookupRequest, opts ...grpc.CallOption) (*RemoveCommandResponse, error) {
|
|
out := new(RemoveCommandResponse)
|
|
err := c.cc.Invoke(ctx, "/proto.CommandProvider/RemoveCommand", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *commandProviderClient) SendCommand(ctx context.Context, in *CommandArgument, opts ...grpc.CallOption) (*CommandReturn, error) {
|
|
out := new(CommandReturn)
|
|
err := c.cc.Invoke(ctx, "/proto.CommandProvider/SendCommand", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *commandProviderClient) SendStreamCommand(ctx context.Context, opts ...grpc.CallOption) (CommandProvider_SendStreamCommandClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &CommandProvider_ServiceDesc.Streams[0], "/proto.CommandProvider/SendStreamCommand", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &commandProviderSendStreamCommandClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type CommandProvider_SendStreamCommandClient interface {
|
|
Send(*CommandArgument) error
|
|
Recv() (*CommandReturn, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type commandProviderSendStreamCommandClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *commandProviderSendStreamCommandClient) Send(m *CommandArgument) error {
|
|
return x.ClientStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *commandProviderSendStreamCommandClient) Recv() (*CommandReturn, error) {
|
|
m := new(CommandReturn)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// CommandProviderServer is the server API for CommandProvider service.
|
|
// All implementations must embed UnimplementedCommandProviderServer
|
|
// for forward compatibility
|
|
type CommandProviderServer interface {
|
|
AddCommand(context.Context, *CommandInfo) (*AddCommandResponse, error)
|
|
RemoveCommand(context.Context, *CommandLookupRequest) (*RemoveCommandResponse, error)
|
|
SendCommand(context.Context, *CommandArgument) (*CommandReturn, error)
|
|
SendStreamCommand(CommandProvider_SendStreamCommandServer) error
|
|
mustEmbedUnimplementedCommandProviderServer()
|
|
}
|
|
|
|
// UnimplementedCommandProviderServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedCommandProviderServer struct {
|
|
}
|
|
|
|
func (UnimplementedCommandProviderServer) AddCommand(context.Context, *CommandInfo) (*AddCommandResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method AddCommand not implemented")
|
|
}
|
|
func (UnimplementedCommandProviderServer) RemoveCommand(context.Context, *CommandLookupRequest) (*RemoveCommandResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method RemoveCommand not implemented")
|
|
}
|
|
func (UnimplementedCommandProviderServer) SendCommand(context.Context, *CommandArgument) (*CommandReturn, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SendCommand not implemented")
|
|
}
|
|
func (UnimplementedCommandProviderServer) SendStreamCommand(CommandProvider_SendStreamCommandServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method SendStreamCommand not implemented")
|
|
}
|
|
func (UnimplementedCommandProviderServer) mustEmbedUnimplementedCommandProviderServer() {}
|
|
|
|
// UnsafeCommandProviderServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to CommandProviderServer will
|
|
// result in compilation errors.
|
|
type UnsafeCommandProviderServer interface {
|
|
mustEmbedUnimplementedCommandProviderServer()
|
|
}
|
|
|
|
func RegisterCommandProviderServer(s grpc.ServiceRegistrar, srv CommandProviderServer) {
|
|
s.RegisterService(&CommandProvider_ServiceDesc, srv)
|
|
}
|
|
|
|
func _CommandProvider_AddCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CommandInfo)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CommandProviderServer).AddCommand(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/proto.CommandProvider/AddCommand",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CommandProviderServer).AddCommand(ctx, req.(*CommandInfo))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _CommandProvider_RemoveCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CommandLookupRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CommandProviderServer).RemoveCommand(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/proto.CommandProvider/RemoveCommand",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CommandProviderServer).RemoveCommand(ctx, req.(*CommandLookupRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _CommandProvider_SendCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CommandArgument)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CommandProviderServer).SendCommand(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/proto.CommandProvider/SendCommand",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CommandProviderServer).SendCommand(ctx, req.(*CommandArgument))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _CommandProvider_SendStreamCommand_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(CommandProviderServer).SendStreamCommand(&commandProviderSendStreamCommandServer{stream})
|
|
}
|
|
|
|
type CommandProvider_SendStreamCommandServer interface {
|
|
Send(*CommandReturn) error
|
|
Recv() (*CommandArgument, error)
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type commandProviderSendStreamCommandServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *commandProviderSendStreamCommandServer) Send(m *CommandReturn) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *commandProviderSendStreamCommandServer) Recv() (*CommandArgument, error) {
|
|
m := new(CommandArgument)
|
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// CommandProvider_ServiceDesc is the grpc.ServiceDesc for CommandProvider service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var CommandProvider_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "proto.CommandProvider",
|
|
HandlerType: (*CommandProviderServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "AddCommand",
|
|
Handler: _CommandProvider_AddCommand_Handler,
|
|
},
|
|
{
|
|
MethodName: "RemoveCommand",
|
|
Handler: _CommandProvider_RemoveCommand_Handler,
|
|
},
|
|
{
|
|
MethodName: "SendCommand",
|
|
Handler: _CommandProvider_SendCommand_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "SendStreamCommand",
|
|
Handler: _CommandProvider_SendStreamCommand_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "command.proto",
|
|
}
|