changed database config type

This commit is contained in:
Kofo Okesola 2024-10-20 20:59:33 +01:00
parent 02a511369f
commit 29075af3f3
2 changed files with 64 additions and 43 deletions

View File

@ -24,6 +24,8 @@ type GetAllDatabasesRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
} }
func (x *GetAllDatabasesRequest) Reset() { func (x *GetAllDatabasesRequest) Reset() {
@ -58,6 +60,13 @@ func (*GetAllDatabasesRequest) Descriptor() ([]byte, []int) {
return file_workflow_proto_rawDescGZIP(), []int{0} return file_workflow_proto_rawDescGZIP(), []int{0}
} }
func (x *GetAllDatabasesRequest) GetIdentifier() string {
if x != nil {
return x.Identifier
}
return ""
}
type GetAllDatabasesResponse struct { type GetAllDatabasesResponse struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -527,7 +536,7 @@ type DatabaseConfig struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Config []byte `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` Config map[string]string `protobuf:"bytes,2,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
} }
@ -570,7 +579,7 @@ func (x *DatabaseConfig) GetId() string {
return "" return ""
} }
func (x *DatabaseConfig) GetConfig() []byte { func (x *DatabaseConfig) GetConfig() map[string]string {
if x != nil { if x != nil {
return x.Config return x.Config
} }
@ -588,9 +597,11 @@ var File_workflow_proto protoreflect.FileDescriptor
var file_workflow_proto_rawDesc = []byte{ var file_workflow_proto_rawDesc = []byte{
0x0a, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x0a, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x18, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x38, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x6c,
0x6c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x22, 0x4e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65,
0x72, 0x22, 0x4e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x62,
0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09,
0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
@ -657,28 +668,34 @@ var file_workflow_proto_rawDesc = []byte{
0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a,
0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x22, 0x4c, 0x0a, 0x0e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x0e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f,
0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02,
0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x61, 0x74,
0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x32, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x66,
0xcb, 0x01, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x65, 0x72, 0x76, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
0x69, 0x63, 0x65, 0x12, 0x64, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x57, 0x6f, 0x72, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74,
0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x79, 0x70, 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74,
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0xcb,
0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x01, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x65, 0x72, 0x76, 0x69,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x63, 0x65, 0x12, 0x64, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x57, 0x6f, 0x72, 0x6b,
0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x66, 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x72,
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c,
0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x57,
0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41,
0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61,
0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2c, 0x5a, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f,
0x2a, 0x67, 0x69, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x69, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
0x2f, 0x73, 0x65, 0x72, 0x76, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2c, 0x5a, 0x2a,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x67, 0x69, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x69, 0x6f, 0x2f,
0x74, 0x6f, 0x33, 0x73, 0x65, 0x72, 0x76, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
} }
var ( var (
@ -693,7 +710,7 @@ func file_workflow_proto_rawDescGZIP() []byte {
return file_workflow_proto_rawDescData return file_workflow_proto_rawDescData
} }
var file_workflow_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_workflow_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_workflow_proto_goTypes = []any{ var file_workflow_proto_goTypes = []any{
(*GetAllDatabasesRequest)(nil), // 0: proto.GetAllDatabasesRequest (*GetAllDatabasesRequest)(nil), // 0: proto.GetAllDatabasesRequest
(*GetAllDatabasesResponse)(nil), // 1: proto.GetAllDatabasesResponse (*GetAllDatabasesResponse)(nil), // 1: proto.GetAllDatabasesResponse
@ -708,6 +725,7 @@ var file_workflow_proto_goTypes = []any{
nil, // 10: proto.WorkflowConfig.ActionsEntry nil, // 10: proto.WorkflowConfig.ActionsEntry
nil, // 11: proto.WorkflowConfig.ConditionalsEntry nil, // 11: proto.WorkflowConfig.ConditionalsEntry
nil, // 12: proto.WorkflowConfig.ResponsesEntry nil, // 12: proto.WorkflowConfig.ResponsesEntry
nil, // 13: proto.DatabaseConfig.ConfigEntry
} }
var file_workflow_proto_depIdxs = []int32{ var file_workflow_proto_depIdxs = []int32{
9, // 0: proto.GetAllDatabasesResponse.databases:type_name -> proto.DatabaseConfig 9, // 0: proto.GetAllDatabasesResponse.databases:type_name -> proto.DatabaseConfig
@ -716,18 +734,19 @@ var file_workflow_proto_depIdxs = []int32{
10, // 3: proto.WorkflowConfig.actions:type_name -> proto.WorkflowConfig.ActionsEntry 10, // 3: proto.WorkflowConfig.actions:type_name -> proto.WorkflowConfig.ActionsEntry
11, // 4: proto.WorkflowConfig.conditionals:type_name -> proto.WorkflowConfig.ConditionalsEntry 11, // 4: proto.WorkflowConfig.conditionals:type_name -> proto.WorkflowConfig.ConditionalsEntry
12, // 5: proto.WorkflowConfig.responses:type_name -> proto.WorkflowConfig.ResponsesEntry 12, // 5: proto.WorkflowConfig.responses:type_name -> proto.WorkflowConfig.ResponsesEntry
6, // 6: proto.WorkflowConfig.ActionsEntry.value:type_name -> proto.Action 13, // 6: proto.DatabaseConfig.config:type_name -> proto.DatabaseConfig.ConfigEntry
7, // 7: proto.WorkflowConfig.ConditionalsEntry.value:type_name -> proto.Conditional 6, // 7: proto.WorkflowConfig.ActionsEntry.value:type_name -> proto.Action
8, // 8: proto.WorkflowConfig.ResponsesEntry.value:type_name -> proto.Response 7, // 8: proto.WorkflowConfig.ConditionalsEntry.value:type_name -> proto.Conditional
2, // 9: proto.WorkflowService.GetAllWorkflowConfigs:input_type -> proto.GetAllWorkflowConfigsRequest 8, // 9: proto.WorkflowConfig.ResponsesEntry.value:type_name -> proto.Response
0, // 10: proto.WorkflowService.GetAllDatabases:input_type -> proto.GetAllDatabasesRequest 2, // 10: proto.WorkflowService.GetAllWorkflowConfigs:input_type -> proto.GetAllWorkflowConfigsRequest
3, // 11: proto.WorkflowService.GetAllWorkflowConfigs:output_type -> proto.GetAllWorkflowConfigsResponse 0, // 11: proto.WorkflowService.GetAllDatabases:input_type -> proto.GetAllDatabasesRequest
1, // 12: proto.WorkflowService.GetAllDatabases:output_type -> proto.GetAllDatabasesResponse 3, // 12: proto.WorkflowService.GetAllWorkflowConfigs:output_type -> proto.GetAllWorkflowConfigsResponse
11, // [11:13] is the sub-list for method output_type 1, // 13: proto.WorkflowService.GetAllDatabases:output_type -> proto.GetAllDatabasesResponse
9, // [9:11] is the sub-list for method input_type 12, // [12:14] is the sub-list for method output_type
9, // [9:9] is the sub-list for extension type_name 10, // [10:12] is the sub-list for method input_type
9, // [9:9] is the sub-list for extension extendee 10, // [10:10] is the sub-list for extension type_name
0, // [0:9] is the sub-list for field type_name 10, // [10:10] is the sub-list for extension extendee
0, // [0:10] is the sub-list for field type_name
} }
func init() { file_workflow_proto_init() } func init() { file_workflow_proto_init() }
@ -863,7 +882,7 @@ func file_workflow_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_workflow_proto_rawDesc, RawDescriptor: file_workflow_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 13, NumMessages: 14,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },

View File

@ -9,7 +9,9 @@ service WorkflowService {
rpc GetAllDatabases(GetAllDatabasesRequest) returns (GetAllDatabasesResponse) {} rpc GetAllDatabases(GetAllDatabasesRequest) returns (GetAllDatabasesResponse) {}
} }
message GetAllDatabasesRequest{} message GetAllDatabasesRequest{
string identifier = 1;
}
message GetAllDatabasesResponse{ message GetAllDatabasesResponse{
repeated DatabaseConfig databases = 1; repeated DatabaseConfig databases = 1;
@ -54,6 +56,6 @@ message Response {
message DatabaseConfig { message DatabaseConfig {
string id = 1; string id = 1;
bytes config = 2; map<string, string> config = 2;
string type = 3; string type = 3;
} }