extension

package
v0.69.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeregisterHook

func DeregisterHook(name string)

func PostReport

func PostReport(ctx context.Context, report *types.Report, opts flag.Options) error

PostReport is a hook that is called after the report is written.

func PostRun

func PostRun(ctx context.Context, opts flag.Options) error

PostRun is a hook that is called after all the processes.

func PostScan

func PostScan(ctx context.Context, results types.Results) (types.Results, error)

PostScan is a hook that is called after the scan.

func PreReport

func PreReport(ctx context.Context, report *types.Report, opts flag.Options) error

PreReport is a hook that is called before the report is written.

func PreRun

func PreRun(ctx context.Context, opts flag.Options) error

func PreScan

func PreScan(ctx context.Context, target *types.ScanTarget, options types.ScanOptions) error

PreScan is a hook that is called before the scan.

func RegisterHook

func RegisterHook(s Hook)

Types

type Hook

type Hook interface {
	// Name returns the name of the extension.
	Name() string
}

Hook is an interface that defines the methods for a hook.

func Hooks

func Hooks() []Hook

Hooks returns the list of hooks.

type ReportHook

type ReportHook interface {
	Hook

	// PreReport is called before the report is written.
	// It can modify the report. It is called on the client side.
	PreReport(ctx context.Context, report *types.Report, opts flag.Options) error

	// PostReport is called after the report is written.
	// It can modify the report. It is called on the client side.
	PostReport(ctx context.Context, report *types.Report, opts flag.Options) error
}

ReportHook is a extension that is called before and after the report is written.

type RunHook

type RunHook interface {
	Hook

	// PreRun is called before all the processes.
	PreRun(ctx context.Context, opts flag.Options) error

	// PostRun is called after all the processes.
	PostRun(ctx context.Context, opts flag.Options) error
}

RunHook is a extension that is called before and after all the processes.

type ScanHook

type ScanHook interface {
	Hook

	// PreScan is called before the scan. It can modify the scan target.
	// It may be called on the server side in client/server mode.
	PreScan(ctx context.Context, target *types.ScanTarget, opts types.ScanOptions) error

	// PostScan is called after the scan. It can modify the results.
	// It may be called on the server side in client/server mode.
	// NOTE: Wasm modules cannot directly modify the passed results,
	//       so it returns a copy of the results.
	PostScan(ctx context.Context, results types.Results) (types.Results, error)
}

ScanHook is a extension that is called before and after the scan.

Jump to

Keyboard shortcuts

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