feat: implement Nginx service with upstream management and configuration generation
This commit is contained in:
31
apps/api/src/services/nginx.rs
Normal file
31
apps/api/src/services/nginx.rs
Normal file
@@ -0,0 +1,31 @@
|
||||
pub mod builder;
|
||||
pub mod info;
|
||||
pub mod traits;
|
||||
|
||||
pub mod upstream;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use sea_orm::DatabaseConnection;
|
||||
|
||||
use upstream::UpstreamService;
|
||||
|
||||
pub struct NginxService {
|
||||
connection: Arc<DatabaseConnection>,
|
||||
//
|
||||
upstream_service: Arc<UpstreamService>,
|
||||
}
|
||||
|
||||
impl NginxService {
|
||||
pub fn new(connection: Arc<DatabaseConnection>) -> Self {
|
||||
Self {
|
||||
connection: connection.clone(),
|
||||
//
|
||||
upstream_service: Arc::new(UpstreamService::new(connection.clone())),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_upstream_service(&self) -> Arc<UpstreamService> {
|
||||
self.upstream_service.clone()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user