Documentation
¶
Overview ¶
Package dlq provides helpers for nself dlq replay.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoRows = errors.New("no DLQ rows matched the filter criteria")
ErrNoRows is returned when the DLQ contains no rows matching the filter.
Functions ¶
This section is empty.
Types ¶
type ReplayOptions ¶
type ReplayOptions struct {
// Plugin name to replay (required).
Plugin string
// MaxRows caps the number of rows replayed (default 100).
MaxRows int
// Filter is a map of field=value pairs (e.g. "status=quarantined").
Filter map[string]string
// DryRun previews without executing.
DryRun bool
// BaseURL is the nSelf API base URL. Defaults to NSELF_API_URL env var or http://localhost:8080.
BaseURL string
// Stdout/Stderr for output.
Stdout io.Writer
Stderr io.Writer
// HTTPClient allows injection in tests.
HTTPClient *http.Client
}
ReplayOptions holds parsed flags for dlq replay.
type RowResult ¶
RowResult holds the per-row outcome of a replay attempt.
func Replay ¶
func Replay(ctx context.Context, opts ReplayOptions) ([]RowResult, error)
Replay queries a plugin's DLQ table and re-enqueues rows back to the work queue.
Safe defaults: --max-rows 100 prevents floods. --dry-run previews without executing. A prominent warning is emitted to remind the operator to fix the upstream bug first.
Click to show internal directories.
Click to hide internal directories.