clamav-tcp

Crates.ioclamav-tcp
lib.rsclamav-tcp
version0.2.1
sourcesrc
created_at2022-11-30 19:10:54.588861
updated_at2022-12-02 22:00:14.154564
descriptionClamAV TCP client
homepage
repositoryhttps://github.com/tatupesonen/clamav-client
max_upload_size
id726533
size11,509
Tatu Pesonen (tatupesonen)

documentation

https://docs.rs/clamav-tcp

README

clamav-tcp

A simple to use TCP client for scanning files with ClamAV.

Tests

There is an example docker-compose.yml file that sets up ClamAV for you. It is required to run the tests.

To run tests:

cargo test

Usage

You can pass anything that implements &mut Read to clamav-tcp.

eg. to scan a file

let mut eicar = std::fs::File::open("resources/eicar.txt").unwrap();
let res = scan("localhost:3310", &mut eicar, None).unwrap();
assert_eq!(res, "stream: Win.Test.EICAR_HDB-1 FOUND\0");

To scan a string:

let mut eicar = r"X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*".as_bytes();
let res = scan("localhost:3310", &mut eicar, None).unwrap();
assert_eq!(res, "stream: Win.Test.EICAR_HDB-1 FOUND\0");

Documentation

To open the documentation:

cargo doc --open
Commit count: 12

cargo fmt