WIP create a handler to download a file chunk by chunk.
This commit is contained in:
Generated
+39
@@ -316,6 +316,28 @@ version = "1.0.102"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
|
||||
|
||||
[[package]]
|
||||
name = "async-stream"
|
||||
version = "0.3.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476"
|
||||
dependencies = [
|
||||
"async-stream-impl",
|
||||
"futures-core",
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-stream-impl"
|
||||
version = "0.3.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atomic-waker"
|
||||
version = "1.1.2"
|
||||
@@ -1198,6 +1220,17 @@ version = "0.3.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
|
||||
|
||||
[[package]]
|
||||
name = "futures-macro"
|
||||
version = "0.3.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-sink"
|
||||
version = "0.3.32"
|
||||
@@ -1217,6 +1250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-macro",
|
||||
"futures-task",
|
||||
"pin-project-lite",
|
||||
"slab",
|
||||
@@ -1836,11 +1870,15 @@ version = "1.0.0"
|
||||
dependencies = [
|
||||
"actix-web",
|
||||
"actix-web-httpauth",
|
||||
"async-stream",
|
||||
"chrono",
|
||||
"futures-util",
|
||||
"jsonwebtoken",
|
||||
"lumiere-application",
|
||||
"lumiere-domain",
|
||||
"serde",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
@@ -1856,6 +1894,7 @@ dependencies = [
|
||||
"rand 0.10.1",
|
||||
"rusqlite",
|
||||
"sysinfo",
|
||||
"tokio",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
|
||||
@@ -16,30 +16,30 @@ use surveillant_systeme_exposition::video::video_format_content_type_mapper::map
|
||||
use surveillant_systeme_infrastructure::video::video_format_detector::get_content_type;
|
||||
use tokio_cron_scheduler::{Job, JobScheduler};
|
||||
|
||||
// #[actix_web::main]
|
||||
fn main() {
|
||||
let path_str = "/home/florian/Videos/AirFly/GH010015.MP4";
|
||||
let path = Path::new(path_str);
|
||||
let file_type = get_content_type(&path);
|
||||
let file_content_type = map_to_content_type(&file_type);
|
||||
println!("file_type={file_content_type}");
|
||||
()
|
||||
// dotenv().ok();
|
||||
// unsafe { env::set_var("RUST_LOG", "debug"); }
|
||||
// check_all_variables_are_set();
|
||||
// env_logger::init();
|
||||
//
|
||||
// let application_context = ApplicationContext::init()?;
|
||||
//
|
||||
// let tls_config = init_tls_configuration()?;
|
||||
// let server = HttpServer::new(
|
||||
// move || App::new().configure(init)
|
||||
// .app_data(web::Data::new(Arc::new(application_context.user_service.clone())))
|
||||
// )
|
||||
// .bind_rustls_0_23(("0.0.0.0", 19000), tls_config)
|
||||
// .expect("Unable to start server");
|
||||
//
|
||||
// server.run().await
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
// let path_str = "/home/florian/Videos/AirFly/GH010015.MP4";
|
||||
// let path = Path::new(path_str);
|
||||
// let file_type = get_content_type(&path);
|
||||
// let file_content_type = map_to_content_type(&file_type);
|
||||
// println!("file_type={file_content_type}");
|
||||
// ()
|
||||
dotenv().ok();
|
||||
unsafe { env::set_var("RUST_LOG", "debug"); }
|
||||
check_all_variables_are_set();
|
||||
env_logger::init();
|
||||
|
||||
let application_context = ApplicationContext::init()?;
|
||||
|
||||
let tls_config = init_tls_configuration()?;
|
||||
let server = HttpServer::new(
|
||||
move || App::new().configure(init)
|
||||
.app_data(web::Data::new(Arc::new(application_context.user_service.clone())))
|
||||
)
|
||||
.bind_rustls_0_23(("0.0.0.0", 19000), tls_config)
|
||||
.expect("Unable to start server");
|
||||
|
||||
server.run().await
|
||||
}
|
||||
|
||||
fn init_tls_configuration() -> Result<ServerConfig, Error> {
|
||||
|
||||
Reference in New Issue
Block a user