使用最新的protoc-gen-go和protoc-gen-go-grpc插件

This commit is contained in:
刘祥超
2023-08-06 23:36:50 +08:00
parent 65be70d015
commit e6af6b6575
315 changed files with 55373 additions and 51574 deletions

View File

@@ -1,17 +1,12 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc-gen-go v1.31.0
// protoc v3.19.4
// source: service_message_task.proto
package pb
import (
context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -25,10 +20,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type CountMessageTasksWithStatusRequest_Status int32
const (
@@ -1090,313 +1081,3 @@ func file_service_message_task_proto_init() {
file_service_message_task_proto_goTypes = nil
file_service_message_task_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// MessageTaskServiceClient is the client API for MessageTaskService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type MessageTaskServiceClient interface {
// 创建消息任务
CreateMessageTask(ctx context.Context, in *CreateMessageTaskRequest, opts ...grpc.CallOption) (*CreateMessageTaskResponse, error)
// 查找要发送的消息任务
FindSendingMessageTasks(ctx context.Context, in *FindSendingMessageTasksRequest, opts ...grpc.CallOption) (*FindSendingMessageTasksResponse, error)
// 修改消息任务状态
UpdateMessageTaskStatus(ctx context.Context, in *UpdateMessageTaskStatusRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 删除消息任务
DeleteMessageTask(ctx context.Context, in *DeleteMessageTaskRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 读取消息任务状态
FindEnabledMessageTask(ctx context.Context, in *FindEnabledMessageTaskRequest, opts ...grpc.CallOption) (*FindEnabledMessageTaskResponse, error)
// 计算某个状态的消息任务数量
CountMessageTasksWithStatus(ctx context.Context, in *CountMessageTasksWithStatusRequest, opts ...grpc.CallOption) (*RPCCountResponse, error)
// 根据状态列出某页任务
ListMessageTasksWithStatus(ctx context.Context, in *ListMessageTasksWithStatusRequest, opts ...grpc.CallOption) (*ListMessageTasksWithStatusResponse, error)
}
type messageTaskServiceClient struct {
cc grpc.ClientConnInterface
}
func NewMessageTaskServiceClient(cc grpc.ClientConnInterface) MessageTaskServiceClient {
return &messageTaskServiceClient{cc}
}
func (c *messageTaskServiceClient) CreateMessageTask(ctx context.Context, in *CreateMessageTaskRequest, opts ...grpc.CallOption) (*CreateMessageTaskResponse, error) {
out := new(CreateMessageTaskResponse)
err := c.cc.Invoke(ctx, "/pb.MessageTaskService/createMessageTask", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *messageTaskServiceClient) FindSendingMessageTasks(ctx context.Context, in *FindSendingMessageTasksRequest, opts ...grpc.CallOption) (*FindSendingMessageTasksResponse, error) {
out := new(FindSendingMessageTasksResponse)
err := c.cc.Invoke(ctx, "/pb.MessageTaskService/findSendingMessageTasks", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *messageTaskServiceClient) UpdateMessageTaskStatus(ctx context.Context, in *UpdateMessageTaskStatusRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.MessageTaskService/updateMessageTaskStatus", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *messageTaskServiceClient) DeleteMessageTask(ctx context.Context, in *DeleteMessageTaskRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.MessageTaskService/deleteMessageTask", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *messageTaskServiceClient) FindEnabledMessageTask(ctx context.Context, in *FindEnabledMessageTaskRequest, opts ...grpc.CallOption) (*FindEnabledMessageTaskResponse, error) {
out := new(FindEnabledMessageTaskResponse)
err := c.cc.Invoke(ctx, "/pb.MessageTaskService/findEnabledMessageTask", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *messageTaskServiceClient) CountMessageTasksWithStatus(ctx context.Context, in *CountMessageTasksWithStatusRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) {
out := new(RPCCountResponse)
err := c.cc.Invoke(ctx, "/pb.MessageTaskService/countMessageTasksWithStatus", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *messageTaskServiceClient) ListMessageTasksWithStatus(ctx context.Context, in *ListMessageTasksWithStatusRequest, opts ...grpc.CallOption) (*ListMessageTasksWithStatusResponse, error) {
out := new(ListMessageTasksWithStatusResponse)
err := c.cc.Invoke(ctx, "/pb.MessageTaskService/listMessageTasksWithStatus", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// MessageTaskServiceServer is the server API for MessageTaskService service.
type MessageTaskServiceServer interface {
// 创建消息任务
CreateMessageTask(context.Context, *CreateMessageTaskRequest) (*CreateMessageTaskResponse, error)
// 查找要发送的消息任务
FindSendingMessageTasks(context.Context, *FindSendingMessageTasksRequest) (*FindSendingMessageTasksResponse, error)
// 修改消息任务状态
UpdateMessageTaskStatus(context.Context, *UpdateMessageTaskStatusRequest) (*RPCSuccess, error)
// 删除消息任务
DeleteMessageTask(context.Context, *DeleteMessageTaskRequest) (*RPCSuccess, error)
// 读取消息任务状态
FindEnabledMessageTask(context.Context, *FindEnabledMessageTaskRequest) (*FindEnabledMessageTaskResponse, error)
// 计算某个状态的消息任务数量
CountMessageTasksWithStatus(context.Context, *CountMessageTasksWithStatusRequest) (*RPCCountResponse, error)
// 根据状态列出某页任务
ListMessageTasksWithStatus(context.Context, *ListMessageTasksWithStatusRequest) (*ListMessageTasksWithStatusResponse, error)
}
// UnimplementedMessageTaskServiceServer can be embedded to have forward compatible implementations.
type UnimplementedMessageTaskServiceServer struct {
}
func (*UnimplementedMessageTaskServiceServer) CreateMessageTask(context.Context, *CreateMessageTaskRequest) (*CreateMessageTaskResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateMessageTask not implemented")
}
func (*UnimplementedMessageTaskServiceServer) FindSendingMessageTasks(context.Context, *FindSendingMessageTasksRequest) (*FindSendingMessageTasksResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindSendingMessageTasks not implemented")
}
func (*UnimplementedMessageTaskServiceServer) UpdateMessageTaskStatus(context.Context, *UpdateMessageTaskStatusRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateMessageTaskStatus not implemented")
}
func (*UnimplementedMessageTaskServiceServer) DeleteMessageTask(context.Context, *DeleteMessageTaskRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteMessageTask not implemented")
}
func (*UnimplementedMessageTaskServiceServer) FindEnabledMessageTask(context.Context, *FindEnabledMessageTaskRequest) (*FindEnabledMessageTaskResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindEnabledMessageTask not implemented")
}
func (*UnimplementedMessageTaskServiceServer) CountMessageTasksWithStatus(context.Context, *CountMessageTasksWithStatusRequest) (*RPCCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CountMessageTasksWithStatus not implemented")
}
func (*UnimplementedMessageTaskServiceServer) ListMessageTasksWithStatus(context.Context, *ListMessageTasksWithStatusRequest) (*ListMessageTasksWithStatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListMessageTasksWithStatus not implemented")
}
func RegisterMessageTaskServiceServer(s *grpc.Server, srv MessageTaskServiceServer) {
s.RegisterService(&_MessageTaskService_serviceDesc, srv)
}
func _MessageTaskService_CreateMessageTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateMessageTaskRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MessageTaskServiceServer).CreateMessageTask(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.MessageTaskService/CreateMessageTask",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MessageTaskServiceServer).CreateMessageTask(ctx, req.(*CreateMessageTaskRequest))
}
return interceptor(ctx, in, info, handler)
}
func _MessageTaskService_FindSendingMessageTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindSendingMessageTasksRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MessageTaskServiceServer).FindSendingMessageTasks(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.MessageTaskService/FindSendingMessageTasks",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MessageTaskServiceServer).FindSendingMessageTasks(ctx, req.(*FindSendingMessageTasksRequest))
}
return interceptor(ctx, in, info, handler)
}
func _MessageTaskService_UpdateMessageTaskStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateMessageTaskStatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MessageTaskServiceServer).UpdateMessageTaskStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.MessageTaskService/UpdateMessageTaskStatus",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MessageTaskServiceServer).UpdateMessageTaskStatus(ctx, req.(*UpdateMessageTaskStatusRequest))
}
return interceptor(ctx, in, info, handler)
}
func _MessageTaskService_DeleteMessageTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteMessageTaskRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MessageTaskServiceServer).DeleteMessageTask(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.MessageTaskService/DeleteMessageTask",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MessageTaskServiceServer).DeleteMessageTask(ctx, req.(*DeleteMessageTaskRequest))
}
return interceptor(ctx, in, info, handler)
}
func _MessageTaskService_FindEnabledMessageTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindEnabledMessageTaskRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MessageTaskServiceServer).FindEnabledMessageTask(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.MessageTaskService/FindEnabledMessageTask",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MessageTaskServiceServer).FindEnabledMessageTask(ctx, req.(*FindEnabledMessageTaskRequest))
}
return interceptor(ctx, in, info, handler)
}
func _MessageTaskService_CountMessageTasksWithStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CountMessageTasksWithStatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MessageTaskServiceServer).CountMessageTasksWithStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.MessageTaskService/CountMessageTasksWithStatus",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MessageTaskServiceServer).CountMessageTasksWithStatus(ctx, req.(*CountMessageTasksWithStatusRequest))
}
return interceptor(ctx, in, info, handler)
}
func _MessageTaskService_ListMessageTasksWithStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListMessageTasksWithStatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MessageTaskServiceServer).ListMessageTasksWithStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.MessageTaskService/ListMessageTasksWithStatus",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MessageTaskServiceServer).ListMessageTasksWithStatus(ctx, req.(*ListMessageTasksWithStatusRequest))
}
return interceptor(ctx, in, info, handler)
}
var _MessageTaskService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.MessageTaskService",
HandlerType: (*MessageTaskServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "createMessageTask",
Handler: _MessageTaskService_CreateMessageTask_Handler,
},
{
MethodName: "findSendingMessageTasks",
Handler: _MessageTaskService_FindSendingMessageTasks_Handler,
},
{
MethodName: "updateMessageTaskStatus",
Handler: _MessageTaskService_UpdateMessageTaskStatus_Handler,
},
{
MethodName: "deleteMessageTask",
Handler: _MessageTaskService_DeleteMessageTask_Handler,
},
{
MethodName: "findEnabledMessageTask",
Handler: _MessageTaskService_FindEnabledMessageTask_Handler,
},
{
MethodName: "countMessageTasksWithStatus",
Handler: _MessageTaskService_CountMessageTasksWithStatus_Handler,
},
{
MethodName: "listMessageTasksWithStatus",
Handler: _MessageTaskService_ListMessageTasksWithStatus_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_message_task.proto",
}