Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
4t145 committed Apr 20, 2024
1 parent 2920f42 commit 5d4ef83
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion crates/kernel/src/backend_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use futures_util::Future;
use hyper::{header::UPGRADE, Request, Response, StatusCode};
use tracing::instrument;

use crate::helper_layers::map_future::MapFuture;
use crate::backend_service::http_client_service::get_client;
use crate::helper_layers::map_future::MapFuture;
use crate::utils::x_forwarded_for;
use crate::BoxError;
use crate::SgBody;
Expand Down
6 changes: 3 additions & 3 deletions crates/kernel/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#![deny(clippy::unwrap_used, clippy::dbg_macro, clippy::unimplemented, clippy::todo)]
#![warn(clippy::missing_errors_doc, clippy::indexing_slicing)]
// pub mod config;
pub mod backend_service;
pub mod body;
pub mod extension;
pub mod extractor;
pub mod helper_layers;
pub mod service;
pub mod listener;
pub mod backend_service;
pub mod service;
pub mod utils;

pub use backend_service::ArcHyperService;
pub use body::SgBody;
use extension::Reflect;
pub use extractor::Extractor;
pub use backend_service::ArcHyperService;
use std::{convert::Infallible, fmt};
pub use tower_layer::Layer;

Expand Down
2 changes: 1 addition & 1 deletion crates/kernel/src/service/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ pub mod builder;
use std::{collections::HashMap, ops::Index, sync::Arc};

use crate::{
backend_service::ArcHyperService,
extension::{GatewayName, MatchedSgRouter},
helper_layers::{
map_request::{add_extension::add_extension, MapRequestLayer},
reload::Reloader,
route::{Router, RouterService},
},
backend_service::ArcHyperService,
utils::fold_box_layers::fold_layers,
BoxLayer, SgBody,
};
Expand Down
2 changes: 1 addition & 1 deletion crates/kernel/src/service/http_route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ pub mod match_request;
use std::{convert::Infallible, path::PathBuf, sync::Arc, time::Duration};
const DEFAULT_TIMEOUT: Duration = Duration::from_secs(30);
use crate::{
backend_service::{http_backend_service, static_file_service::static_file_service, ArcHyperService},
extension::{BackendHost, Reflect},
helper_layers::random_pick,
backend_service::{http_backend_service, static_file_service::static_file_service, ArcHyperService},
utils::{fold_box_layers::fold_layers, schema_port::port_to_schema},
BoxLayer, SgBody,
};
Expand Down
4 changes: 2 additions & 2 deletions crates/kernel/tests/test_h2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ use std::{
use axum_server::tls_rustls::RustlsConfig;
use hyper::{client, Request};
use spacegate_kernel::{
backend_service::{get_http_backend_service, http_backend_service},
listener::SgListen,
service::{
gateway,
http_route::{match_request::HttpPathMatchRewrite, HttpBackend, HttpRoute, HttpRouteRule},
},
listener::SgListen,
backend_service::{get_http_backend_service, http_backend_service},
SgBody,
};
use tokio_rustls::rustls::ServerConfig;
Expand Down
2 changes: 1 addition & 1 deletion crates/kernel/tests/test_https.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::{net::SocketAddr, str::FromStr, time::Duration};

use spacegate_kernel::{
listener::SgListen,
service::{
gateway,
http_route::{match_request::HttpPathMatchRewrite, HttpBackend, HttpRoute, HttpRouteRule},
},
listener::SgListen,
};
use tokio_rustls::rustls::ServerConfig;
use tokio_util::sync::CancellationToken;
Expand Down
2 changes: 1 addition & 1 deletion crates/kernel/tests/test_multi_part.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use reqwest::{
Body,
};
use spacegate_kernel::{
listener::SgListen,
service::{
gateway,
http_route::{HttpBackend, HttpRoute, HttpRouteRule},
},
listener::SgListen,
};
use tokio::fs::File;
use tokio_util::io::ReaderStream;
Expand Down
2 changes: 1 addition & 1 deletion crates/kernel/tests/test_websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use futures_util::{SinkExt, StreamExt};
use std::{net::SocketAddr, str::FromStr, time::Duration};

use spacegate_kernel::{
listener::SgListen,
service::{
gateway,
http_route::{HttpBackend, HttpRoute, HttpRouteRule},
},
listener::SgListen,
};
use tokio_util::sync::CancellationToken;
#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion crates/plugin/src/ext/redis/plugins/redis_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ mod test {
use hyper::header::AUTHORIZATION;
use serde_json::json;
use spacegate_kernel::{
service::http_route::match_request::{HttpPathMatchRewrite, HttpRouteMatch},
backend_service::get_echo_service,
service::http_route::match_request::{HttpPathMatchRewrite, HttpRouteMatch},
};
use testcontainers_modules::redis::REDIS_PORT;

Expand Down
2 changes: 1 addition & 1 deletion crates/plugin/src/ext/redis/plugins/redis_limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ mod test {
use serde_json::json;
use spacegate_ext_redis::redis::AsyncCommands;
use spacegate_kernel::{
service::http_route::match_request::{HttpPathMatchRewrite, HttpRouteMatch},
backend_service::get_echo_service,
service::http_route::match_request::{HttpPathMatchRewrite, HttpRouteMatch},
};
use std::time::Duration;
use testcontainers_modules::redis::REDIS_PORT;
Expand Down
2 changes: 1 addition & 1 deletion crates/plugin/src/ext/redis/plugins/redis_time_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ mod test {
use hyper::header::AUTHORIZATION;
use serde_json::json;
use spacegate_kernel::{
service::http_route::match_request::{HttpMethodMatch, HttpPathMatchRewrite, HttpRouteMatch},
backend_service::get_echo_service,
service::http_route::match_request::{HttpMethodMatch, HttpPathMatchRewrite, HttpRouteMatch},
};
use testcontainers_modules::redis::REDIS_PORT;

Expand Down
2 changes: 1 addition & 1 deletion crates/plugin/src/plugins/inject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use crate::Plugin;
use hyper::{header::HeaderName, Request};
use hyper::{Method, Response, Uri};
use serde::{Deserialize, Serialize};
use spacegate_kernel::backend_service::http_client_service::get_client;
use spacegate_kernel::extension::Reflect;
use spacegate_kernel::helper_layers::function::Inner;
use spacegate_kernel::backend_service::http_client_service::get_client;
use spacegate_kernel::BoxError;
use spacegate_kernel::SgBody;
const DEFAULT_TIMEOUT: Duration = Duration::from_secs(5);
Expand Down
2 changes: 1 addition & 1 deletion crates/plugin/src/plugins/maintenance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ mod test {
use hyper::StatusCode;
use hyper::{Method, Request, Version};
use serde_json::json;
use spacegate_kernel::backend_service::get_echo_service;
use spacegate_kernel::extension::PeerAddr;
use spacegate_kernel::helper_layers::function::Inner;
use spacegate_kernel::backend_service::get_echo_service;
use spacegate_kernel::BoxError;
use spacegate_kernel::SgBody;
use spacegate_model::{PluginInstanceId, PluginInstanceName};
Expand Down
5 changes: 3 additions & 2 deletions crates/shell/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use crate::config::{matches_convert::convert_config_to_kernel, plugin_filter_dto
use spacegate_config::{BackendHost, Config, ConfigItem, PluginInstanceId};
use spacegate_kernel::{
helper_layers::reload::Reloader,
service::gateway::{builder::default_gateway_route_fallback, create_http_router, HttpRouterService},
listener::SgListen,
service::gateway::{builder::default_gateway_route_fallback, create_http_router, HttpRouterService},
ArcHyperService, BoxError,
};
use spacegate_plugin::{mount::MountPointIndex, SgPluginRepository};
Expand Down Expand Up @@ -102,7 +102,8 @@ fn collect_http_route(
Result::<_, BoxError>::Ok(layer)
})
.collect::<Result<Vec<_>, _>>()?;
let mut layer = spacegate_kernel::service::http_route::HttpRoute::builder().hostnames(route.hostnames.unwrap_or_default()).rules(rules).priority(route.priority).build();
let mut layer =
spacegate_kernel::service::http_route::HttpRoute::builder().hostnames(route.hostnames.unwrap_or_default()).rules(rules).priority(route.priority).build();
global_batch_mount_plugin(plugins, &mut layer, mount_index);
Ok((name, layer))
})
Expand Down

0 comments on commit 5d4ef83

Please sign in to comment.