diff --git a/backend/go.mod b/backend/go.mod index 7de0fc4a..bfc6cc27 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -41,6 +41,7 @@ require ( github.com/crawlab-team/crawlab/fs v0.0.0-20240614095218-7b4ee8399ab0 // indirect github.com/crawlab-team/crawlab/grpc v0.0.0-20240614095218-7b4ee8399ab0 // indirect github.com/crawlab-team/crawlab/template-parser v0.0.0-20240614095218-7b4ee8399ab0 // indirect + github.com/crawlab-team/crawlab/trace v0.0.0-20240614095218-7b4ee8399ab0 // indirect github.com/crawlab-team/crawlab/vcs v0.0.0-20240614095218-7b4ee8399ab0 // indirect github.com/crawlab-team/goseaweedfs v0.6.0-beta.20211101.1936.0.20220912021203-dfee5f74dd69 // indirect github.com/denisenkom/go-mssqldb v0.11.0 // indirect diff --git a/core/models/models/base_v2.go b/core/models/models/base_v2.go index cc1468e6..13a33abe 100644 --- a/core/models/models/base_v2.go +++ b/core/models/models/base_v2.go @@ -7,10 +7,10 @@ import ( type BaseModelV2[T any] struct { Id primitive.ObjectID `json:"_id" bson:"_id"` - CreatedAt time.Time `json:"created_ts" bson:"created_ts"` - CreatedBy primitive.ObjectID `json:"created_by" bson:"created_by"` - UpdatedAt time.Time `json:"updated_ts" bson:"updated_ts"` - UpdatedBy primitive.ObjectID `json:"updated_by" bson:"updated_by"` + CreatedAt time.Time `json:"created_ts,omitempty" bson:"created_ts,omitempty"` + CreatedBy primitive.ObjectID `json:"created_by,omitempty" bson:"created_by,omitempty"` + UpdatedAt time.Time `json:"updated_ts,omitempty" bson:"updated_ts,omitempty"` + UpdatedBy primitive.ObjectID `json:"updated_by,omitempty" bson:"updated_by,omitempty"` } func (m *BaseModelV2[T]) GetId() primitive.ObjectID { diff --git a/grpc/dependencies_service_v2.pb.go b/grpc/dependencies_service_v2.pb.go new file mode 100644 index 00000000..baf1bcad --- /dev/null +++ b/grpc/dependencies_service_v2.pb.go @@ -0,0 +1,572 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.20.1 +// source: services/dependencies_service_v2.proto + +package grpc + +import ( + proto "github.com/golang/protobuf/proto" + 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) +) + +// 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 DependenciesServiceV2Code int32 + +const ( + DependenciesServiceV2Code_SYNC DependenciesServiceV2Code = 0 + DependenciesServiceV2Code_INSTALL DependenciesServiceV2Code = 1 + DependenciesServiceV2Code_UNINSTALL DependenciesServiceV2Code = 2 +) + +// Enum value maps for DependenciesServiceV2Code. +var ( + DependenciesServiceV2Code_name = map[int32]string{ + 0: "SYNC", + 1: "INSTALL", + 2: "UNINSTALL", + } + DependenciesServiceV2Code_value = map[string]int32{ + "SYNC": 0, + "INSTALL": 1, + "UNINSTALL": 2, + } +) + +func (x DependenciesServiceV2Code) Enum() *DependenciesServiceV2Code { + p := new(DependenciesServiceV2Code) + *p = x + return p +} + +func (x DependenciesServiceV2Code) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DependenciesServiceV2Code) Descriptor() protoreflect.EnumDescriptor { + return file_services_dependencies_service_v2_proto_enumTypes[0].Descriptor() +} + +func (DependenciesServiceV2Code) Type() protoreflect.EnumType { + return &file_services_dependencies_service_v2_proto_enumTypes[0] +} + +func (x DependenciesServiceV2Code) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DependenciesServiceV2Code.Descriptor instead. +func (DependenciesServiceV2Code) EnumDescriptor() ([]byte, []int) { + return file_services_dependencies_service_v2_proto_rawDescGZIP(), []int{0} +} + +type Dependency struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *Dependency) Reset() { + *x = Dependency{} + if protoimpl.UnsafeEnabled { + mi := &file_services_dependencies_service_v2_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Dependency) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Dependency) ProtoMessage() {} + +func (x *Dependency) ProtoReflect() protoreflect.Message { + mi := &file_services_dependencies_service_v2_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Dependency.ProtoReflect.Descriptor instead. +func (*Dependency) Descriptor() ([]byte, []int) { + return file_services_dependencies_service_v2_proto_rawDescGZIP(), []int{0} +} + +func (x *Dependency) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Dependency) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type DependenciesServiceV2ConnectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` +} + +func (x *DependenciesServiceV2ConnectRequest) Reset() { + *x = DependenciesServiceV2ConnectRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_services_dependencies_service_v2_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DependenciesServiceV2ConnectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DependenciesServiceV2ConnectRequest) ProtoMessage() {} + +func (x *DependenciesServiceV2ConnectRequest) ProtoReflect() protoreflect.Message { + mi := &file_services_dependencies_service_v2_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DependenciesServiceV2ConnectRequest.ProtoReflect.Descriptor instead. +func (*DependenciesServiceV2ConnectRequest) Descriptor() ([]byte, []int) { + return file_services_dependencies_service_v2_proto_rawDescGZIP(), []int{1} +} + +func (x *DependenciesServiceV2ConnectRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +type DependenciesServiceV2ConnectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code DependenciesServiceV2Code `protobuf:"varint,1,opt,name=code,proto3,enum=grpc.DependenciesServiceV2Code" json:"code,omitempty"` + TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + Lang string `protobuf:"bytes,3,opt,name=lang,proto3" json:"lang,omitempty"` + Proxy string `protobuf:"bytes,4,opt,name=proxy,proto3" json:"proxy,omitempty"` + Dependencies []*Dependency `protobuf:"bytes,5,rep,name=dependencies,proto3" json:"dependencies,omitempty"` +} + +func (x *DependenciesServiceV2ConnectResponse) Reset() { + *x = DependenciesServiceV2ConnectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_services_dependencies_service_v2_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DependenciesServiceV2ConnectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DependenciesServiceV2ConnectResponse) ProtoMessage() {} + +func (x *DependenciesServiceV2ConnectResponse) ProtoReflect() protoreflect.Message { + mi := &file_services_dependencies_service_v2_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DependenciesServiceV2ConnectResponse.ProtoReflect.Descriptor instead. +func (*DependenciesServiceV2ConnectResponse) Descriptor() ([]byte, []int) { + return file_services_dependencies_service_v2_proto_rawDescGZIP(), []int{2} +} + +func (x *DependenciesServiceV2ConnectResponse) GetCode() DependenciesServiceV2Code { + if x != nil { + return x.Code + } + return DependenciesServiceV2Code_SYNC +} + +func (x *DependenciesServiceV2ConnectResponse) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *DependenciesServiceV2ConnectResponse) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +func (x *DependenciesServiceV2ConnectResponse) GetProxy() string { + if x != nil { + return x.Proxy + } + return "" +} + +func (x *DependenciesServiceV2ConnectResponse) GetDependencies() []*Dependency { + if x != nil { + return x.Dependencies + } + return nil +} + +type DependenciesServiceV2SyncRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + Lang string `protobuf:"bytes,2,opt,name=lang,proto3" json:"lang,omitempty"` + Dependencies []*Dependency `protobuf:"bytes,3,rep,name=dependencies,proto3" json:"dependencies,omitempty"` +} + +func (x *DependenciesServiceV2SyncRequest) Reset() { + *x = DependenciesServiceV2SyncRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_services_dependencies_service_v2_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DependenciesServiceV2SyncRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DependenciesServiceV2SyncRequest) ProtoMessage() {} + +func (x *DependenciesServiceV2SyncRequest) ProtoReflect() protoreflect.Message { + mi := &file_services_dependencies_service_v2_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DependenciesServiceV2SyncRequest.ProtoReflect.Descriptor instead. +func (*DependenciesServiceV2SyncRequest) Descriptor() ([]byte, []int) { + return file_services_dependencies_service_v2_proto_rawDescGZIP(), []int{3} +} + +func (x *DependenciesServiceV2SyncRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *DependenciesServiceV2SyncRequest) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +func (x *DependenciesServiceV2SyncRequest) GetDependencies() []*Dependency { + if x != nil { + return x.Dependencies + } + return nil +} + +type DependenciesServiceV2UpdateTaskLogRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *DependenciesServiceV2UpdateTaskLogRequest) Reset() { + *x = DependenciesServiceV2UpdateTaskLogRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_services_dependencies_service_v2_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DependenciesServiceV2UpdateTaskLogRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DependenciesServiceV2UpdateTaskLogRequest) ProtoMessage() {} + +func (x *DependenciesServiceV2UpdateTaskLogRequest) ProtoReflect() protoreflect.Message { + mi := &file_services_dependencies_service_v2_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DependenciesServiceV2UpdateTaskLogRequest.ProtoReflect.Descriptor instead. +func (*DependenciesServiceV2UpdateTaskLogRequest) Descriptor() ([]byte, []int) { + return file_services_dependencies_service_v2_proto_rawDescGZIP(), []int{4} +} + +func (x *DependenciesServiceV2UpdateTaskLogRequest) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *DependenciesServiceV2UpdateTaskLogRequest) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +var File_services_dependencies_service_v2_proto protoreflect.FileDescriptor + +var file_services_dependencies_service_v2_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x70, 0x65, 0x6e, + 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x76, 0x32, 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, 0x3a, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, + 0x6e, 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x22, 0x40, 0x0a, 0x23, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, + 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 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, 0xd4, 0x01, 0x0a, 0x24, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, + 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x43, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, + 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x14, + 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x12, 0x34, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, + 0x63, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, 0x87, 0x01, 0x0a, 0x20, 0x44, + 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x56, 0x32, 0x53, 0x79, 0x6e, 0x63, 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, 0x12, 0x0a, 0x04, 0x6c, 0x61, + 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x34, + 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, + 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, + 0x63, 0x69, 0x65, 0x73, 0x22, 0x5e, 0x0a, 0x29, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, + 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x2a, 0x41, 0x0a, 0x19, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, + 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x43, 0x6f, 0x64, + 0x65, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x49, + 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x49, 0x4e, + 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x10, 0x02, 0x32, 0x97, 0x02, 0x0a, 0x15, 0x44, 0x65, 0x70, 0x65, + 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, + 0x32, 0x12, 0x66, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x29, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, + 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x56, 0x32, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x40, 0x0a, 0x04, 0x53, 0x79, 0x6e, + 0x63, 0x12, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, + 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x53, 0x79, + 0x6e, 0x63, 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, 0x54, 0x0a, 0x0d, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 0x12, 0x2f, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, + 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 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, 0x28, + 0x01, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_services_dependencies_service_v2_proto_rawDescOnce sync.Once + file_services_dependencies_service_v2_proto_rawDescData = file_services_dependencies_service_v2_proto_rawDesc +) + +func file_services_dependencies_service_v2_proto_rawDescGZIP() []byte { + file_services_dependencies_service_v2_proto_rawDescOnce.Do(func() { + file_services_dependencies_service_v2_proto_rawDescData = protoimpl.X.CompressGZIP(file_services_dependencies_service_v2_proto_rawDescData) + }) + return file_services_dependencies_service_v2_proto_rawDescData +} + +var file_services_dependencies_service_v2_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_services_dependencies_service_v2_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_services_dependencies_service_v2_proto_goTypes = []interface{}{ + (DependenciesServiceV2Code)(0), // 0: grpc.DependenciesServiceV2Code + (*Dependency)(nil), // 1: grpc.Dependency + (*DependenciesServiceV2ConnectRequest)(nil), // 2: grpc.DependenciesServiceV2ConnectRequest + (*DependenciesServiceV2ConnectResponse)(nil), // 3: grpc.DependenciesServiceV2ConnectResponse + (*DependenciesServiceV2SyncRequest)(nil), // 4: grpc.DependenciesServiceV2SyncRequest + (*DependenciesServiceV2UpdateTaskLogRequest)(nil), // 5: grpc.DependenciesServiceV2UpdateTaskLogRequest + (*Response)(nil), // 6: grpc.Response +} +var file_services_dependencies_service_v2_proto_depIdxs = []int32{ + 0, // 0: grpc.DependenciesServiceV2ConnectResponse.code:type_name -> grpc.DependenciesServiceV2Code + 1, // 1: grpc.DependenciesServiceV2ConnectResponse.dependencies:type_name -> grpc.Dependency + 1, // 2: grpc.DependenciesServiceV2SyncRequest.dependencies:type_name -> grpc.Dependency + 2, // 3: grpc.DependenciesServiceV2.Connect:input_type -> grpc.DependenciesServiceV2ConnectRequest + 4, // 4: grpc.DependenciesServiceV2.Sync:input_type -> grpc.DependenciesServiceV2SyncRequest + 5, // 5: grpc.DependenciesServiceV2.UpdateTaskLog:input_type -> grpc.DependenciesServiceV2UpdateTaskLogRequest + 3, // 6: grpc.DependenciesServiceV2.Connect:output_type -> grpc.DependenciesServiceV2ConnectResponse + 6, // 7: grpc.DependenciesServiceV2.Sync:output_type -> grpc.Response + 6, // 8: grpc.DependenciesServiceV2.UpdateTaskLog:output_type -> grpc.Response + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_services_dependencies_service_v2_proto_init() } +func file_services_dependencies_service_v2_proto_init() { + if File_services_dependencies_service_v2_proto != nil { + return + } + file_entity_response_proto_init() + if !protoimpl.UnsafeEnabled { + file_services_dependencies_service_v2_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Dependency); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_dependencies_service_v2_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DependenciesServiceV2ConnectRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_dependencies_service_v2_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DependenciesServiceV2ConnectResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_dependencies_service_v2_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DependenciesServiceV2SyncRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_dependencies_service_v2_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DependenciesServiceV2UpdateTaskLogRequest); 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{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_services_dependencies_service_v2_proto_rawDesc, + NumEnums: 1, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_services_dependencies_service_v2_proto_goTypes, + DependencyIndexes: file_services_dependencies_service_v2_proto_depIdxs, + EnumInfos: file_services_dependencies_service_v2_proto_enumTypes, + MessageInfos: file_services_dependencies_service_v2_proto_msgTypes, + }.Build() + File_services_dependencies_service_v2_proto = out.File + file_services_dependencies_service_v2_proto_rawDesc = nil + file_services_dependencies_service_v2_proto_goTypes = nil + file_services_dependencies_service_v2_proto_depIdxs = nil +} diff --git a/grpc/dependencies_service_v2_grpc.pb.go b/grpc/dependencies_service_v2_grpc.pb.go new file mode 100644 index 00000000..b96e3178 --- /dev/null +++ b/grpc/dependencies_service_v2_grpc.pb.go @@ -0,0 +1,244 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.20.1 +// source: services/dependencies_service_v2.proto + +package grpc + +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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// DependenciesServiceV2Client is the client API for DependenciesServiceV2 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 DependenciesServiceV2Client interface { + Connect(ctx context.Context, opts ...grpc.CallOption) (DependenciesServiceV2_ConnectClient, error) + Sync(ctx context.Context, in *DependenciesServiceV2SyncRequest, opts ...grpc.CallOption) (*Response, error) + UpdateTaskLog(ctx context.Context, opts ...grpc.CallOption) (DependenciesServiceV2_UpdateTaskLogClient, error) +} + +type dependenciesServiceV2Client struct { + cc grpc.ClientConnInterface +} + +func NewDependenciesServiceV2Client(cc grpc.ClientConnInterface) DependenciesServiceV2Client { + return &dependenciesServiceV2Client{cc} +} + +func (c *dependenciesServiceV2Client) Connect(ctx context.Context, opts ...grpc.CallOption) (DependenciesServiceV2_ConnectClient, error) { + stream, err := c.cc.NewStream(ctx, &DependenciesServiceV2_ServiceDesc.Streams[0], "/grpc.DependenciesServiceV2/Connect", opts...) + if err != nil { + return nil, err + } + x := &dependenciesServiceV2ConnectClient{stream} + return x, nil +} + +type DependenciesServiceV2_ConnectClient interface { + Send(*DependenciesServiceV2ConnectRequest) error + Recv() (*DependenciesServiceV2ConnectResponse, error) + grpc.ClientStream +} + +type dependenciesServiceV2ConnectClient struct { + grpc.ClientStream +} + +func (x *dependenciesServiceV2ConnectClient) Send(m *DependenciesServiceV2ConnectRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *dependenciesServiceV2ConnectClient) Recv() (*DependenciesServiceV2ConnectResponse, error) { + m := new(DependenciesServiceV2ConnectResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *dependenciesServiceV2Client) Sync(ctx context.Context, in *DependenciesServiceV2SyncRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/grpc.DependenciesServiceV2/Sync", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dependenciesServiceV2Client) UpdateTaskLog(ctx context.Context, opts ...grpc.CallOption) (DependenciesServiceV2_UpdateTaskLogClient, error) { + stream, err := c.cc.NewStream(ctx, &DependenciesServiceV2_ServiceDesc.Streams[1], "/grpc.DependenciesServiceV2/UpdateTaskLog", opts...) + if err != nil { + return nil, err + } + x := &dependenciesServiceV2UpdateTaskLogClient{stream} + return x, nil +} + +type DependenciesServiceV2_UpdateTaskLogClient interface { + Send(*DependenciesServiceV2UpdateTaskLogRequest) error + CloseAndRecv() (*Response, error) + grpc.ClientStream +} + +type dependenciesServiceV2UpdateTaskLogClient struct { + grpc.ClientStream +} + +func (x *dependenciesServiceV2UpdateTaskLogClient) Send(m *DependenciesServiceV2UpdateTaskLogRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *dependenciesServiceV2UpdateTaskLogClient) 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 +} + +// DependenciesServiceV2Server is the server API for DependenciesServiceV2 service. +// All implementations must embed UnimplementedDependenciesServiceV2Server +// for forward compatibility +type DependenciesServiceV2Server interface { + Connect(DependenciesServiceV2_ConnectServer) error + Sync(context.Context, *DependenciesServiceV2SyncRequest) (*Response, error) + UpdateTaskLog(DependenciesServiceV2_UpdateTaskLogServer) error + mustEmbedUnimplementedDependenciesServiceV2Server() +} + +// UnimplementedDependenciesServiceV2Server must be embedded to have forward compatible implementations. +type UnimplementedDependenciesServiceV2Server struct { +} + +func (UnimplementedDependenciesServiceV2Server) Connect(DependenciesServiceV2_ConnectServer) error { + return status.Errorf(codes.Unimplemented, "method Connect not implemented") +} +func (UnimplementedDependenciesServiceV2Server) Sync(context.Context, *DependenciesServiceV2SyncRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") +} +func (UnimplementedDependenciesServiceV2Server) UpdateTaskLog(DependenciesServiceV2_UpdateTaskLogServer) error { + return status.Errorf(codes.Unimplemented, "method UpdateTaskLog not implemented") +} +func (UnimplementedDependenciesServiceV2Server) mustEmbedUnimplementedDependenciesServiceV2Server() {} + +// UnsafeDependenciesServiceV2Server may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DependenciesServiceV2Server will +// result in compilation errors. +type UnsafeDependenciesServiceV2Server interface { + mustEmbedUnimplementedDependenciesServiceV2Server() +} + +func RegisterDependenciesServiceV2Server(s grpc.ServiceRegistrar, srv DependenciesServiceV2Server) { + s.RegisterService(&DependenciesServiceV2_ServiceDesc, srv) +} + +func _DependenciesServiceV2_Connect_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(DependenciesServiceV2Server).Connect(&dependenciesServiceV2ConnectServer{stream}) +} + +type DependenciesServiceV2_ConnectServer interface { + Send(*DependenciesServiceV2ConnectResponse) error + Recv() (*DependenciesServiceV2ConnectRequest, error) + grpc.ServerStream +} + +type dependenciesServiceV2ConnectServer struct { + grpc.ServerStream +} + +func (x *dependenciesServiceV2ConnectServer) Send(m *DependenciesServiceV2ConnectResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *dependenciesServiceV2ConnectServer) Recv() (*DependenciesServiceV2ConnectRequest, error) { + m := new(DependenciesServiceV2ConnectRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _DependenciesServiceV2_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DependenciesServiceV2SyncRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DependenciesServiceV2Server).Sync(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.DependenciesServiceV2/Sync", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DependenciesServiceV2Server).Sync(ctx, req.(*DependenciesServiceV2SyncRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DependenciesServiceV2_UpdateTaskLog_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(DependenciesServiceV2Server).UpdateTaskLog(&dependenciesServiceV2UpdateTaskLogServer{stream}) +} + +type DependenciesServiceV2_UpdateTaskLogServer interface { + SendAndClose(*Response) error + Recv() (*DependenciesServiceV2UpdateTaskLogRequest, error) + grpc.ServerStream +} + +type dependenciesServiceV2UpdateTaskLogServer struct { + grpc.ServerStream +} + +func (x *dependenciesServiceV2UpdateTaskLogServer) SendAndClose(m *Response) error { + return x.ServerStream.SendMsg(m) +} + +func (x *dependenciesServiceV2UpdateTaskLogServer) Recv() (*DependenciesServiceV2UpdateTaskLogRequest, error) { + m := new(DependenciesServiceV2UpdateTaskLogRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// DependenciesServiceV2_ServiceDesc is the grpc.ServiceDesc for DependenciesServiceV2 service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DependenciesServiceV2_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.DependenciesServiceV2", + HandlerType: (*DependenciesServiceV2Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Sync", + Handler: _DependenciesServiceV2_Sync_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Connect", + Handler: _DependenciesServiceV2_Connect_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "UpdateTaskLog", + Handler: _DependenciesServiceV2_UpdateTaskLog_Handler, + ClientStreams: true, + }, + }, + Metadata: "services/dependencies_service_v2.proto", +} diff --git a/grpc/dependency_service_v2.pb.go b/grpc/dependency_service_v2.pb.go deleted file mode 100644 index 7057a9cb..00000000 --- a/grpc/dependency_service_v2.pb.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.20.1 -// source: services/dependency_service_v2.proto - -package grpc - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -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) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -var File_services_dependency_service_v2_proto protoreflect.FileDescriptor - -var file_services_dependency_service_v2_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x32, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x2c, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x2f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, - 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x32, 0x5f, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x32, 0xc9, 0x02, 0x0a, 0x13, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x12, 0x48, 0x0a, 0x07, 0x43, 0x6f, 0x6e, - 0x6e, 0x65, 0x63, 0x74, 0x12, 0x29, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, - 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, - 0x32, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 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, 0x28, 0x01, 0x12, 0x40, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x26, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x53, 0x79, 0x6e, 0x63, 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, 0x4a, 0x0a, 0x07, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x12, 0x29, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, - 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 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, 0x28, 0x01, 0x30, - 0x01, 0x12, 0x5a, 0x0a, 0x15, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x2b, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 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, 0x28, 0x01, 0x30, 0x01, 0x42, 0x08, 0x5a, - 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_services_dependency_service_v2_proto_goTypes = []interface{}{ - (*DependenciesServiceV2ConnectRequest)(nil), // 0: grpc.DependenciesServiceV2ConnectRequest - (*DependenciesServiceV2SyncRequest)(nil), // 1: grpc.DependenciesServiceV2SyncRequest - (*DependenciesServiceV2InstallRequest)(nil), // 2: grpc.DependenciesServiceV2InstallRequest - (*DependenciesServiceV2UninstallRequest)(nil), // 3: grpc.DependenciesServiceV2UninstallRequest - (*Response)(nil), // 4: grpc.Response -} -var file_services_dependency_service_v2_proto_depIdxs = []int32{ - 0, // 0: grpc.DependencyServiceV2.Connect:input_type -> grpc.DependenciesServiceV2ConnectRequest - 1, // 1: grpc.DependencyServiceV2.Sync:input_type -> grpc.DependenciesServiceV2SyncRequest - 2, // 2: grpc.DependencyServiceV2.Install:input_type -> grpc.DependenciesServiceV2InstallRequest - 3, // 3: grpc.DependencyServiceV2.UninstallDependencies:input_type -> grpc.DependenciesServiceV2UninstallRequest - 4, // 4: grpc.DependencyServiceV2.Connect:output_type -> grpc.Response - 4, // 5: grpc.DependencyServiceV2.Sync:output_type -> grpc.Response - 4, // 6: grpc.DependencyServiceV2.Install:output_type -> grpc.Response - 4, // 7: grpc.DependencyServiceV2.UninstallDependencies:output_type -> grpc.Response - 4, // [4:8] is the sub-list for method output_type - 0, // [0:4] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_services_dependency_service_v2_proto_init() } -func file_services_dependency_service_v2_proto_init() { - if File_services_dependency_service_v2_proto != nil { - return - } - file_entity_dependencies_service_v2_request_proto_init() - file_entity_response_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_services_dependency_service_v2_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_services_dependency_service_v2_proto_goTypes, - DependencyIndexes: file_services_dependency_service_v2_proto_depIdxs, - }.Build() - File_services_dependency_service_v2_proto = out.File - file_services_dependency_service_v2_proto_rawDesc = nil - file_services_dependency_service_v2_proto_goTypes = nil - file_services_dependency_service_v2_proto_depIdxs = nil -} diff --git a/grpc/dependency_service_v2_grpc.pb.go b/grpc/dependency_service_v2_grpc.pb.go deleted file mode 100644 index 3d0a9eb9..00000000 --- a/grpc/dependency_service_v2_grpc.pb.go +++ /dev/null @@ -1,312 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: services/dependency_service_v2.proto - -package grpc - -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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// DependencyServiceV2Client is the client API for DependencyServiceV2 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 DependencyServiceV2Client interface { - Connect(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_ConnectClient, error) - Sync(ctx context.Context, in *DependenciesServiceV2SyncRequest, opts ...grpc.CallOption) (*Response, error) - Install(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_InstallClient, error) - UninstallDependencies(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_UninstallDependenciesClient, error) -} - -type dependencyServiceV2Client struct { - cc grpc.ClientConnInterface -} - -func NewDependencyServiceV2Client(cc grpc.ClientConnInterface) DependencyServiceV2Client { - return &dependencyServiceV2Client{cc} -} - -func (c *dependencyServiceV2Client) Connect(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_ConnectClient, error) { - stream, err := c.cc.NewStream(ctx, &DependencyServiceV2_ServiceDesc.Streams[0], "/grpc.DependencyServiceV2/Connect", opts...) - if err != nil { - return nil, err - } - x := &dependencyServiceV2ConnectClient{stream} - return x, nil -} - -type DependencyServiceV2_ConnectClient interface { - Send(*DependenciesServiceV2ConnectRequest) error - CloseAndRecv() (*Response, error) - grpc.ClientStream -} - -type dependencyServiceV2ConnectClient struct { - grpc.ClientStream -} - -func (x *dependencyServiceV2ConnectClient) Send(m *DependenciesServiceV2ConnectRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *dependencyServiceV2ConnectClient) 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 -} - -func (c *dependencyServiceV2Client) Sync(ctx context.Context, in *DependenciesServiceV2SyncRequest, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := c.cc.Invoke(ctx, "/grpc.DependencyServiceV2/Sync", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dependencyServiceV2Client) Install(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_InstallClient, error) { - stream, err := c.cc.NewStream(ctx, &DependencyServiceV2_ServiceDesc.Streams[1], "/grpc.DependencyServiceV2/Install", opts...) - if err != nil { - return nil, err - } - x := &dependencyServiceV2InstallClient{stream} - return x, nil -} - -type DependencyServiceV2_InstallClient interface { - Send(*DependenciesServiceV2InstallRequest) error - Recv() (*Response, error) - grpc.ClientStream -} - -type dependencyServiceV2InstallClient struct { - grpc.ClientStream -} - -func (x *dependencyServiceV2InstallClient) Send(m *DependenciesServiceV2InstallRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *dependencyServiceV2InstallClient) Recv() (*Response, error) { - m := new(Response) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *dependencyServiceV2Client) UninstallDependencies(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_UninstallDependenciesClient, error) { - stream, err := c.cc.NewStream(ctx, &DependencyServiceV2_ServiceDesc.Streams[2], "/grpc.DependencyServiceV2/UninstallDependencies", opts...) - if err != nil { - return nil, err - } - x := &dependencyServiceV2UninstallDependenciesClient{stream} - return x, nil -} - -type DependencyServiceV2_UninstallDependenciesClient interface { - Send(*DependenciesServiceV2UninstallRequest) error - Recv() (*Response, error) - grpc.ClientStream -} - -type dependencyServiceV2UninstallDependenciesClient struct { - grpc.ClientStream -} - -func (x *dependencyServiceV2UninstallDependenciesClient) Send(m *DependenciesServiceV2UninstallRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *dependencyServiceV2UninstallDependenciesClient) Recv() (*Response, error) { - m := new(Response) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// DependencyServiceV2Server is the server API for DependencyServiceV2 service. -// All implementations must embed UnimplementedDependencyServiceV2Server -// for forward compatibility -type DependencyServiceV2Server interface { - Connect(DependencyServiceV2_ConnectServer) error - Sync(context.Context, *DependenciesServiceV2SyncRequest) (*Response, error) - Install(DependencyServiceV2_InstallServer) error - UninstallDependencies(DependencyServiceV2_UninstallDependenciesServer) error - mustEmbedUnimplementedDependencyServiceV2Server() -} - -// UnimplementedDependencyServiceV2Server must be embedded to have forward compatible implementations. -type UnimplementedDependencyServiceV2Server struct { -} - -func (UnimplementedDependencyServiceV2Server) Connect(DependencyServiceV2_ConnectServer) error { - return status.Errorf(codes.Unimplemented, "method Connect not implemented") -} -func (UnimplementedDependencyServiceV2Server) Sync(context.Context, *DependenciesServiceV2SyncRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") -} -func (UnimplementedDependencyServiceV2Server) Install(DependencyServiceV2_InstallServer) error { - return status.Errorf(codes.Unimplemented, "method Install not implemented") -} -func (UnimplementedDependencyServiceV2Server) UninstallDependencies(DependencyServiceV2_UninstallDependenciesServer) error { - return status.Errorf(codes.Unimplemented, "method UninstallDependencies not implemented") -} -func (UnimplementedDependencyServiceV2Server) mustEmbedUnimplementedDependencyServiceV2Server() {} - -// UnsafeDependencyServiceV2Server may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DependencyServiceV2Server will -// result in compilation errors. -type UnsafeDependencyServiceV2Server interface { - mustEmbedUnimplementedDependencyServiceV2Server() -} - -func RegisterDependencyServiceV2Server(s grpc.ServiceRegistrar, srv DependencyServiceV2Server) { - s.RegisterService(&DependencyServiceV2_ServiceDesc, srv) -} - -func _DependencyServiceV2_Connect_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(DependencyServiceV2Server).Connect(&dependencyServiceV2ConnectServer{stream}) -} - -type DependencyServiceV2_ConnectServer interface { - SendAndClose(*Response) error - Recv() (*DependenciesServiceV2ConnectRequest, error) - grpc.ServerStream -} - -type dependencyServiceV2ConnectServer struct { - grpc.ServerStream -} - -func (x *dependencyServiceV2ConnectServer) SendAndClose(m *Response) error { - return x.ServerStream.SendMsg(m) -} - -func (x *dependencyServiceV2ConnectServer) Recv() (*DependenciesServiceV2ConnectRequest, error) { - m := new(DependenciesServiceV2ConnectRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _DependencyServiceV2_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DependenciesServiceV2SyncRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DependencyServiceV2Server).Sync(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.DependencyServiceV2/Sync", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DependencyServiceV2Server).Sync(ctx, req.(*DependenciesServiceV2SyncRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DependencyServiceV2_Install_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(DependencyServiceV2Server).Install(&dependencyServiceV2InstallServer{stream}) -} - -type DependencyServiceV2_InstallServer interface { - Send(*Response) error - Recv() (*DependenciesServiceV2InstallRequest, error) - grpc.ServerStream -} - -type dependencyServiceV2InstallServer struct { - grpc.ServerStream -} - -func (x *dependencyServiceV2InstallServer) Send(m *Response) error { - return x.ServerStream.SendMsg(m) -} - -func (x *dependencyServiceV2InstallServer) Recv() (*DependenciesServiceV2InstallRequest, error) { - m := new(DependenciesServiceV2InstallRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _DependencyServiceV2_UninstallDependencies_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(DependencyServiceV2Server).UninstallDependencies(&dependencyServiceV2UninstallDependenciesServer{stream}) -} - -type DependencyServiceV2_UninstallDependenciesServer interface { - Send(*Response) error - Recv() (*DependenciesServiceV2UninstallRequest, error) - grpc.ServerStream -} - -type dependencyServiceV2UninstallDependenciesServer struct { - grpc.ServerStream -} - -func (x *dependencyServiceV2UninstallDependenciesServer) Send(m *Response) error { - return x.ServerStream.SendMsg(m) -} - -func (x *dependencyServiceV2UninstallDependenciesServer) Recv() (*DependenciesServiceV2UninstallRequest, error) { - m := new(DependenciesServiceV2UninstallRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// DependencyServiceV2_ServiceDesc is the grpc.ServiceDesc for DependencyServiceV2 service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var DependencyServiceV2_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.DependencyServiceV2", - HandlerType: (*DependencyServiceV2Server)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Sync", - Handler: _DependencyServiceV2_Sync_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Connect", - Handler: _DependencyServiceV2_Connect_Handler, - ClientStreams: true, - }, - { - StreamName: "Install", - Handler: _DependencyServiceV2_Install_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "UninstallDependencies", - Handler: _DependencyServiceV2_UninstallDependencies_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "services/dependency_service_v2.proto", -} diff --git a/grpc/proto/entity/dependencies_service_v2_request.proto b/grpc/proto/entity/dependencies_service_v2_request.proto deleted file mode 100644 index c7cfa79d..00000000 --- a/grpc/proto/entity/dependencies_service_v2_request.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; - -package grpc; -option go_package = ".;grpc"; - -message Dependency { - string name = 1; - string version = 2; -} - -message DependenciesServiceV2ConnectRequest { - string node_key = 1; -} - -message DependenciesServiceV2SyncRequest { - string node_key = 1; - string lang = 2; - repeated Dependency dependencies = 3; -} - -message DependenciesServiceV2InstallRequest { - string node_key = 1; - string lang = 2; - repeated Dependency dependencies = 3; - string proxy = 4; -} - -message DependenciesServiceV2UninstallRequest { - string node_key = 1; - string lang = 2; - repeated Dependency dependencies = 3; -} \ No newline at end of file diff --git a/grpc/proto/services/dependencies_service_v2.proto b/grpc/proto/services/dependencies_service_v2.proto new file mode 100644 index 00000000..b09f9c94 --- /dev/null +++ b/grpc/proto/services/dependencies_service_v2.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +import "entity/response.proto"; + +package grpc; +option go_package = ".;grpc"; + +message Dependency { + string name = 1; + string version = 2; +} + +message DependenciesServiceV2ConnectRequest { + string node_key = 1; +} + +enum DependenciesServiceV2Code { + SYNC = 0; + INSTALL = 1; + UNINSTALL = 2; +} + +message DependenciesServiceV2ConnectResponse { + DependenciesServiceV2Code code = 1; + string task_id = 2; + string lang = 3; + string proxy = 4; + repeated Dependency dependencies = 5; +} + +message DependenciesServiceV2SyncRequest { + string node_key = 1; + string lang = 2; + repeated Dependency dependencies = 3; +} + +message DependenciesServiceV2UpdateTaskLogRequest { + string task_id = 1; + string content = 2; +} + +service DependenciesServiceV2 { + rpc Connect(stream DependenciesServiceV2ConnectRequest) returns (stream DependenciesServiceV2ConnectResponse){}; + rpc Sync(DependenciesServiceV2SyncRequest) returns (Response){}; + rpc UpdateTaskLog(stream DependenciesServiceV2UpdateTaskLogRequest) returns (Response){}; +} diff --git a/grpc/proto/services/dependency_service_v2.proto b/grpc/proto/services/dependency_service_v2.proto deleted file mode 100644 index dea310d6..00000000 --- a/grpc/proto/services/dependency_service_v2.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; - -import "entity/dependencies_service_v2_request.proto"; -import "entity/response.proto"; - -package grpc; -option go_package = ".;grpc"; - -service DependencyServiceV2 { - rpc Connect(stream DependenciesServiceV2ConnectRequest) returns (Response){}; - rpc Sync(DependenciesServiceV2SyncRequest) returns (Response){}; - rpc Install(stream DependenciesServiceV2InstallRequest) returns (stream Response){}; - rpc UninstallDependencies(stream DependenciesServiceV2UninstallRequest) returns (stream Response){}; -}