Files
crawlab/grpc/node_service.pb.go
Marvin Zhang 17f8917d0a chore: update dependencies and enhance gRPC services
- Updated various dependencies in go.mod and go.sum files, including cloud.google.com/go/compute/metadata to v0.5.2, google.golang.org/grpc to v1.69.2, and google.golang.org/protobuf to v1.36.1.
- Refactored gRPC service definitions to use the latest protoc-gen-go and protoc versions, ensuring compatibility with the latest gRPC-Go features.
- Introduced a new logger utility in core/utils/logger.go to improve logging capabilities across the application.
- Added a README.md for gRPC setup and compilation guidance, enhancing developer experience.
- Improved the Python installation script to handle version listing more effectively and ensure user-specific environment setup.
2024-12-25 17:46:49 +08:00

369 lines
14 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: services/node_service.proto
package grpc
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type NodeServiceSubscribeCode int32
const (
NodeServiceSubscribeCode_PING NodeServiceSubscribeCode = 0
)
// Enum value maps for NodeServiceSubscribeCode.
var (
NodeServiceSubscribeCode_name = map[int32]string{
0: "PING",
}
NodeServiceSubscribeCode_value = map[string]int32{
"PING": 0,
}
)
func (x NodeServiceSubscribeCode) Enum() *NodeServiceSubscribeCode {
p := new(NodeServiceSubscribeCode)
*p = x
return p
}
func (x NodeServiceSubscribeCode) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (NodeServiceSubscribeCode) Descriptor() protoreflect.EnumDescriptor {
return file_services_node_service_proto_enumTypes[0].Descriptor()
}
func (NodeServiceSubscribeCode) Type() protoreflect.EnumType {
return &file_services_node_service_proto_enumTypes[0]
}
func (x NodeServiceSubscribeCode) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use NodeServiceSubscribeCode.Descriptor instead.
func (NodeServiceSubscribeCode) EnumDescriptor() ([]byte, []int) {
return file_services_node_service_proto_rawDescGZIP(), []int{0}
}
type NodeServiceRegisterRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
MaxRunners int32 `protobuf:"varint,3,opt,name=max_runners,json=maxRunners,proto3" json:"max_runners,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *NodeServiceRegisterRequest) Reset() {
*x = NodeServiceRegisterRequest{}
mi := &file_services_node_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *NodeServiceRegisterRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NodeServiceRegisterRequest) ProtoMessage() {}
func (x *NodeServiceRegisterRequest) ProtoReflect() protoreflect.Message {
mi := &file_services_node_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NodeServiceRegisterRequest.ProtoReflect.Descriptor instead.
func (*NodeServiceRegisterRequest) Descriptor() ([]byte, []int) {
return file_services_node_service_proto_rawDescGZIP(), []int{0}
}
func (x *NodeServiceRegisterRequest) GetNodeKey() string {
if x != nil {
return x.NodeKey
}
return ""
}
func (x *NodeServiceRegisterRequest) GetNodeName() string {
if x != nil {
return x.NodeName
}
return ""
}
func (x *NodeServiceRegisterRequest) GetMaxRunners() int32 {
if x != nil {
return x.MaxRunners
}
return 0
}
type NodeServiceSendHeartbeatRequest struct {
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 *NodeServiceSendHeartbeatRequest) Reset() {
*x = NodeServiceSendHeartbeatRequest{}
mi := &file_services_node_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *NodeServiceSendHeartbeatRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NodeServiceSendHeartbeatRequest) ProtoMessage() {}
func (x *NodeServiceSendHeartbeatRequest) ProtoReflect() protoreflect.Message {
mi := &file_services_node_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NodeServiceSendHeartbeatRequest.ProtoReflect.Descriptor instead.
func (*NodeServiceSendHeartbeatRequest) Descriptor() ([]byte, []int) {
return file_services_node_service_proto_rawDescGZIP(), []int{1}
}
func (x *NodeServiceSendHeartbeatRequest) GetNodeKey() string {
if x != nil {
return x.NodeKey
}
return ""
}
type NodeServiceSubscribeRequest struct {
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 *NodeServiceSubscribeRequest) Reset() {
*x = NodeServiceSubscribeRequest{}
mi := &file_services_node_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *NodeServiceSubscribeRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NodeServiceSubscribeRequest) ProtoMessage() {}
func (x *NodeServiceSubscribeRequest) ProtoReflect() protoreflect.Message {
mi := &file_services_node_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NodeServiceSubscribeRequest.ProtoReflect.Descriptor instead.
func (*NodeServiceSubscribeRequest) Descriptor() ([]byte, []int) {
return file_services_node_service_proto_rawDescGZIP(), []int{2}
}
func (x *NodeServiceSubscribeRequest) GetNodeKey() string {
if x != nil {
return x.NodeKey
}
return ""
}
type NodeServiceSubscribeResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Code NodeServiceSubscribeCode `protobuf:"varint,1,opt,name=code,proto3,enum=grpc.NodeServiceSubscribeCode" json:"code,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *NodeServiceSubscribeResponse) Reset() {
*x = NodeServiceSubscribeResponse{}
mi := &file_services_node_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *NodeServiceSubscribeResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NodeServiceSubscribeResponse) ProtoMessage() {}
func (x *NodeServiceSubscribeResponse) ProtoReflect() protoreflect.Message {
mi := &file_services_node_service_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NodeServiceSubscribeResponse.ProtoReflect.Descriptor instead.
func (*NodeServiceSubscribeResponse) Descriptor() ([]byte, []int) {
return file_services_node_service_proto_rawDescGZIP(), []int{3}
}
func (x *NodeServiceSubscribeResponse) GetCode() NodeServiceSubscribeCode {
if x != nil {
return x.Code
}
return NodeServiceSubscribeCode_PING
}
var File_services_node_service_proto protoreflect.FileDescriptor
var file_services_node_service_proto_rawDesc = []byte{
0x0a, 0x1b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67,
0x72, 0x70, 0x63, 0x1a, 0x15, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x75, 0x0a, 0x1a, 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, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65,
0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65,
0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x73, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72,
0x73, 0x22, 0x3c, 0x0a, 0x1f, 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, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x22,
0x38, 0x0a, 0x1b, 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, 0x12, 0x19,
0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x52, 0x0a, 0x1c, 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, 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,
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,
}
var (
file_services_node_service_proto_rawDescOnce sync.Once
file_services_node_service_proto_rawDescData = file_services_node_service_proto_rawDesc
)
func file_services_node_service_proto_rawDescGZIP() []byte {
file_services_node_service_proto_rawDescOnce.Do(func() {
file_services_node_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_services_node_service_proto_rawDescData)
})
return file_services_node_service_proto_rawDescData
}
var file_services_node_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_services_node_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_services_node_service_proto_goTypes = []any{
(NodeServiceSubscribeCode)(0), // 0: grpc.NodeServiceSubscribeCode
(*NodeServiceRegisterRequest)(nil), // 1: grpc.NodeServiceRegisterRequest
(*NodeServiceSendHeartbeatRequest)(nil), // 2: grpc.NodeServiceSendHeartbeatRequest
(*NodeServiceSubscribeRequest)(nil), // 3: grpc.NodeServiceSubscribeRequest
(*NodeServiceSubscribeResponse)(nil), // 4: grpc.NodeServiceSubscribeResponse
(*Response)(nil), // 5: grpc.Response
}
var file_services_node_service_proto_depIdxs = []int32{
0, // 0: grpc.NodeServiceSubscribeResponse.code:type_name -> grpc.NodeServiceSubscribeCode
1, // 1: grpc.NodeService.Register:input_type -> grpc.NodeServiceRegisterRequest
2, // 2: grpc.NodeService.SendHeartbeat:input_type -> grpc.NodeServiceSendHeartbeatRequest
3, // 3: grpc.NodeService.Subscribe:input_type -> grpc.NodeServiceSubscribeRequest
5, // 4: grpc.NodeService.Register:output_type -> grpc.Response
5, // 5: grpc.NodeService.SendHeartbeat:output_type -> grpc.Response
4, // 6: grpc.NodeService.Subscribe:output_type -> grpc.NodeServiceSubscribeResponse
4, // [4:7] is the sub-list for method output_type
1, // [1:4] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_services_node_service_proto_init() }
func file_services_node_service_proto_init() {
if File_services_node_service_proto != nil {
return
}
file_entity_response_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_services_node_service_proto_rawDesc,
NumEnums: 1,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_services_node_service_proto_goTypes,
DependencyIndexes: file_services_node_service_proto_depIdxs,
EnumInfos: file_services_node_service_proto_enumTypes,
MessageInfos: file_services_node_service_proto_msgTypes,
}.Build()
File_services_node_service_proto = out.File
file_services_node_service_proto_rawDesc = nil
file_services_node_service_proto_goTypes = nil
file_services_node_service_proto_depIdxs = nil
}