Documentation ¶
Index ¶
- Constants
- Variables
- type CLAMDConn
- type Clamd
- func (c *Clamd) AllMatchScanFile(path string) (chan *ScanResult, error)
- func (c *Clamd) ContScanFile(path string) (chan *ScanResult, error)
- func (c *Clamd) MultiScanFile(path string) (chan *ScanResult, error)
- func (c *Clamd) Ping() error
- func (c *Clamd) RawScanFile(path string) (chan *ScanResult, error)
- func (c *Clamd) Reload() error
- func (c *Clamd) ScanFile(path string) (chan *ScanResult, error)
- func (c *Clamd) ScanStream(r io.Reader, abort chan bool) (chan *ScanResult, error)
- func (c *Clamd) Shutdown() error
- func (c *Clamd) Stats() (*Stats, error)
- func (c *Clamd) Version() (chan *ScanResult, error)
- type ScanResult
- type Stats
Constants ¶
const ( RES_OK = "OK" RES_FOUND = "FOUND" RES_ERROR = "ERROR" RES_PARSE_ERROR = "PARSE ERROR" )
const CHUNK_SIZE = 1024
const TCP_TIMEOUT = time.Second * 2
Variables ¶
var EICAR = []byte(`X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*`)
Functions ¶
This section is empty.
Types ¶
type Clamd ¶
type Clamd struct {
// contains filtered or unexported fields
}
func (*Clamd) AllMatchScanFile ¶
func (c *Clamd) AllMatchScanFile(path string) (chan *ScanResult, error)
Scan file or directory (recursively) with archive support enabled and don’t stop the scanning when a virus is found.
func (*Clamd) ContScanFile ¶
func (c *Clamd) ContScanFile(path string) (chan *ScanResult, error)
Scan file or directory (recursively) with archive support enabled and don’t stop the scanning when a virus is found.
func (*Clamd) MultiScanFile ¶
func (c *Clamd) MultiScanFile(path string) (chan *ScanResult, error)
Scan file in a standard way or scan directory (recursively) using multiple threads (to make the scanning faster on SMP machines).
func (*Clamd) RawScanFile ¶
func (c *Clamd) RawScanFile(path string) (chan *ScanResult, error)
Scan file or directory (recursively) with archive and special file support disabled (a full path is required).
func (*Clamd) ScanFile ¶
func (c *Clamd) ScanFile(path string) (chan *ScanResult, error)
Scan file or directory (recursively) with archive support enabled (a full path is required).
func (*Clamd) ScanStream ¶
Scan a stream of data. The stream is sent to clamd in chunks, after INSTREAM, on the same socket on which the command was sent. This avoids the overhead of establishing new TCP connections and problems with NAT. The format of the chunk is: <length><data> where <length> is the size of the following data in bytes expressed as a 4 byte unsigned integer in network byte order and <data> is the actual chunk. Streaming is terminated by sending a zero-length chunk. Note: do not exceed StreamMaxLength as defined in clamd.conf, otherwise clamd will reply with INSTREAM size limit exceeded and close the connection
func (*Clamd) Stats ¶
On this command clamd provides statistics about the scan queue, contents of scan queue, and memory usage. The exact reply format is subject to changes in future releases.
func (*Clamd) Version ¶
func (c *Clamd) Version() (chan *ScanResult, error)
Print program and database versions.