add service manager sal
This commit is contained in:
42
service_manager/src/systemd.rs
Normal file
42
service_manager/src/systemd.rs
Normal file
@@ -0,0 +1,42 @@
|
||||
use crate::{ServiceConfig, ServiceManager, ServiceManagerError, ServiceStatus};
|
||||
use async_trait::async_trait;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct SystemdServiceManager;
|
||||
|
||||
impl SystemdServiceManager {
|
||||
pub fn new() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl ServiceManager for SystemdServiceManager {
|
||||
async fn start(&self, _config: &ServiceConfig) -> Result<(), ServiceManagerError> {
|
||||
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
|
||||
}
|
||||
|
||||
async fn stop(&self, _service_name: &str) -> Result<(), ServiceManagerError> {
|
||||
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
|
||||
}
|
||||
|
||||
async fn restart(&self, _service_name: &str) -> Result<(), ServiceManagerError> {
|
||||
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
|
||||
}
|
||||
|
||||
async fn status(&self, _service_name: &str) -> Result<ServiceStatus, ServiceManagerError> {
|
||||
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
|
||||
}
|
||||
|
||||
async fn logs(&self, _service_name: &str, _lines: Option<usize>) -> Result<String, ServiceManagerError> {
|
||||
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
|
||||
}
|
||||
|
||||
async fn list(&self) -> Result<Vec<String>, ServiceManagerError> {
|
||||
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
|
||||
}
|
||||
|
||||
async fn remove(&self, _service_name: &str) -> Result<(), ServiceManagerError> {
|
||||
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user