#writer #tar #xz #http #put

nightly http_writer

Convert any stream into a put request

1 unstable release

new 0.1.1 Feb 18, 2025
0.1.0 Jan 17, 2025

#467 in Compression

Download history 115/week @ 2025-01-16 1/week @ 2025-01-30 4/week @ 2025-02-06

120 downloads per month

MIT license

15KB
201 lines

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(())
}

Dependencies

~7–18MB
~233K SLoC