chore: 并入 iotlcm-upstream-proxy 历史到 upstream-proxy/(原提交 44209ec)
This commit is contained in:
@@ -0,0 +1,155 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v5.29.3
|
||||
// source: msgcall.proto
|
||||
|
||||
package pb
|
||||
|
||||
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.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
MsgCall_OneCall_FullMethodName = "/PbMsgCall.MsgCall/OneCall"
|
||||
MsgCall_StreamCall_FullMethodName = "/PbMsgCall.MsgCall/StreamCall"
|
||||
)
|
||||
|
||||
// MsgCallClient is the client API for MsgCall 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 MsgCallClient interface {
|
||||
OneCall(ctx context.Context, in *MsgReq, opts ...grpc.CallOption) (*MsgRes, error)
|
||||
StreamCall(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[MsgReq, MsgRes], error)
|
||||
}
|
||||
|
||||
type msgCallClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewMsgCallClient(cc grpc.ClientConnInterface) MsgCallClient {
|
||||
return &msgCallClient{cc}
|
||||
}
|
||||
|
||||
func (c *msgCallClient) OneCall(ctx context.Context, in *MsgReq, opts ...grpc.CallOption) (*MsgRes, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(MsgRes)
|
||||
err := c.cc.Invoke(ctx, MsgCall_OneCall_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgCallClient) StreamCall(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[MsgReq, MsgRes], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &MsgCall_ServiceDesc.Streams[0], MsgCall_StreamCall_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[MsgReq, MsgRes]{ClientStream: stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type MsgCall_StreamCallClient = grpc.BidiStreamingClient[MsgReq, MsgRes]
|
||||
|
||||
// MsgCallServer is the server API for MsgCall service.
|
||||
// All implementations must embed UnimplementedMsgCallServer
|
||||
// for forward compatibility.
|
||||
type MsgCallServer interface {
|
||||
OneCall(context.Context, *MsgReq) (*MsgRes, error)
|
||||
StreamCall(grpc.BidiStreamingServer[MsgReq, MsgRes]) error
|
||||
mustEmbedUnimplementedMsgCallServer()
|
||||
}
|
||||
|
||||
// UnimplementedMsgCallServer 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 UnimplementedMsgCallServer struct{}
|
||||
|
||||
func (UnimplementedMsgCallServer) OneCall(context.Context, *MsgReq) (*MsgRes, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method OneCall not implemented")
|
||||
}
|
||||
func (UnimplementedMsgCallServer) StreamCall(grpc.BidiStreamingServer[MsgReq, MsgRes]) error {
|
||||
return status.Error(codes.Unimplemented, "method StreamCall not implemented")
|
||||
}
|
||||
func (UnimplementedMsgCallServer) mustEmbedUnimplementedMsgCallServer() {}
|
||||
func (UnimplementedMsgCallServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeMsgCallServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to MsgCallServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeMsgCallServer interface {
|
||||
mustEmbedUnimplementedMsgCallServer()
|
||||
}
|
||||
|
||||
func RegisterMsgCallServer(s grpc.ServiceRegistrar, srv MsgCallServer) {
|
||||
// If the following call panics, it indicates UnimplementedMsgCallServer 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(&MsgCall_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _MsgCall_OneCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgCallServer).OneCall(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MsgCall_OneCall_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgCallServer).OneCall(ctx, req.(*MsgReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MsgCall_StreamCall_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(MsgCallServer).StreamCall(&grpc.GenericServerStream[MsgReq, MsgRes]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type MsgCall_StreamCallServer = grpc.BidiStreamingServer[MsgReq, MsgRes]
|
||||
|
||||
// MsgCall_ServiceDesc is the grpc.ServiceDesc for MsgCall service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var MsgCall_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "PbMsgCall.MsgCall",
|
||||
HandlerType: (*MsgCallServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "OneCall",
|
||||
Handler: _MsgCall_OneCall_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "StreamCall",
|
||||
Handler: _MsgCall_StreamCall_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "msgcall.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user