feat: added dependency config setup (wip)

This commit is contained in:
Marvin Zhang
2024-12-15 23:09:10 +08:00
parent 3b54a63bed
commit c5c08dfba6
9 changed files with 295 additions and 88 deletions

View File

@@ -313,8 +313,8 @@ type DependencyServiceUpdateLogsRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DependencyId string `protobuf:"bytes,1,opt,name=dependency_id,json=dependencyId,proto3" json:"dependency_id,omitempty"`
Logs []string `protobuf:"bytes,2,rep,name=logs,proto3" json:"logs,omitempty"`
TargetId string `protobuf:"bytes,1,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"`
Logs []string `protobuf:"bytes,2,rep,name=logs,proto3" json:"logs,omitempty"`
}
func (x *DependencyServiceUpdateLogsRequest) Reset() {
@@ -349,9 +349,9 @@ func (*DependencyServiceUpdateLogsRequest) Descriptor() ([]byte, []int) {
return file_services_dependency_service_proto_rawDescGZIP(), []int{4}
}
func (x *DependencyServiceUpdateLogsRequest) GetDependencyId() string {
func (x *DependencyServiceUpdateLogsRequest) GetTargetId() string {
if x != nil {
return x.DependencyId
return x.TargetId
}
return ""
}
@@ -363,6 +363,77 @@ func (x *DependencyServiceUpdateLogsRequest) GetLogs() []string {
return nil
}
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"`
}
func (x *DependencyServiceSyncConfigSetupRequest) Reset() {
*x = DependencyServiceSyncConfigSetupRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_services_dependency_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DependencyServiceSyncConfigSetupRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DependencyServiceSyncConfigSetupRequest) ProtoMessage() {}
func (x *DependencyServiceSyncConfigSetupRequest) 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 DependencyServiceSyncConfigSetupRequest.ProtoReflect.Descriptor instead.
func (*DependencyServiceSyncConfigSetupRequest) Descriptor() ([]byte, []int) {
return file_services_dependency_service_proto_rawDescGZIP(), []int{5}
}
func (x *DependencyServiceSyncConfigSetupRequest) GetNodeKey() string {
if x != nil {
return x.NodeKey
}
return ""
}
func (x *DependencyServiceSyncConfigSetupRequest) GetLang() string {
if x != nil {
return x.Lang
}
return ""
}
func (x *DependencyServiceSyncConfigSetupRequest) GetStatus() string {
if x != nil {
return x.Status
}
return ""
}
func (x *DependencyServiceSyncConfigSetupRequest) GetError() string {
if x != nil {
return x.Error
}
return ""
}
var File_services_dependency_service_proto protoreflect.FileDescriptor
var file_services_dependency_service_proto_rawDesc = []byte{
@@ -397,34 +468,47 @@ var file_services_dependency_service_proto_rawDesc = []byte{
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, 0x5d, 0x0a, 0x22, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79,
0x65, 0x73, 0x22, 0x55, 0x0a, 0x22, 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, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x70, 0x65,
0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67,
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, 0xfb, 0x01, 0x0a, 0x11,
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,
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,
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, 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, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67,
0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
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 (
@@ -440,15 +524,16 @@ 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, 5)
var file_services_dependency_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_services_dependency_service_proto_goTypes = []any{
(DependencyServiceCode)(0), // 0: grpc.DependencyServiceCode
(*Dependency)(nil), // 1: grpc.Dependency
(*DependencyServiceConnectRequest)(nil), // 2: grpc.DependencyServiceConnectRequest
(*DependencyServiceConnectResponse)(nil), // 3: grpc.DependencyServiceConnectResponse
(*DependencyServiceSyncRequest)(nil), // 4: grpc.DependencyServiceSyncRequest
(*DependencyServiceUpdateLogsRequest)(nil), // 5: grpc.DependencyServiceUpdateLogsRequest
(*Response)(nil), // 6: grpc.Response
(DependencyServiceCode)(0), // 0: grpc.DependencyServiceCode
(*Dependency)(nil), // 1: grpc.Dependency
(*DependencyServiceConnectRequest)(nil), // 2: grpc.DependencyServiceConnectRequest
(*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
}
var file_services_dependency_service_proto_depIdxs = []int32{
0, // 0: grpc.DependencyServiceConnectResponse.code:type_name -> grpc.DependencyServiceCode
@@ -457,11 +542,13 @@ var file_services_dependency_service_proto_depIdxs = []int32{
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
3, // 6: grpc.DependencyService.Connect:output_type -> grpc.DependencyServiceConnectResponse
6, // 7: grpc.DependencyService.Sync:output_type -> grpc.Response
6, // 8: grpc.DependencyService.UpdateLogs: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
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
@@ -534,6 +621,18 @@ func file_services_dependency_service_proto_init() {
return nil
}
}
file_services_dependency_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*DependencyServiceSyncConfigSetupRequest); 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{
@@ -541,7 +640,7 @@ func file_services_dependency_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_services_dependency_service_proto_rawDesc,
NumEnums: 1,
NumMessages: 5,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},