✨ Push stream able to get which request success
⬆️ Upgrade protobuf version
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v5.28.2
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v5.28.3
|
||||
// source: command.proto
|
||||
|
||||
package proto
|
||||
@@ -15,8 +15,15 @@ import (
|
||||
|
||||
// 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
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
CommandProvider_AddCommand_FullMethodName = "/proto.CommandProvider/AddCommand"
|
||||
CommandProvider_RemoveCommand_FullMethodName = "/proto.CommandProvider/RemoveCommand"
|
||||
CommandProvider_SendCommand_FullMethodName = "/proto.CommandProvider/SendCommand"
|
||||
CommandProvider_SendStreamCommand_FullMethodName = "/proto.CommandProvider/SendStreamCommand"
|
||||
)
|
||||
|
||||
// CommandProviderClient is the client API for CommandProvider service.
|
||||
//
|
||||
@@ -25,7 +32,7 @@ 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)
|
||||
SendStreamCommand(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CommandArgument, CommandReturn], error)
|
||||
}
|
||||
|
||||
type commandProviderClient struct {
|
||||
@@ -37,8 +44,9 @@ func NewCommandProviderClient(cc grpc.ClientConnInterface) CommandProviderClient
|
||||
}
|
||||
|
||||
func (c *commandProviderClient) AddCommand(ctx context.Context, in *CommandInfo, opts ...grpc.CallOption) (*AddCommandResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AddCommandResponse)
|
||||
err := c.cc.Invoke(ctx, "/proto.CommandProvider/AddCommand", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CommandProvider_AddCommand_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -46,8 +54,9 @@ func (c *commandProviderClient) AddCommand(ctx context.Context, in *CommandInfo,
|
||||
}
|
||||
|
||||
func (c *commandProviderClient) RemoveCommand(ctx context.Context, in *CommandLookupRequest, opts ...grpc.CallOption) (*RemoveCommandResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RemoveCommandResponse)
|
||||
err := c.cc.Invoke(ctx, "/proto.CommandProvider/RemoveCommand", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CommandProvider_RemoveCommand_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -55,59 +64,45 @@ func (c *commandProviderClient) RemoveCommand(ctx context.Context, in *CommandLo
|
||||
}
|
||||
|
||||
func (c *commandProviderClient) SendCommand(ctx context.Context, in *CommandArgument, opts ...grpc.CallOption) (*CommandReturn, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CommandReturn)
|
||||
err := c.cc.Invoke(ctx, "/proto.CommandProvider/SendCommand", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CommandProvider_SendCommand_FullMethodName, in, out, cOpts...)
|
||||
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...)
|
||||
func (c *commandProviderClient) SendStreamCommand(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CommandArgument, CommandReturn], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &CommandProvider_ServiceDesc.Streams[0], CommandProvider_SendStreamCommand_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &commandProviderSendStreamCommandClient{stream}
|
||||
x := &grpc.GenericClientStream[CommandArgument, CommandReturn]{ClientStream: 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
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type CommandProvider_SendStreamCommandClient = grpc.BidiStreamingClient[CommandArgument, CommandReturn]
|
||||
|
||||
// CommandProviderServer is the server API for CommandProvider service.
|
||||
// All implementations must embed UnimplementedCommandProviderServer
|
||||
// for forward compatibility
|
||||
// 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
|
||||
SendStreamCommand(grpc.BidiStreamingServer[CommandArgument, CommandReturn]) error
|
||||
mustEmbedUnimplementedCommandProviderServer()
|
||||
}
|
||||
|
||||
// UnimplementedCommandProviderServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedCommandProviderServer struct {
|
||||
}
|
||||
// UnimplementedCommandProviderServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedCommandProviderServer struct{}
|
||||
|
||||
func (UnimplementedCommandProviderServer) AddCommand(context.Context, *CommandInfo) (*AddCommandResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AddCommand not implemented")
|
||||
@@ -118,10 +113,11 @@ func (UnimplementedCommandProviderServer) RemoveCommand(context.Context, *Comman
|
||||
func (UnimplementedCommandProviderServer) SendCommand(context.Context, *CommandArgument) (*CommandReturn, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SendCommand not implemented")
|
||||
}
|
||||
func (UnimplementedCommandProviderServer) SendStreamCommand(CommandProvider_SendStreamCommandServer) error {
|
||||
func (UnimplementedCommandProviderServer) SendStreamCommand(grpc.BidiStreamingServer[CommandArgument, CommandReturn]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method SendStreamCommand not implemented")
|
||||
}
|
||||
func (UnimplementedCommandProviderServer) mustEmbedUnimplementedCommandProviderServer() {}
|
||||
func (UnimplementedCommandProviderServer) testEmbeddedByValue() {}
|
||||
|
||||
// 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
|
||||
@@ -131,6 +127,13 @@ type UnsafeCommandProviderServer interface {
|
||||
}
|
||||
|
||||
func RegisterCommandProviderServer(s grpc.ServiceRegistrar, srv CommandProviderServer) {
|
||||
// If the following call pancis, it indicates UnimplementedCommandProviderServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&CommandProvider_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
@@ -144,7 +147,7 @@ func _CommandProvider_AddCommand_Handler(srv interface{}, ctx context.Context, d
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/proto.CommandProvider/AddCommand",
|
||||
FullMethod: CommandProvider_AddCommand_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CommandProviderServer).AddCommand(ctx, req.(*CommandInfo))
|
||||
@@ -162,7 +165,7 @@ func _CommandProvider_RemoveCommand_Handler(srv interface{}, ctx context.Context
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/proto.CommandProvider/RemoveCommand",
|
||||
FullMethod: CommandProvider_RemoveCommand_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CommandProviderServer).RemoveCommand(ctx, req.(*CommandLookupRequest))
|
||||
@@ -180,7 +183,7 @@ func _CommandProvider_SendCommand_Handler(srv interface{}, ctx context.Context,
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/proto.CommandProvider/SendCommand",
|
||||
FullMethod: CommandProvider_SendCommand_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CommandProviderServer).SendCommand(ctx, req.(*CommandArgument))
|
||||
@@ -189,30 +192,11 @@ func _CommandProvider_SendCommand_Handler(srv interface{}, ctx context.Context,
|
||||
}
|
||||
|
||||
func _CommandProvider_SendStreamCommand_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(CommandProviderServer).SendStreamCommand(&commandProviderSendStreamCommandServer{stream})
|
||||
return srv.(CommandProviderServer).SendStreamCommand(&grpc.GenericServerStream[CommandArgument, CommandReturn]{ServerStream: 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
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type CommandProvider_SendStreamCommandServer = grpc.BidiStreamingServer[CommandArgument, CommandReturn]
|
||||
|
||||
// CommandProvider_ServiceDesc is the grpc.ServiceDesc for CommandProvider service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
|
Reference in New Issue
Block a user