8000 GitHub - alexdeane/gleam-clamav: ClamAV client for Gleam
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

alexdeane/gleam-clamav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clamav_client

Package Version Hex Docs Latest CI

Gleam client for interacting with a ClamAV instance

gleam add clamav_client@1
import clamav_client/clamav

pub fn main() {
  let data = "some data, probably a file" |> bit_array.from_string

  let clamav_options =
    clamav.new("<host>")
    |> clamav.port(3310)

  case clamav.instream(clamav_options, data) {
    Ok(Clean) -> "Clean!"
    Ok(VirusDetected(infected_files)) -> {
      let infected_file =
        infected_files |> list.first

      "VirusDetected: " <> infected_file.file_name <> " | " <> infected_file.virus_name
    }
    Error(error) -> "Error: " <> error |> string.inspect
  }
}

Further documentation can be found at https://hexdocs.pm/clamav_client.

About

ClamAV client for Gleam

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0