http_writer

Crates.iohttp_writer
lib.rshttp_writer
version0.1.1
created_at2025-01-17 03:29:33.269546+00
updated_at2025-02-18 02:39:31.80483+00
descriptionConvert any stream into a put request
homepage
repositoryhttps://github.com/rust-org/lib-http-writer
max_upload_size
id1520270
size53,129
(funh2029)

documentation

README

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(())
}
Commit count: 1

cargo fmt