Skip to content

Commit 35ae2eb

Browse files
committed
docs(library): document config validation errors
1 parent dd5b156 commit 35ae2eb

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎docs/_data/unreleased.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ action:
3636
- resumed
3737
# pkg/subenum identifiers
3838
library:
39+
- Config.Validate
40+
- ErrNoWords
3941
- AutoRate
4042
- Diff
4143
- Internal

‎docs/library.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ These queries go to the domain's own name servers, not to `Resolver`, and they a
135135
| `Simulate`, `HitRate`, `Seed` | off, `15`, random | Synthetic results with no DNS traffic, for tests and demos. |
136136
| `Verbose`, `Logf` | off, stderr | Log every lookup. Lines go to `Logf`, or to standard error when it is nil. |
137137

138+
`cfg.Validate()`{% include unreleased.html library="Config.Validate" %} returns the configuration error `Run` would return without starting a scan or sending queries. Call it before `Run` or `Scan` when a form or pipeline needs to check a `Config` first. If the word list has no usable entries, the error matches `ErrNoWords`{% include unreleased.html library="ErrNoWords" %}; use `errors.Is(err, subenum.ErrNoWords)` to identify that case.
139+
138140
## Accounting
139141

140142
`Stats` puts each candidate name into exactly one outcome: `Found`, `NXDomain`, `Timeout`, `Refused`, `Other` or `WildcardFiltered`. Alongside are `QueriesSent`, `Skipped` (left untested by `MaxQueries` or `MaxDuration`, with `Expired` set for the latter), `Excluded`, the result counters `Takeover` and `Internal`, and the resolver-pool counters `PoolHits`, `Confirmed` and `Unconfirmed`. `Aborted` means the reliability guard stopped the scan, so the negatives mean nothing. `Wildcard` and `WildcardFingerprint` describe a wildcard zone. `RetryInconclusive` fills `Retried`, `Recovered` and `Inconclusive` (the names still without an answer), and `AutoRate` fills `RateBackoffs` and `FinalRate`. `Total()` sums the outcomes. `Verdict(interrupted)`{% include unreleased.html library="Verdict" %} applies the CLI run-quality report's rules: `VerdictComplete`, `VerdictDegraded` or `VerdictUnreliable`, with the reason in plain words (naming `Config` fields such as `MaxQueries`).

0 commit comments

Comments
 (0)