malware

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package malware provides an interface for using the clamav service to scan for malware.

Index

Constants

View Source
const (
	// DefaultScannerTimeout is the default timeout to be used for scanning for malware.
	DefaultScannerTimeout = time.Duration(10) * time.Second
	DefaultPermissive     = false
)

Variables

View Source
var (
	MaxErrorRetries    = 5
	ErrorRetryInterval = 500 * time.Millisecond
)

Functions

This section is empty.

Types

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}
var DefaultScanner *Scanner

func NewScanner

func NewScanner(addr string, timeout time.Duration, permissive bool) *Scanner

func (*Scanner) IsPermissive

func (m *Scanner) IsPermissive() bool

func (*Scanner) ScanBytes

func (m *Scanner) ScanBytes(contents []byte) (bool, string, error)

ScanBytes scans a byte array for malware. It will return true if the file is okay, or it will return false if the file contains malware. If malware is detected, then a string will be returned indicating the nature of malware.

Jump to

Keyboard shortcuts

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