mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
refactor: rename PING code to HEARTBEAT in node service and update related proto files
This commit is contained in:
@@ -276,7 +276,7 @@ func (svc *MasterService) pingNodeClient(n *models.Node) (ok bool) {
|
||||
return false
|
||||
}
|
||||
err := stream.Send(&grpc.NodeServiceSubscribeResponse{
|
||||
Code: grpc.NodeServiceSubscribeCode_PING,
|
||||
Code: grpc.NodeServiceSubscribeCode_HEARTBEAT,
|
||||
})
|
||||
if err != nil {
|
||||
svc.Errorf("failed to ping worker node client[%s]: %v", n.Key, err)
|
||||
|
||||
@@ -273,7 +273,7 @@ func (svc *WorkerService) subscribe() {
|
||||
}
|
||||
|
||||
switch msg.Code {
|
||||
case grpc.NodeServiceSubscribeCode_PING:
|
||||
case grpc.NodeServiceSubscribeCode_HEARTBEAT:
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,16 +23,16 @@ const (
|
||||
type NodeServiceSubscribeCode int32
|
||||
|
||||
const (
|
||||
NodeServiceSubscribeCode_PING NodeServiceSubscribeCode = 0
|
||||
NodeServiceSubscribeCode_HEARTBEAT NodeServiceSubscribeCode = 0
|
||||
)
|
||||
|
||||
// Enum value maps for NodeServiceSubscribeCode.
|
||||
var (
|
||||
NodeServiceSubscribeCode_name = map[int32]string{
|
||||
0: "PING",
|
||||
0: "HEARTBEAT",
|
||||
}
|
||||
NodeServiceSubscribeCode_value = map[string]int32{
|
||||
"PING": 0,
|
||||
"HEARTBEAT": 0,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -252,7 +252,7 @@ func (x *NodeServiceSubscribeResponse) GetCode() NodeServiceSubscribeCode {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return NodeServiceSubscribeCode_PING
|
||||
return NodeServiceSubscribeCode_HEARTBEAT
|
||||
}
|
||||
|
||||
var File_services_node_service_proto protoreflect.FileDescriptor
|
||||
@@ -281,26 +281,26 @@ var file_services_node_service_proto_rawDesc = []byte{
|
||||
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x63, 0x6f, 0x64,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e,
|
||||
0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
|
||||
0x69, 0x62, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0x24, 0x0a,
|
||||
0x69, 0x62, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0x29, 0x0a,
|
||||
0x18, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x75, 0x62, 0x73,
|
||||
0x63, 0x72, 0x69, 0x62, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x49, 0x4e,
|
||||
0x47, 0x10, 0x00, 0x32, 0xef, 0x01, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12,
|
||||
0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0d, 0x53, 0x65, 0x6e, 0x64, 0x48, 0x65, 0x61, 0x72, 0x74,
|
||||
0x62, 0x65, 0x61, 0x74, 0x12, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x6f, 0x64, 0x65,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x6e, 0x64, 0x48, 0x65, 0x61, 0x72, 0x74,
|
||||
0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72,
|
||||
0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x56, 0x0a,
|
||||
0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x75, 0x62,
|
||||
0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e,
|
||||
0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x63, 0x72, 0x69, 0x62, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x45, 0x41,
|
||||
0x52, 0x54, 0x42, 0x45, 0x41, 0x54, 0x10, 0x00, 0x32, 0xef, 0x01, 0x0a, 0x0b, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69,
|
||||
0x73, 0x74, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x6f, 0x64, 0x65,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0d, 0x53, 0x65, 0x6e, 0x64,
|
||||
0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x6e, 0x64,
|
||||
0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x12, 0x56, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12,
|
||||
0x21, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b,
|
||||
0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
@@ -20,7 +20,7 @@ message NodeServiceSubscribeRequest {
|
||||
}
|
||||
|
||||
enum NodeServiceSubscribeCode {
|
||||
PING = 0;
|
||||
HEARTBEAT = 0;
|
||||
}
|
||||
|
||||
message NodeServiceSubscribeResponse {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.2
|
||||
// protoc v5.27.2
|
||||
// protoc-gen-go v1.36.1
|
||||
// protoc v5.29.2
|
||||
// source: services/task_service.proto
|
||||
|
||||
package grpc
|
||||
@@ -113,21 +113,18 @@ func (TaskServiceConnectCode) EnumDescriptor() ([]byte, []int) {
|
||||
}
|
||||
|
||||
type TaskServiceSubscribeRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskServiceSubscribeRequest) Reset() {
|
||||
*x = TaskServiceSubscribeRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_services_task_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TaskServiceSubscribeRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
@@ -137,7 +134,7 @@ func (*TaskServiceSubscribeRequest) ProtoMessage() {}
|
||||
|
||||
func (x *TaskServiceSubscribeRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_services_task_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -160,23 +157,20 @@ func (x *TaskServiceSubscribeRequest) GetTaskId() string {
|
||||
}
|
||||
|
||||
type TaskServiceSubscribeResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Code TaskServiceSubscribeCode `protobuf:"varint,1,opt,name=code,proto3,enum=grpc.TaskServiceSubscribeCode" json:"code,omitempty"`
|
||||
TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Force bool `protobuf:"varint,3,opt,name=force,proto3" json:"force,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskServiceSubscribeResponse) Reset() {
|
||||
*x = TaskServiceSubscribeResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_services_task_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TaskServiceSubscribeResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
@@ -186,7 +180,7 @@ func (*TaskServiceSubscribeResponse) ProtoMessage() {}
|
||||
|
||||
func (x *TaskServiceSubscribeResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_services_task_service_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -223,23 +217,20 @@ func (x *TaskServiceSubscribeResponse) GetForce() bool {
|
||||
}
|
||||
|
||||
type TaskServiceConnectRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Code TaskServiceConnectCode `protobuf:"varint,1,opt,name=code,proto3,enum=grpc.TaskServiceConnectCode" json:"code,omitempty"`
|
||||
TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskServiceConnectRequest) Reset() {
|
||||
*x = TaskServiceConnectRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_services_task_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TaskServiceConnectRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
@@ -249,7 +240,7 @@ func (*TaskServiceConnectRequest) ProtoMessage() {}
|
||||
|
||||
func (x *TaskServiceConnectRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_services_task_service_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -286,21 +277,18 @@ func (x *TaskServiceConnectRequest) GetData() []byte {
|
||||
}
|
||||
|
||||
type TaskServiceFetchTaskRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskServiceFetchTaskRequest) Reset() {
|
||||
*x = TaskServiceFetchTaskRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_services_task_service_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TaskServiceFetchTaskRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
@@ -310,7 +298,7 @@ func (*TaskServiceFetchTaskRequest) ProtoMessage() {}
|
||||
|
||||
func (x *TaskServiceFetchTaskRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_services_task_service_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -333,21 +321,18 @@ func (x *TaskServiceFetchTaskRequest) GetNodeKey() string {
|
||||
}
|
||||
|
||||
type TaskServiceFetchTaskResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskServiceFetchTaskResponse) Reset() {
|
||||
*x = TaskServiceFetchTaskResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_services_task_service_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TaskServiceFetchTaskResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
@@ -357,7 +342,7 @@ func (*TaskServiceFetchTaskResponse) ProtoMessage() {}
|
||||
|
||||
func (x *TaskServiceFetchTaskResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_services_task_service_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -380,22 +365,19 @@ func (x *TaskServiceFetchTaskResponse) GetTaskId() string {
|
||||
}
|
||||
|
||||
type TaskServiceSendNotificationRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
|
||||
TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskServiceSendNotificationRequest) Reset() {
|
||||
*x = TaskServiceSendNotificationRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_services_task_service_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TaskServiceSendNotificationRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
@@ -405,7 +387,7 @@ func (*TaskServiceSendNotificationRequest) ProtoMessage() {}
|
||||
|
||||
func (x *TaskServiceSendNotificationRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_services_task_service_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -553,80 +535,6 @@ func file_services_task_service_proto_init() {
|
||||
return
|
||||
}
|
||||
file_entity_response_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_services_task_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*TaskServiceSubscribeRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_services_task_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*TaskServiceSubscribeResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_services_task_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*TaskServiceConnectRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_services_task_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*TaskServiceFetchTaskRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_services_task_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*TaskServiceFetchTaskResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_services_task_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*TaskServiceSendNotificationRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.4.0
|
||||
// - protoc v5.27.2
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v5.29.2
|
||||
// source: services/task_service.proto
|
||||
|
||||
package grpc
|
||||
@@ -15,8 +15,8 @@ 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.62.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion8
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
TaskService_Subscribe_FullMethodName = "/grpc.TaskService/Subscribe"
|
||||
@@ -29,8 +29,8 @@ const (
|
||||
//
|
||||
// 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 TaskServiceClient interface {
|
||||
Subscribe(ctx context.Context, in *TaskServiceSubscribeRequest, opts ...grpc.CallOption) (TaskService_SubscribeClient, error)
|
||||
Connect(ctx context.Context, opts ...grpc.CallOption) (TaskService_ConnectClient, error)
|
||||
Subscribe(ctx context.Context, in *TaskServiceSubscribeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TaskServiceSubscribeResponse], error)
|
||||
Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[TaskServiceConnectRequest, Response], error)
|
||||
FetchTask(ctx context.Context, in *TaskServiceFetchTaskRequest, opts ...grpc.CallOption) (*TaskServiceFetchTaskResponse, error)
|
||||
SendNotification(ctx context.Context, in *TaskServiceSendNotificationRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
@@ -43,13 +43,13 @@ func NewTaskServiceClient(cc grpc.ClientConnInterface) TaskServiceClient {
|
||||
return &taskServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) Subscribe(ctx context.Context, in *TaskServiceSubscribeRequest, opts ...grpc.CallOption) (TaskService_SubscribeClient, error) {
|
||||
func (c *taskServiceClient) Subscribe(ctx context.Context, in *TaskServiceSubscribeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TaskServiceSubscribeResponse], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &TaskService_ServiceDesc.Streams[0], TaskService_Subscribe_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &taskServiceSubscribeClient{ClientStream: stream}
|
||||
x := &grpc.GenericClientStream[TaskServiceSubscribeRequest, TaskServiceSubscribeResponse]{ClientStream: stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -59,57 +59,21 @@ func (c *taskServiceClient) Subscribe(ctx context.Context, in *TaskServiceSubscr
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type TaskService_SubscribeClient interface {
|
||||
Recv() (*TaskServiceSubscribeResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type TaskService_SubscribeClient = grpc.ServerStreamingClient[TaskServiceSubscribeResponse]
|
||||
|
||||
type taskServiceSubscribeClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *taskServiceSubscribeClient) Recv() (*TaskServiceSubscribeResponse, error) {
|
||||
m := new(TaskServiceSubscribeResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) Connect(ctx context.Context, opts ...grpc.CallOption) (TaskService_ConnectClient, error) {
|
||||
func (c *taskServiceClient) Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[TaskServiceConnectRequest, Response], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &TaskService_ServiceDesc.Streams[1], TaskService_Connect_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &taskServiceConnectClient{ClientStream: stream}
|
||||
x := &grpc.GenericClientStream[TaskServiceConnectRequest, Response]{ClientStream: stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type TaskService_ConnectClient interface {
|
||||
Send(*TaskServiceConnectRequest) error
|
||||
CloseAndRecv() (*Response, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type taskServiceConnectClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *taskServiceConnectClient) Send(m *TaskServiceConnectRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *taskServiceConnectClient) CloseAndRecv() (*Response, error) {
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
m := new(Response)
|
||||
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 TaskService_ConnectClient = grpc.ClientStreamingClient[TaskServiceConnectRequest, Response]
|
||||
|
||||
func (c *taskServiceClient) FetchTask(ctx context.Context, in *TaskServiceFetchTaskRequest, opts ...grpc.CallOption) (*TaskServiceFetchTaskResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
@@ -133,23 +97,26 @@ func (c *taskServiceClient) SendNotification(ctx context.Context, in *TaskServic
|
||||
|
||||
// TaskServiceServer is the server API for TaskService service.
|
||||
// All implementations must embed UnimplementedTaskServiceServer
|
||||
// for forward compatibility
|
||||
// for forward compatibility.
|
||||
type TaskServiceServer interface {
|
||||
Subscribe(*TaskServiceSubscribeRequest, TaskService_SubscribeServer) error
|
||||
Connect(TaskService_ConnectServer) error
|
||||
Subscribe(*TaskServiceSubscribeRequest, grpc.ServerStreamingServer[TaskServiceSubscribeResponse]) error
|
||||
Connect(grpc.ClientStreamingServer[TaskServiceConnectRequest, Response]) error
|
||||
FetchTask(context.Context, *TaskServiceFetchTaskRequest) (*TaskServiceFetchTaskResponse, error)
|
||||
SendNotification(context.Context, *TaskServiceSendNotificationRequest) (*Response, error)
|
||||
mustEmbedUnimplementedTaskServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedTaskServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedTaskServiceServer struct {
|
||||
}
|
||||
// UnimplementedTaskServiceServer 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 UnimplementedTaskServiceServer struct{}
|
||||
|
||||
func (UnimplementedTaskServiceServer) Subscribe(*TaskServiceSubscribeRequest, TaskService_SubscribeServer) error {
|
||||
func (UnimplementedTaskServiceServer) Subscribe(*TaskServiceSubscribeRequest, grpc.ServerStreamingServer[TaskServiceSubscribeResponse]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) Connect(TaskService_ConnectServer) error {
|
||||
func (UnimplementedTaskServiceServer) Connect(grpc.ClientStreamingServer[TaskServiceConnectRequest, Response]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Connect not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) FetchTask(context.Context, *TaskServiceFetchTaskRequest) (*TaskServiceFetchTaskResponse, error) {
|
||||
@@ -159,6 +126,7 @@ func (UnimplementedTaskServiceServer) SendNotification(context.Context, *TaskSer
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SendNotification not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) mustEmbedUnimplementedTaskServiceServer() {}
|
||||
func (UnimplementedTaskServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeTaskServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TaskServiceServer will
|
||||
@@ -168,6 +136,13 @@ type UnsafeTaskServiceServer interface {
|
||||
}
|
||||
|
||||
func RegisterTaskServiceServer(s grpc.ServiceRegistrar, srv TaskServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedTaskServiceServer 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(&TaskService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
@@ -176,47 +151,18 @@ func _TaskService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) e
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(TaskServiceServer).Subscribe(m, &taskServiceSubscribeServer{ServerStream: stream})
|
||||
return srv.(TaskServiceServer).Subscribe(m, &grpc.GenericServerStream[TaskServiceSubscribeRequest, TaskServiceSubscribeResponse]{ServerStream: stream})
|
||||
}
|
||||
|
||||
type TaskService_SubscribeServer interface {
|
||||
Send(*TaskServiceSubscribeResponse) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type taskServiceSubscribeServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *taskServiceSubscribeServer) Send(m *TaskServiceSubscribeResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type TaskService_SubscribeServer = grpc.ServerStreamingServer[TaskServiceSubscribeResponse]
|
||||
|
||||
func _TaskService_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(TaskServiceServer).Connect(&taskServiceConnectServer{ServerStream: stream})
|
||||
return srv.(TaskServiceServer).Connect(&grpc.GenericServerStream[TaskServiceConnectRequest, Response]{ServerStream: stream})
|
||||
}
|
||||
|
||||
type TaskService_ConnectServer interface {
|
||||
SendAndClose(*Response) error
|
||||
Recv() (*TaskServiceConnectRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type taskServiceConnectServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *taskServiceConnectServer) SendAndClose(m *Response) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *taskServiceConnectServer) Recv() (*TaskServiceConnectRequest, error) {
|
||||
m := new(TaskServiceConnectRequest)
|
||||
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 TaskService_ConnectServer = grpc.ClientStreamingServer[TaskServiceConnectRequest, Response]
|
||||
|
||||
func _TaskService_FetchTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TaskServiceFetchTaskRequest)
|
||||
|
||||
Reference in New Issue
Block a user