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

View File

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