Documentation ¶
Index ¶
- type ClamAV
- func (c *ClamAV) Ping() error
- func (c *ClamAV) PreferredPortal() string
- func (c *ClamAV) Scan(r io.Reader, abort chan bool) (infected bool, description string, err error)
- func (c *ClamAV) ScanSkylink(skylink string, abort chan bool) (infected bool, description string, size, scannedSize uint64, err error)
- type ReaderCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClamAV ¶
type ClamAV struct {
// contains filtered or unexported fields
}
ClamAV is a client that allows scanning of content for malware.
func New ¶
New creates a new ClamAV client that will try to connect to the ClamAV service listening on a TCP socket at the given address and port. Before returning the client, New verifies the connection to ClamAV.
func (*ClamAV) PreferredPortal ¶
PreferredPortal returns the portal ClamAV uses to download content.
func (*ClamAV) Scan ¶
Scan streams the content of the reader to ClamAV for malware scanning. It returns an `infected` flag, a description of the detected malware and an error.
func (*ClamAV) ScanSkylink ¶
func (c *ClamAV) ScanSkylink(skylink string, abort chan bool) (infected bool, description string, size, scannedSize uint64, err error)
ScanSkylink downloads the content of the given skylink and streams it to ClamAV for scanning. It returns an `infected` flag, a description of the detected malware and an error.
type ReaderCounter ¶
type ReaderCounter struct {
// contains filtered or unexported fields
}
ReaderCounter is a wrapper of io.Reader that counts how many bytes are read from it.
func NewReaderCounter ¶
func NewReaderCounter(r io.Reader) *ReaderCounter
NewReaderCounter creates a new ReaderCounter instance.
func (*ReaderCounter) Read ¶
func (rc *ReaderCounter) Read(p []byte) (n int, err error)
Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. Even if Read returns n < len(p), it may use all of p as scratch space during the call. If some data is available but not len(p) bytes, Read conventionally returns what is available instead of waiting for more.
func (*ReaderCounter) ReadBytes ¶
func (rc *ReaderCounter) ReadBytes() uint64
ReadBytes returns the number of bytes read from the reader so far.