mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
refactor: 拆分 gateway 单体为独立 crate,新增 systemd 部署方案
将 gateway 内部的 model-fetch、provider-transport、scheduler-core、 usage-runtime、video-tasks-core 模块提取为独立 crate;重构 gateway 内部模块结构(state/router/cache/data/query 等);移除大量遗留模块 文件;新增 systemd 二进制部署骨架及相关文档;更新前端 usage 相关 API 和组件。
This commit is contained in:
@@ -832,9 +832,7 @@ impl HubStats {
|
||||
mod tests {
|
||||
use aether_runtime::bounded_queue;
|
||||
|
||||
use super::{
|
||||
protocol, ControlPlaneClient, HubRouter, ProxyConn, MAX_REQUEST_BODY_FRAME_SIZE,
|
||||
};
|
||||
use super::{protocol, ControlPlaneClient, HubRouter, ProxyConn, MAX_REQUEST_BODY_FRAME_SIZE};
|
||||
use axum::extract::ws::Message;
|
||||
use bytes::Bytes;
|
||||
use std::collections::HashMap;
|
||||
|
||||
@@ -13,6 +13,8 @@ use bytes::BytesMut;
|
||||
use futures_util::StreamExt;
|
||||
use tracing::warn;
|
||||
|
||||
use crate::api::response::apply_streaming_response_headers;
|
||||
|
||||
use super::hub::{LocalBodyEvent, LocalStream};
|
||||
use super::protocol;
|
||||
use super::AppState;
|
||||
@@ -261,6 +263,7 @@ pub async fn relay_request(
|
||||
let mut builder = Response::builder().status(response_head.status);
|
||||
if let Some(headers) = builder.headers_mut() {
|
||||
append_headers(headers, &response_head.headers);
|
||||
apply_streaming_response_headers(headers);
|
||||
}
|
||||
match builder.body(Body::from_stream(body_stream)) {
|
||||
Ok(response) => maybe_hold_axum_response_permit(response, request_permit),
|
||||
|
||||
@@ -24,7 +24,7 @@ use self::embedded::{AppState as TunnelAppState, ConnConfig, ControlPlaneClient}
|
||||
use super::api::response::{build_client_response, build_local_http_error_response};
|
||||
use super::constants::TRACE_ID_HEADER;
|
||||
use super::error::GatewayError;
|
||||
use super::gateway_data::GatewayDataState;
|
||||
use super::data::GatewayDataState;
|
||||
use super::headers::{extract_or_generate_trace_id, should_skip_request_header};
|
||||
use super::AppState;
|
||||
|
||||
@@ -801,8 +801,7 @@ fn parse_embedded_tunnel_heartbeat_request(
|
||||
mod tests {
|
||||
use super::{
|
||||
apply_embedded_tunnel_heartbeat, apply_embedded_tunnel_node_status, current_unix_secs,
|
||||
tunnel_attachment_key, TunnelAttachmentDirectory, TunnelAttachmentRecord,
|
||||
GatewayDataState,
|
||||
tunnel_attachment_key, GatewayDataState, TunnelAttachmentDirectory, TunnelAttachmentRecord,
|
||||
};
|
||||
use aether_data::repository::proxy_nodes::{
|
||||
InMemoryProxyNodeRepository, ProxyNodeReadRepository, StoredProxyNode,
|
||||
|
||||
Reference in New Issue
Block a user