scanner

package
v1.1.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultScanTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HostStore

type HostStore interface {
	HostsForScanning(ctx context.Context, opts api.HostsForScanningOptions) ([]api.HostAddress, error)
	RemoveOfflineHosts(ctx context.Context, maxConsecutiveScanFailures uint64, maxDowntime time.Duration) (uint64, error)
}

type Scanner

type Scanner interface {
	Scan(ctx context.Context, w WorkerRHPScan, force bool)
	Shutdown(ctx context.Context) error
	Status() (bool, time.Time)
	UpdateHostsConfig(cfg api.HostsConfig)
}

func New

func New(hs HostStore, scanBatchSize, scanThreads uint64, scanMinInterval time.Duration, logger *zap.Logger) (Scanner, error)

type WorkerRHPScan

type WorkerRHPScan interface {
	RHPScan(ctx context.Context, hostKey types.PublicKey, hostIP string, timeout time.Duration) (api.RHPScanResponse, error)
}

Jump to

Keyboard shortcuts

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