From 79c1d5d14b9fdedb4930cfd35ed149cec05b1324 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Mon, 16 Dec 2024 21:44:03 +0800 Subject: [PATCH] feat: updated dependency config setup --- core/grpc/server/dependency_service_server.go | 19 +- core/models/models/dependency_config.go | 1 + core/models/models/dependency_config_setup.go | 6 + grpc/dependency_service.pb.go | 212 +++++++++++++----- grpc/proto/services/dependency_service.proto | 11 +- 5 files changed, 187 insertions(+), 62 deletions(-) diff --git a/core/grpc/server/dependency_service_server.go b/core/grpc/server/dependency_service_server.go index 075aedcd..f952105d 100644 --- a/core/grpc/server/dependency_service_server.go +++ b/core/grpc/server/dependency_service_server.go @@ -205,6 +205,17 @@ func (svr DependencyServiceServer) SyncConfigSetup(_ context.Context, request *g } } + // drivers + var drivers []models.DependencyDriver + if request.Drivers != nil && len(request.Drivers) > 0 { + for _, d := range request.Drivers { + drivers = append(drivers, models.DependencyDriver{ + Name: d.Name, + Version: d.Version, + }) + } + } + if cs == nil { // Create new config setup cs = &models.DependencyConfigSetup{ @@ -212,6 +223,8 @@ func (svr DependencyServiceServer) SyncConfigSetup(_ context.Context, request *g DependencyConfigId: cfg.Id, Status: request.Status, Error: request.Error, + Version: request.Version, + Drivers: drivers, } _, err = service.NewModelService[models.DependencyConfigSetup]().InsertOne(*cs) if err != nil { @@ -220,8 +233,12 @@ func (svr DependencyServiceServer) SyncConfigSetup(_ context.Context, request *g } } else { // Update existing config setup - cs.Status = request.Status + if cs.Status == constants.DependencyStatusUninstalled || request.Status == constants.DependencyStatusInstalled { + cs.Status = request.Status + } cs.Error = request.Error + cs.Version = request.Version + cs.Drivers = drivers err = service.NewModelService[models.DependencyConfigSetup]().ReplaceById(cs.Id, *cs) if err != nil { log.Errorf("[DependencyService] update dependency config setup error: %v", err) diff --git a/core/models/models/dependency_config.go b/core/models/models/dependency_config.go index 58a5d39c..bbd9747f 100644 --- a/core/models/models/dependency_config.go +++ b/core/models/models/dependency_config.go @@ -8,4 +8,5 @@ type DependencyConfig struct { ExecCmd string `json:"exec_cmd" bson:"exec_cmd"` PkgCmd string `json:"pkg_cmd" bson:"pkg_cmd"` Proxy string `json:"proxy" bson:"proxy"` + Setup bool `json:"setup" bson:"-"` } diff --git a/core/models/models/dependency_config_setup.go b/core/models/models/dependency_config_setup.go index 00a5c1fb..20808a85 100644 --- a/core/models/models/dependency_config_setup.go +++ b/core/models/models/dependency_config_setup.go @@ -8,6 +8,12 @@ type DependencyConfigSetup struct { DependencyConfigId primitive.ObjectID `json:"dependency_config_id" bson:"dependency_config_id"` NodeId primitive.ObjectID `json:"node_id" bson:"node_id"` Version string `json:"version" bson:"version"` + Drivers []DependencyDriver `json:"versions,omitempty" bson:"versions,omitempty"` Status string `json:"status" bson:"status"` Error string `json:"error,omitempty" bson:"error,omitempty"` + Node *Node `json:"node,omitempty" bson:"-"` +} +type DependencyDriver struct { + Name string `json:"name" bson:"name"` + Version string `json:"version" bson:"version"` } diff --git a/grpc/dependency_service.pb.go b/grpc/dependency_service.pb.go index 3dbfa93e..4df94d8a 100644 --- a/grpc/dependency_service.pb.go +++ b/grpc/dependency_service.pb.go @@ -363,21 +363,78 @@ func (x *DependencyServiceUpdateLogsRequest) GetLogs() []string { return nil } +type DependencyDriver 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 *DependencyDriver) Reset() { + *x = DependencyDriver{} + if protoimpl.UnsafeEnabled { + mi := &file_services_dependency_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DependencyDriver) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DependencyDriver) ProtoMessage() {} + +func (x *DependencyDriver) ProtoReflect() protoreflect.Message { + mi := &file_services_dependency_service_proto_msgTypes[5] + 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 DependencyDriver.ProtoReflect.Descriptor instead. +func (*DependencyDriver) Descriptor() ([]byte, []int) { + return file_services_dependency_service_proto_rawDescGZIP(), []int{5} +} + +func (x *DependencyDriver) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DependencyDriver) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + type DependencyServiceSyncConfigSetupRequest 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"` - Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` + 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"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` + Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` + Drivers []*DependencyDriver `protobuf:"bytes,6,rep,name=drivers,proto3" json:"drivers,omitempty"` } func (x *DependencyServiceSyncConfigSetupRequest) Reset() { *x = DependencyServiceSyncConfigSetupRequest{} if protoimpl.UnsafeEnabled { - mi := &file_services_dependency_service_proto_msgTypes[5] + mi := &file_services_dependency_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -390,7 +447,7 @@ func (x *DependencyServiceSyncConfigSetupRequest) String() string { func (*DependencyServiceSyncConfigSetupRequest) ProtoMessage() {} func (x *DependencyServiceSyncConfigSetupRequest) ProtoReflect() protoreflect.Message { - mi := &file_services_dependency_service_proto_msgTypes[5] + mi := &file_services_dependency_service_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -403,7 +460,7 @@ func (x *DependencyServiceSyncConfigSetupRequest) ProtoReflect() protoreflect.Me // Deprecated: Use DependencyServiceSyncConfigSetupRequest.ProtoReflect.Descriptor instead. func (*DependencyServiceSyncConfigSetupRequest) Descriptor() ([]byte, []int) { - return file_services_dependency_service_proto_rawDescGZIP(), []int{5} + return file_services_dependency_service_proto_rawDescGZIP(), []int{6} } func (x *DependencyServiceSyncConfigSetupRequest) GetNodeKey() string { @@ -420,6 +477,13 @@ func (x *DependencyServiceSyncConfigSetupRequest) GetLang() string { return "" } +func (x *DependencyServiceSyncConfigSetupRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + func (x *DependencyServiceSyncConfigSetupRequest) GetStatus() string { if x != nil { return x.Status @@ -434,6 +498,13 @@ func (x *DependencyServiceSyncConfigSetupRequest) GetError() string { return "" } +func (x *DependencyServiceSyncConfigSetupRequest) GetDrivers() []*DependencyDriver { + if x != nil { + return x.Drivers + } + return nil +} + var File_services_dependency_service_proto protoreflect.FileDescriptor var file_services_dependency_service_proto_rawDesc = []byte{ @@ -473,42 +544,51 @@ var file_services_dependency_service_proto_rawDesc = []byte{ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x22, 0x86, 0x01, 0x0a, 0x27, 0x44, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, - 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x65, 0x74, 0x75, 0x70, 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, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x2a, 0x48, 0x0a, 0x15, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 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, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x45, 0x54, 0x55, 0x50, 0x10, 0x03, 0x32, 0xcf, 0x02, 0x0a, - 0x11, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x25, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, - 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, - 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, - 0x12, 0x3c, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x22, 0x40, 0x0a, 0x10, 0x44, 0x65, 0x70, + 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 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, 0xd2, 0x01, 0x0a, 0x27, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 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, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x28, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x73, 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, 0x52, 0x0a, 0x0f, 0x53, 0x79, - 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x2d, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x53, 0x65, 0x74, 0x75, 0x70, 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, 0x42, 0x08, - 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x65, 0x74, 0x75, 0x70, + 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, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, + 0x0a, 0x07, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, + 0x79, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x07, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, + 0x2a, 0x48, 0x0a, 0x15, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 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, 0x12, + 0x09, 0x0a, 0x05, 0x53, 0x45, 0x54, 0x55, 0x50, 0x10, 0x03, 0x32, 0xcf, 0x02, 0x0a, 0x11, 0x44, + 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x5c, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x25, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, + 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x3c, + 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 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, 0x0a, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x28, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x73, 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, 0x52, 0x0a, 0x0f, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x2d, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x65, + 0x74, 0x75, 0x70, 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, 0x42, 0x08, 0x5a, 0x06, + 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -524,7 +604,7 @@ func file_services_dependency_service_proto_rawDescGZIP() []byte { } var file_services_dependency_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_services_dependency_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_services_dependency_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_services_dependency_service_proto_goTypes = []any{ (DependencyServiceCode)(0), // 0: grpc.DependencyServiceCode (*Dependency)(nil), // 1: grpc.Dependency @@ -532,26 +612,28 @@ var file_services_dependency_service_proto_goTypes = []any{ (*DependencyServiceConnectResponse)(nil), // 3: grpc.DependencyServiceConnectResponse (*DependencyServiceSyncRequest)(nil), // 4: grpc.DependencyServiceSyncRequest (*DependencyServiceUpdateLogsRequest)(nil), // 5: grpc.DependencyServiceUpdateLogsRequest - (*DependencyServiceSyncConfigSetupRequest)(nil), // 6: grpc.DependencyServiceSyncConfigSetupRequest - (*Response)(nil), // 7: grpc.Response + (*DependencyDriver)(nil), // 6: grpc.DependencyDriver + (*DependencyServiceSyncConfigSetupRequest)(nil), // 7: grpc.DependencyServiceSyncConfigSetupRequest + (*Response)(nil), // 8: grpc.Response } var file_services_dependency_service_proto_depIdxs = []int32{ 0, // 0: grpc.DependencyServiceConnectResponse.code:type_name -> grpc.DependencyServiceCode 1, // 1: grpc.DependencyServiceConnectResponse.dependency:type_name -> grpc.Dependency 1, // 2: grpc.DependencyServiceSyncRequest.dependencies:type_name -> grpc.Dependency - 2, // 3: grpc.DependencyService.Connect:input_type -> grpc.DependencyServiceConnectRequest - 4, // 4: grpc.DependencyService.Sync:input_type -> grpc.DependencyServiceSyncRequest - 5, // 5: grpc.DependencyService.UpdateLogs:input_type -> grpc.DependencyServiceUpdateLogsRequest - 6, // 6: grpc.DependencyService.SyncConfigSetup:input_type -> grpc.DependencyServiceSyncConfigSetupRequest - 3, // 7: grpc.DependencyService.Connect:output_type -> grpc.DependencyServiceConnectResponse - 7, // 8: grpc.DependencyService.Sync:output_type -> grpc.Response - 7, // 9: grpc.DependencyService.UpdateLogs:output_type -> grpc.Response - 7, // 10: grpc.DependencyService.SyncConfigSetup:output_type -> grpc.Response - 7, // [7:11] is the sub-list for method output_type - 3, // [3:7] 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 + 6, // 3: grpc.DependencyServiceSyncConfigSetupRequest.drivers:type_name -> grpc.DependencyDriver + 2, // 4: grpc.DependencyService.Connect:input_type -> grpc.DependencyServiceConnectRequest + 4, // 5: grpc.DependencyService.Sync:input_type -> grpc.DependencyServiceSyncRequest + 5, // 6: grpc.DependencyService.UpdateLogs:input_type -> grpc.DependencyServiceUpdateLogsRequest + 7, // 7: grpc.DependencyService.SyncConfigSetup:input_type -> grpc.DependencyServiceSyncConfigSetupRequest + 3, // 8: grpc.DependencyService.Connect:output_type -> grpc.DependencyServiceConnectResponse + 8, // 9: grpc.DependencyService.Sync:output_type -> grpc.Response + 8, // 10: grpc.DependencyService.UpdateLogs:output_type -> grpc.Response + 8, // 11: grpc.DependencyService.SyncConfigSetup:output_type -> grpc.Response + 8, // [8:12] is the sub-list for method output_type + 4, // [4:8] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_services_dependency_service_proto_init() } @@ -622,6 +704,18 @@ func file_services_dependency_service_proto_init() { } } file_services_dependency_service_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*DependencyDriver); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_dependency_service_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*DependencyServiceSyncConfigSetupRequest); i { case 0: return &v.state @@ -640,7 +734,7 @@ func file_services_dependency_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_services_dependency_service_proto_rawDesc, NumEnums: 1, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 1, }, diff --git a/grpc/proto/services/dependency_service.proto b/grpc/proto/services/dependency_service.proto index 5722e820..9e30528d 100644 --- a/grpc/proto/services/dependency_service.proto +++ b/grpc/proto/services/dependency_service.proto @@ -39,11 +39,18 @@ message DependencyServiceUpdateLogsRequest { repeated string logs = 2; } +message DependencyDriver { + string name = 1; + string version = 2; +} + message DependencyServiceSyncConfigSetupRequest { string node_key = 1; string lang = 2; - string status = 3; - string error = 4; + string version = 3; + string status = 4; + string error = 5; + repeated DependencyDriver drivers = 6; } service DependencyService {