Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion clamd.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ const (
RES_PARSE_ERROR = "PARSE ERROR"
)

type Scanner interface {
Ping() error
Version() (chan *ScanResult, error)
Stats() (*Stats, error)
Reload() error
Shutdown() error
ScanFile(path string) (chan *ScanResult, error)
RawScanFile(path string) (chan *ScanResult, error)
MultiScanFile(path string) (chan *ScanResult, error)
ContScanFile(path string) (chan *ScanResult, error)
AllMatchScanFile(path string) (chan *ScanResult, error)
ScanStream(r io.Reader, abort chan bool) (chan *ScanResult, error)
}

type Clamd struct {
address string
}
Expand Down Expand Up @@ -305,7 +319,7 @@ func (c *Clamd) ScanStream(r io.Reader, abort chan bool) (chan *ScanResult, erro
return ch, nil
}

func NewClamd(address string) *Clamd {
func NewClamd(address string) Scanner {
clamd := &Clamd{address: address}
return clamd
}