clamav

Types

pub type ClamError {
  ScanError(error: String)
  CannotParseResponse(ClamResponseParsingError)
  ConnectionError(error: mug.Error)
}

Constructors

  • ScanError(error: String)
  • CannotParseResponse(ClamResponseParsingError)
  • ConnectionError(error: mug.Error)
pub type ClamResponseParsingError {
  UnexpectedResponse(raw_response: String)
  InvalidBinaryData
}

Constructors

  • UnexpectedResponse(raw_response: String)
  • InvalidBinaryData
pub type ClamScanResult {
  Clean
  VirusDetected(infected_files: List(InfectedFile))
}

Constructors

  • Clean
  • VirusDetected(infected_files: List(InfectedFile))
pub type ClamVersionResponse {
  ClamVersionResponse(version: String, database_version: String)
}

Constructors

  • ClamVersionResponse(version: String, database_version: String)
pub type InfectedFile {
  InfectedFile(file_name: String, virus_name: String)
}

Constructors

  • InfectedFile(file_name: String, virus_name: String)

Functions

pub fn instream(
  options: ClamAvClientOptions,
  file_content: BitArray,
) -> Result(ClamScanResult, ClamError)

Scan a file in memory

pub fn ping(
  options: ClamAvClientOptions,
) -> Result(Nil, ClamError)

Send a PING command to the ClamAV server

pub fn stats(
  options: ClamAvClientOptions,
) -> Result(String, ClamError)
pub fn version(
  options: ClamAvClientOptions,
) -> Result(ClamVersionResponse, ClamError)
Search Document