Documentation
¶
Index ¶
- func DeregisterHook(name string)
- func PostReport(ctx context.Context, report *types.Report, opts flag.Options) error
- func PostRun(ctx context.Context, opts flag.Options) error
- func PostScan(ctx context.Context, results types.Results) (types.Results, error)
- func PreReport(ctx context.Context, report *types.Report, opts flag.Options) error
- func PreRun(ctx context.Context, opts flag.Options) error
- func PreScan(ctx context.Context, target *types.ScanTarget, options types.ScanOptions) error
- func RegisterHook(s Hook)
- type Hook
- type ReportHook
- type RunHook
- type ScanHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeregisterHook ¶
func DeregisterHook(name string)
func PostReport ¶
PostReport is a hook that is called after the report is written.
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.
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.
Click to show internal directories.
Click to hide internal directories.