mirror of
https://github.com/faas-rs/faasd-in-rust.git
synced 2025-06-08 07:55:04 +00:00
1
This commit is contained in:
parent
caa05b93fc
commit
377d649d4e
@ -1,5 +1,5 @@
|
||||
use crate::types::*;
|
||||
use actix_web::{HttpResponse, Responder, web};
|
||||
use actix_web::{web, HttpResponse, Responder};
|
||||
use service::Service;
|
||||
use std::sync::Arc;
|
||||
|
||||
@ -36,4 +36,4 @@ pub async fn get_container_list(
|
||||
HttpResponse::Ok().json(container_list)
|
||||
}
|
||||
|
||||
// 添加更多的路由处理函数...
|
||||
// 添加更多的路由处理函数...
|
@ -1,6 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use actix_web::{App, HttpServer, web};
|
||||
use actix_web::{web, App, HttpServer};
|
||||
use service::Service;
|
||||
|
||||
pub mod handlers;
|
||||
@ -29,4 +29,4 @@ async fn main() -> std::io::Result<()> {
|
||||
.bind("0.0.0.0:18080")?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
}
|
@ -17,4 +17,4 @@ pub struct RemoveContainerInfo {
|
||||
pub struct GetContainerListQuery {
|
||||
pub status: Option<String>,
|
||||
pub ns: String,
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
pub mod spec;
|
||||
|
||||
use containerd_client::{
|
||||
Client,
|
||||
services::v1::{
|
||||
container::Runtime,
|
||||
snapshots::{MountsRequest, PrepareSnapshotRequest},
|
||||
@ -19,16 +18,6 @@ use sha2::{Digest, Sha256};
|
||||
use spec::generate_spec;
|
||||
use std::{
|
||||
fs,
|
||||
Container, CreateContainerRequest, CreateTaskRequest, DeleteContainerRequest,
|
||||
DeleteTaskRequest, KillRequest, ListContainersRequest, ListTasksRequest, StartRequest,
|
||||
WaitRequest, container::Runtime,
|
||||
},
|
||||
tonic::Request,
|
||||
with_namespace,
|
||||
};
|
||||
|
||||
use std::{
|
||||
fs::{self, File},
|
||||
sync::{Arc, Mutex},
|
||||
time::Duration,
|
||||
};
|
||||
@ -36,7 +25,6 @@ use tokio::time::timeout;
|
||||
|
||||
// config.json,dockerhub密钥
|
||||
// const DOCKER_CONFIG_DIR: &str = "/var/lib/faasd/.docker/";
|
||||
|
||||
// 命名空间(容器的)
|
||||
const NAMESPACE: &str = "default";
|
||||
|
||||
@ -536,4 +524,4 @@ impl Service {
|
||||
}
|
||||
}
|
||||
//容器是容器,要先启动,然后才能运行任务
|
||||
//要想删除一个正在运行的Task,必须先kill掉这个task,然后才能删除。
|
||||
//要想删除一个正在运行的Task,必须先kill掉这个task,然后才能删除。
|
Loading…
x
Reference in New Issue
Block a user