Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves the web GUI and API endpoints.
func NewHandler ¶
func NewHandler(dispatcher *sanitizer.Dispatcher, pool *worker.Pool, logger *slog.Logger, maxFileSize int64) *Handler
NewHandler creates a new web handler.
func (*Handler) GetStats ¶
GetStats returns the current stats (for use by metrics, gRPC health, etc.)
func (*Handler) RegisterRoutes ¶
RegisterRoutes registers all HTTP routes on the given mux.
type SanitizeResponseJSON ¶
type SanitizeResponseJSON struct {
Status string `json:"status"`
OriginalType string `json:"original_type"`
OriginalSize int64 `json:"original_size"`
SanitizedSize int64 `json:"sanitized_size"`
Threats []ThreatJSON `json:"threats"`
ErrorMessage string `json:"error_message,omitempty"`
DownloadID string `json:"download_id,omitempty"`
DurationMs int64 `json:"duration_ms"`
}
SanitizeResponseJSON is the JSON response for a sanitization request.
type Stats ¶
type Stats struct {
FilesProcessed atomic.Int64
ThreatsRemoved atomic.Int64
FilesSanitized atomic.Int64
FilesClean atomic.Int64
FilesBlocked atomic.Int64
FilesErrored atomic.Int64
FilesUnsupported atomic.Int64
}
Stats tracks cumulative sanitization statistics for the dashboard.
type StatsJSON ¶
type StatsJSON struct {
FilesProcessed int64 `json:"files_processed"`
ThreatsRemoved int64 `json:"threats_removed"`
FilesSanitized int64 `json:"files_sanitized"`
FilesClean int64 `json:"files_clean"`
FilesBlocked int64 `json:"files_blocked"`
FilesErrored int64 `json:"files_errored"`
FilesUnsupported int64 `json:"files_unsupported"`
}
StatsJSON is the JSON-serializable snapshot of Stats.
Click to show internal directories.
Click to hide internal directories.