| Crates.io | http_writer |
| lib.rs | http_writer |
| version | 0.1.1 |
| created_at | 2025-01-17 03:29:33.269546+00 |
| updated_at | 2025-02-18 02:39:31.80483+00 |
| description | Convert any stream into a put request |
| homepage | |
| repository | https://github.com/rust-org/lib-http-writer |
| max_upload_size | |
| id | 1520270 |
| size | 53,129 |
Used to convert any stream into a put request through writer and upload it to the server, so as to achieve file-free landing.
fn main() -> std::io::Result<()> {
let writer = http_writer::HttpWriter::new("http://192.168.100.100/archive.tar.xz").unwrap();
//
// cargo add xz2 tar
//
let encoder = xz2::write::XzEncoder::new(writer, 6);
let mut tar_builder = tar::Builder::new(encoder);
tar.append_dir_all("backup/logs", "/var/log")?;
Ok(())
}