Skip to content

Commit

Permalink
add connection info in AppResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
duonganhthu43 committed Sep 22, 2023
1 parent 8aedacb commit c2bb2ba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dozer-types/protos/cloud.proto
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ message AppResponse {
repeated DeploymentInfo deployments = 4;
google.protobuf.Timestamp created_at = 5;
google.protobuf.Timestamp updated_at = 6;
repeated ConnectionInfo connections = 7;
}

message ConnectionInfo {
string type = 1;
string name = 2;
}

message ListAppRequest {
Expand Down
18 changes: 18 additions & 0 deletions dozer-types/src/models/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,21 @@ pub enum ConnectionConfig {
/// In yaml, present as tag" `!Dozer`
Dozer(NestedDozerConfig),
}

impl ConnectionConfig {
pub fn get_type_name(&self) -> String {
match self {
ConnectionConfig::Postgres(_) => "Postgres".to_string(),
ConnectionConfig::Ethereum(_) => "Ethereum".to_string(),
ConnectionConfig::Grpc(_) => "Grpc".to_string(),
ConnectionConfig::Snowflake(_) => "Snowflake".to_string(),
ConnectionConfig::Kafka(_) => "Kafka".to_string(),
ConnectionConfig::S3Storage(_) => "S3Storage".to_string(),
ConnectionConfig::LocalStorage(_) => "LocalStorage".to_string(),
ConnectionConfig::DeltaLake(_) => "DeltaLake".to_string(),
ConnectionConfig::MongoDB(_) => "MongoDB".to_string(),
ConnectionConfig::MySQL(_) => "MySQL".to_string(),
ConnectionConfig::Dozer(_) => "Dozer".to_string(),
}
}
}

0 comments on commit c2bb2ba

Please sign in to comment.