Git Product home page Git Product logo

clamd-client's Introduction

clamd-client, WIP

Rust async tokio client for clamd. Works with a tcp socket or with the unix socket. At the moment it will open a new socket for each command. Work in progress.

Example

See also examples/simple.rs. There should be a running clamd instance on your machine (see Notes).

use clamd_client::{ClamdClientBuilder, ScanResult};

#[tokio::main]
async fn main() -> eyre::Result<()> {

    let address = "127.0.0.1:3310";
    let mut clamd_client = ClamdClientBuilder::tcp_socket(address)?.build();

    let eicar_bytes = reqwest::get("https://secure.eicar.org/eicarcom2.zip")
        .await?
        .bytes()
        .await?;

    let result = clamd_client.scan_bytes(&eicar_bytes).await?;
    match result {
        ScanResult::Malignent { infection_types } => {
            tracing::debug!("clamd found a virus(es):\n{}", infection_types.join("\n"))
        }
        _ => (),
    };
    Ok(())
}

Contributing

testing

clamd is not installed

Simply run cargo test and it should install clamd for you.

Notes

TODOS

  • Implement missing clamd functionality
  • check whether this can also be used with other async runtimes

clamd-client's People

Contributors

levitatingorange avatar mcpatate avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.