From c2bb2ba746f5fb36ded4bf8164af43a131bbc464 Mon Sep 17 00:00:00 2001 From: duonganhthu43 Date: Fri, 22 Sep 2023 16:04:01 +0700 Subject: [PATCH] add connection info in AppResponse --- dozer-types/protos/cloud.proto | 6 ++++++ dozer-types/src/models/connection.rs | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/dozer-types/protos/cloud.proto b/dozer-types/protos/cloud.proto index 3026e204d9..5d4528f80a 100644 --- a/dozer-types/protos/cloud.proto +++ b/dozer-types/protos/cloud.proto @@ -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 { diff --git a/dozer-types/src/models/connection.rs b/dozer-types/src/models/connection.rs index 6deff9f598..b120d312cf 100644 --- a/dozer-types/src/models/connection.rs +++ b/dozer-types/src/models/connection.rs @@ -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(), + } + } +}