diff options
author | rtkay123 <dev@kanjala.com> | 2025-08-14 18:33:10 +0200 |
---|---|---|
committer | rtkay123 <dev@kanjala.com> | 2025-08-14 18:33:10 +0200 |
commit | 19871c1924a8569df741d4bf5f63943b6b646c16 (patch) | |
tree | 8ec72ec271ef8d815c64929dbf6e2ba0b4f3b6a6 /crates/router/src | |
parent | 5eed2d7a4a919b3583017aa9a65089673bce87db (diff) | |
download | warden-19871c1924a8569df741d4bf5f63943b6b646c16.tar.bz2 warden-19871c1924a8569df741d4bf5f63943b6b646c16.zip |
feat(config): rule http
Diffstat (limited to 'crates/router/src')
-rw-r--r-- | crates/router/src/main.rs | 4 | ||||
-rw-r--r-- | crates/router/src/processor.rs | 19 | ||||
-rw-r--r-- | crates/router/src/processor/load.rs | 4 | ||||
-rw-r--r-- | crates/router/src/processor/publish.rs | 4 | ||||
-rw-r--r-- | crates/router/src/processor/reload.rs | 4 | ||||
-rw-r--r-- | crates/router/src/processor/route.rs | 2 | ||||
-rw-r--r-- | crates/router/src/state.rs | 2 |
7 files changed, 20 insertions, 19 deletions
diff --git a/crates/router/src/main.rs b/crates/router/src/main.rs index cc4c927..ad81700 100644 --- a/crates/router/src/main.rs +++ b/crates/router/src/main.rs @@ -52,9 +52,7 @@ async fn main() -> Result<()> { .take() .ok_or_else(|| anyhow::anyhow!("jetstream is not ready"))?; - let services = state::Services { - jetstream, - }; + let services = state::Services { jetstream }; processor::serve(services, config, provider) .await diff --git a/crates/router/src/processor.rs b/crates/router/src/processor.rs index b8c69f3..9afe726 100644 --- a/crates/router/src/processor.rs +++ b/crates/router/src/processor.rs @@ -1,20 +1,25 @@ pub mod grpc; +mod load; +mod publish; mod reload; mod route; -mod publish; -mod load; use std::sync::Arc; use anyhow::Result; -use async_nats::jetstream::{consumer::{pull, Consumer}, Context}; +use async_nats::jetstream::{ + Context, + consumer::{Consumer, pull}, +}; +use futures_util::StreamExt; use tokio::signal; use tracing::{error, trace}; use warden_stack::{Configuration, tracing::SdkTracerProvider}; -use futures_util::StreamExt; - -use crate::{cnfg::Nats, state::{AppHandle, AppState, Services}}; +use crate::{ + cnfg::Nats, + state::{AppHandle, AppState, Services}, +}; pub async fn serve( services: Services, @@ -31,7 +36,6 @@ pub async fn serve( Ok(()) } - async fn run(state: AppHandle) -> anyhow::Result<()> { let config = Arc::clone(&state); let (consumer, _) = tokio::join!( @@ -77,7 +81,6 @@ async fn get_or_create_stream( .await?) } - async fn shutdown_signal(provider: SdkTracerProvider) -> Result<()> { let ctrl_c = async { signal::ctrl_c() diff --git a/crates/router/src/processor/load.rs b/crates/router/src/processor/load.rs index 9d3fd0d..b3fdf1c 100644 --- a/crates/router/src/processor/load.rs +++ b/crates/router/src/processor/load.rs @@ -1,7 +1,7 @@ use opentelemetry_semantic_conventions::attribute; -use tracing_opentelemetry::OpenTelemetrySpanExt; use tracing::{Instrument, debug, info, info_span, instrument, warn}; -use warden_core::{configuration::routing::RoutingConfiguration, google }; +use tracing_opentelemetry::OpenTelemetrySpanExt; +use warden_core::{configuration::routing::RoutingConfiguration, google}; use crate::{cnfg::CACHE_KEY, state::AppHandle}; diff --git a/crates/router/src/processor/publish.rs b/crates/router/src/processor/publish.rs index 16dcec8..277b674 100644 --- a/crates/router/src/processor/publish.rs +++ b/crates/router/src/processor/publish.rs @@ -1,7 +1,7 @@ -use opentelemetry::global; +use opentelemetry::global; use opentelemetry_semantic_conventions::attribute; -use tracing_opentelemetry::OpenTelemetrySpanExt; use tracing::{Instrument, Span, debug, info, info_span, warn}; +use tracing_opentelemetry::OpenTelemetrySpanExt; use warden_core::{configuration::routing::RoutingConfiguration, message::Payload}; use warden_stack::tracing::telemetry::nats::injector; diff --git a/crates/router/src/processor/reload.rs b/crates/router/src/processor/reload.rs index c75465c..900b7ce 100644 --- a/crates/router/src/processor/reload.rs +++ b/crates/router/src/processor/reload.rs @@ -1,6 +1,6 @@ -use futures_util::StreamExt; use async_nats::jetstream::consumer; -use tracing::{trace, debug, error, info}; +use futures_util::StreamExt; +use tracing::{debug, error, info, trace}; use uuid::Uuid; use warden_core::configuration::ReloadEvent; diff --git a/crates/router/src/processor/route.rs b/crates/router/src/processor/route.rs index 404c2ca..d51a86a 100644 --- a/crates/router/src/processor/route.rs +++ b/crates/router/src/processor/route.rs @@ -3,7 +3,7 @@ use std::{collections::HashSet, sync::Arc}; use opentelemetry::global; use prost::Message; -use tracing::{info_span, instrument, trace, trace_span, warn, Instrument, Span}; +use tracing::{Instrument, Span, info_span, instrument, trace, trace_span, warn}; use tracing_opentelemetry::OpenTelemetrySpanExt; use warden_core::{google, message::Payload}; use warden_stack::tracing::telemetry::nats; diff --git a/crates/router/src/state.rs b/crates/router/src/state.rs index e01629e..4ede2de 100644 --- a/crates/router/src/state.rs +++ b/crates/router/src/state.rs @@ -8,7 +8,7 @@ use tracing::error; use warden_core::configuration::routing::{ RoutingConfiguration, query_routing_client::QueryRoutingClient, }; -use warden_stack::{Configuration}; +use warden_stack::Configuration; use crate::{ cnfg::LocalConfig, |