clamxir v0.1.5 Clamxir

Clamxir is a wrapper for clamav. It requires to have installed clamav in order to work. As a suggestion, run the config with the daemonize flag as it will use the daemon instance of clamav.

Link to this section Summary

Functions

Returns a tuple with the result of the function

The oppossite of virus?/2.

Examples

Returns true if the check flag of config isn’t set. Otherwise will return a boolean if the scanner has been found

Return boolean with the result if succeded. Otherwhise, a tuple with {:error, message}

Link to this section Functions

Link to this function file_exists?(path)

Returns a tuple with the result of the function.

Examples

iex> Clamxir.file_exists?("README.md")
{:ok, "README.md"}

iex> Clamxir.file_exists?("NO_FILE.md")
{:error, "NO_FILE.md not found."}
Link to this function safe?(clamxir_config, path)

The oppossite of virus?/2.

Examples

iex> Clamxir.safe?(%Clamxir{}, "README.md")
false

iex> Clamxir.safe?(%Clamxir{}, "NOT_FOUND.md")
{:error, "NOT_FOUND.md not found."}
Link to this function scanner_exists?(clamxir_config)

Returns true if the check flag of config isn’t set. Otherwise will return a boolean if the scanner has been found.

Examples

iex> Clamxir.scanner_exists?(%Clamxir{})
true

iex> Clamxir.scanner_exists?(%Clamxir{check: true})
true
Link to this function virus?(clamxir_config, path)

Return boolean with the result if succeded. Otherwhise, a tuple with {:error, message}

Examples

iex> Clamxir.virus?(%Clamxir{}, "README.md")
false

iex> Clamxir.virus?(%Clamxir{}, "NOT_FOUND.md")
{:error, "NOT_FOUND.md not found."}