Crates.io | clamav-tcp |
lib.rs | clamav-tcp |
version | 0.2.1 |
source | src |
created_at | 2022-11-30 19:10:54.588861 |
updated_at | 2022-12-02 22:00:14.154564 |
description | ClamAV TCP client |
homepage | |
repository | https://github.com/tatupesonen/clamav-client |
max_upload_size | |
id | 726533 |
size | 11,509 |
A simple to use TCP client for scanning files with ClamAV.
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
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");
To open the documentation:
cargo doc --open