fake

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package fake provides an in-process scan engine for tests. It reports the EICAR test string and nothing else.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	Signatures string
	Scans      atomic.Int64
	// Err, if set, is returned by every scan.
	Err error
	// MaxSize, if set, rejects larger streams like clamd's StreamMaxLength.
	MaxSize int
	// Hold, if set, makes scans of streams containing it wait until Release
	// is closed, like a long scan.
	Hold    []byte
	Release chan struct{}
	// contains filtered or unexported fields
}

Engine detects EICAR. Scans counts the streams scanned.

func (*Engine) Open

func (e *Engine) Open(context.Context) (engine.Session, error)

func (*Engine) SetMaxSize

func (e *Engine) SetMaxSize(n int)

SetMaxSize changes MaxSize, as after a change of clamd's limits.

func (*Engine) SetSignatures

func (e *Engine) SetSignatures(sig string)

SetSignatures changes the signature version, as after a database update.

func (*Engine) Version

func (e *Engine) Version(context.Context) (engine.Version, error)

Jump to

Keyboard shortcuts

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