Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateFilename ¶
GenerateFilename creates a filename for attachments. Format: {moduleID}_{host}_{timestamp}.{ext}
func SanitizeFilename ¶
SanitizeFilename replaces invalid filename characters with underscores.
func TruncateWithIndicator ¶
TruncateWithIndicator truncates a string and adds "[see attachment]".
Types ¶
type Backend ¶
type Backend interface {
// Send sends a scan result notification.
Send(result *output.ResultEvent) error
// SendRaw sends a raw text message (for panics, errors).
SendRaw(msg string) error
// Close releases any resources held by the backend.
Close()
}
Backend is the interface for notification backends. Each backend handles its own formatting, escaping, length limits, and file uploads.
type Config ¶
type Config struct {
// Backends to send notifications to
Backends []Backend
// AllowedSeverities filters which severities to notify.
// Use "all" to notify all severities.
AllowedSeverities []string
// QueueSize is the notification queue buffer size.
// Default: 1000
QueueSize int
// ShutdownTimeout is how long to wait for pending notifications on Close.
// Default: 30s
ShutdownTimeout time.Duration
}
Config configures the notification Manager.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages async notification queue and multiple backends.
func (*Manager) Close ¶
func (m *Manager) Close()
Close waits for all pending notifications to be sent, then closes all backends.
Click to show internal directories.
Click to hide internal directories.