scanners

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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 Scanner based on clamav

func NewClamAV

func NewClamAV(socket string) *ClamAV

NewClamAV returns a Scanner talking to clamAV via socket

func (ClamAV) Scan

func (s ClamAV) Scan(in Input) (Result, error)

Scan to fulfill Scanner interface

type ICAP

type ICAP struct {
	Client Scanner
	URL    string
}

ICAP is responsible for scanning files using an ICAP server

func NewICAP

func NewICAP(icapURL string, icapService string, timeout time.Duration) (ICAP, error)

NewICAP returns a Scanner talking to an ICAP server

func (ICAP) Scan

func (s ICAP) Scan(in Input) (Result, error)

Scan scans a file using the ICAP server

type Input

type Input struct {
	Body io.Reader
	Size int64
	Url  string
	Name string
}

The Input is the common input to all scanners

type Result

type Result struct {
	Infected    bool
	ScanTime    time.Time
	Description string
}

The Result is the common scan result to all scanners

type Scanner

type Scanner interface {
	Do(req ic.Request) (ic.Response, error)
}

Scanner is the interface that wraps the basic Do method

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL