dlq

package
v1.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 9 Imported by: 0

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

type RowResult struct {
	ID      string
	Success bool
	Err     error
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL