interface DomainRule

One per-domain concurrency/rate-limit rule, as declared by a plugin's own PluginOptionsResult.domain_rules default, or as a user's persisted override (GET/PUT /api/plugins/{namespace}/options) — specs/005-download-plugin-progress/ data-model.md's Domain Rule.

Properties

optional
pattern: string

An exact hostname ("example.com") or a wildcard covering subdomains ("*.example.com"). Case-insensitive; no port/scheme component. Omit entirely (or use "*") for a general, non-domain-specific fallback rule. An exact-hostname match always takes precedence over a wildcard match, which always takes precedence over the general fallback.

optional
max_concurrent: number

Maximum simultaneous downloads permitted against a domain matching pattern. Absent = no concurrency limit from this rule.

optional
max_bytes_per_sec: number

Maximum transfer speed (bytes/sec) permitted against a domain matching pattern. Absent = no rate limit from this rule.

optional
description: string

Human-readable explanation shown in the settings UI.

Usage

import { type DomainRule } from "crates/lanrurugi-plugin/dispatcher/plugin-sdk.ts";