Skip to content

Commit

Permalink
chore: refactor into cloud client crate
Browse files Browse the repository at this point in the history
  • Loading branch information
v3g42 committed Sep 20, 2023
1 parent 3ee2bab commit d8c619b
Show file tree
Hide file tree
Showing 27 changed files with 81 additions and 1,824 deletions.
34 changes: 28 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dozer-api/src/rest/api_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use actix_web::web::ReqData;
use actix_web::{web, HttpResponse};
use dozer_cache::cache::expression::{QueryExpression, Skip};
use dozer_cache::cache::CacheRecord;
use dozer_cache::{CacheReader, Phase};
use dozer_cache::CacheReader;
use dozer_types::api::Phase;
use dozer_types::errors::types::CannotConvertF64ToJson;
use dozer_types::indexmap::IndexMap;
use dozer_types::models::api_endpoint::ApiEndpoint;
Expand Down
3 changes: 1 addition & 2 deletions dozer-api/src/rest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use actix_web::{
};
use actix_web_httpauth::middleware::HttpAuthentication;
use dozer_tracing::LabelsAndProgress;
use dozer_types::api::DOZER_SERVER_NAME_HEADER;
use dozer_types::{log::info, models::api_config::RestApiOptions};
use dozer_types::{
models::api_security::ApiSecurity,
Expand All @@ -38,8 +39,6 @@ enum CorsOptions {
Custom(Vec<String>, usize),
}

pub const DOZER_SERVER_NAME_HEADER: &str = "x-dozer-server-name";

#[derive(Clone)]
pub struct ApiServer {
shutdown_timeout: u64,
Expand Down
2 changes: 1 addition & 1 deletion dozer-api/src/rest/tests/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{generator::oapi::generator::OpenApiGenerator, test_utils, CacheEndpo
use actix_http::{body::MessageBody, Request};
use actix_web::dev::{Service, ServiceResponse};
use actix_web::http::header::ContentType;
use dozer_cache::Phase;
use dozer_types::api::Phase;
use dozer_types::models::api_endpoint::ApiEndpoint;
use dozer_types::serde_json::{json, Value};
use http::StatusCode;
Expand Down
2 changes: 1 addition & 1 deletion dozer-cache/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pub mod errors;
mod reader;

pub use dozer_log;
pub use reader::{AccessFilter, CacheReader, Phase};
pub use reader::{AccessFilter, CacheReader};
8 changes: 1 addition & 7 deletions dozer-cache/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::cache::{expression::QueryExpression, CacheRecord, RoCache};
use super::cache::expression::FilterExpression;
use crate::errors::CacheError;
use dozer_types::{
api::Phase,
serde,
types::{Record, SchemaWithIndex},
};
Expand All @@ -21,13 +22,6 @@ pub struct AccessFilter {
pub fields: Vec<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(crate = "dozer_types::serde")]
pub enum Phase {
Snapshotting,
Streaming,
}

#[derive(Debug)]
/// CacheReader dynamically attaches permissions on top of queries
pub struct CacheReader {
Expand Down
1 change: 1 addition & 0 deletions dozer-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ authors = ["getdozer/dozer-dev"]
name = "dozer"

[dependencies]
dozer-cloud-client = { path = "../../dozer-cloud-client" }
dozer-api = { path = "../dozer-api" }
dozer-ingestion = { path = "../dozer-ingestion" }
dozer-core = { path = "../dozer-core" }
Expand Down
188 changes: 0 additions & 188 deletions dozer-cli/src/cli/cloud.rs

This file was deleted.

2 changes: 0 additions & 2 deletions dozer-cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#[cfg(feature = "cloud")]
pub mod cloud;
mod helper;
mod init;
pub mod types;
Expand Down
2 changes: 1 addition & 1 deletion dozer-cli/src/cli/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use clap::{Args, Parser, Subcommand};
use super::helper::{DESCRIPTION, LOGO};

#[cfg(feature = "cloud")]
use crate::cli::cloud::Cloud;
use dozer_cloud_client::cli::cloud::Cloud;
use dozer_types::{
constants::{DEFAULT_CONFIG_PATH_PATTERNS, LOCK_FILE},
serde_json,
Expand Down
Loading

0 comments on commit d8c619b

Please sign in to comment.