AMQP communication structures

Definitions of the communication structures used in edeposit.amqp.antivirus project.

class antivirus.structures.ScanFile[source]

Bases: antivirus.structures.ScanFile

Request to scan file.

Parameters:
  • filename (str) – Path of the file at your system. It will be used in result structure.
  • b64_data (str) – Base64 encoded content of the file.
Returns:

ScanResult

Return type:

object

Create new instance of ScanFile(filename, b64_data)

class antivirus.structures.UpdateDatabase[source]

Bases: antivirus.structures.UpdateDatabase

Request to update clamav database (= to run freshclam program).

Returns:DatabaseUpdated
Return type:object

Create new instance of UpdateDatabase()

class antivirus.structures.ScanResult[source]

Bases: antivirus.structures.ScanResult

Result of the file scan.

Parameters:
  • filename (str) – Name of the file as was specified in ScanFile request.
  • result (dict) – Dictionary in following format:
{
    "local_path": ("RESULT", "TYPE")
}

Where RESULT is “FOUND” or string like that and TYPE is name of the malware.

Note

When no malware is found, result is blank dict.

Create new instance of ScanResult(filename, result)

class antivirus.structures.DatabaseUpdated[source]

Bases: antivirus.structures.DatabaseUpdated

Response to UpdateDatabase.

Attr:
log (str): Log of the freshclam run.

Create new instance of DatabaseUpdated(log,)