Documentation ¶
Index ¶
- type ScanContext
- func (s *ScanContext) Context() context.Context
- func (s *ScanContext) GenerateErrorMessage() error
- func (s *ScanContext) GenerateResult() []*output.ResultEvent
- func (s *ScanContext) LogError(err error)
- func (s *ScanContext) LogEvent(e *output.InternalWrappedEvent)
- func (s *ScanContext) LogWarning(format string, args ...any)
- type ScanContextOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScanContext ¶
type ScanContext struct { // exported / configurable fields Input *contextargs.Context // callbacks or hooks OnError func(error) OnResult func(e *output.InternalWrappedEvent) OnWarning func(string) // contains filtered or unexported fields }
func NewScanContext ¶
func NewScanContext(ctx context.Context, input *contextargs.Context) *ScanContext
NewScanContext creates a new scan context using input
func (*ScanContext) Context ¶ added in v3.2.5
func (s *ScanContext) Context() context.Context
Context returns the context of the scan
func (*ScanContext) GenerateErrorMessage ¶ added in v3.3.2
func (s *ScanContext) GenerateErrorMessage() error
func (*ScanContext) GenerateResult ¶
func (s *ScanContext) GenerateResult() []*output.ResultEvent
GenerateResult returns final results slice from all events
func (*ScanContext) LogError ¶
func (s *ScanContext) LogError(err error)
LogError logs error to all events and triggeres any callbacks
func (*ScanContext) LogEvent ¶
func (s *ScanContext) LogEvent(e *output.InternalWrappedEvent)
LogEvent logs events to all events and triggeres any callbacks
func (*ScanContext) LogWarning ¶ added in v3.1.4
func (s *ScanContext) LogWarning(format string, args ...any)
LogWarning logs warning to all events
type ScanContextOption ¶ added in v3.2.1
type ScanContextOption func(*ScanContext)
func WithEvents ¶ added in v3.2.1
func WithEvents() ScanContextOption
Click to show internal directories.
Click to hide internal directories.