Documentation
¶
Overview ¶
Package template provides a reference skeleton for implementing GoScans scan modules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSetup ¶
func CheckSetup() error
CheckSetup checks whether Setup() executed accordingly. Scan arguments should be checked by the scanner.
Types ¶
type Result ¶
type Result struct {
Data map[string]string
Status string // Final scan status (success or graceful error). Should be stored along with the scan results.
Exception bool // Indicates if something went wrong badly and results shall be discarded. This should never be
}
Result holds the scan output data.
type Scanner ¶
type Scanner struct {
Label string
Started time.Time
Finished time.Time
// contains filtered or unexported fields
}
Scanner implements the template scan module.
func NewScanner ¶
func (*Scanner) Run ¶
Run starts scan execution. This must either be executed as a goroutine, or another thread must be active listening on the scan's result channel, in order to avoid a deadlock situation.
func (*Scanner) SetContext ¶ added in v1.1.0
SetContext can be used to pass an existing context from outside. If timeout is supplied later when calling Run() the external context and the deadline context will be combined. Once set, the context cannot be changed anymore, because it might have been wrapped internally already.