Documentation
¶
Overview ¶
Package classify categorizes HTTP responses into deterministic crawl outcomes (ok, challenge, stop, gone, skip, error, not_tried) before upstream parsers inspect response bodies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Kind ¶
type Kind string
Kind identifies what resource shape the caller expects from a URL.
const ( KindFeed Kind = "feed" // Structured JSON product feed (`{"products": [...]}`) KindJSON Kind = "json" // Any valid 2xx JSON document KindPage Kind = "page" // Individual HTML document (`text/html`, 404/410 -> `gone`) KindText Kind = "text" // Auxiliary HTML or XML document (e.g., sitemap or collection) KindCatalog Kind = "catalog" // Full-catalog HTML page where non-2xx fails the host batch )
type Outcome ¶
type Outcome string
Outcome describes how the crawler and caller should act on an HTTP response.
const ( OutcomeOK Outcome = "ok" OutcomeChallenge Outcome = "challenge" // Edge anti-bot challenge (`cf-mitigated`) — never retried OutcomeStop Outcome = "stop" // Origin answered 403, 429, or 503 — halt remaining URLs for this host OutcomeGone Outcome = "gone" // Document answered 404 or 410 OutcomeSkip Outcome = "skip" // Non-200 or non-HTML page that can be skipped without failing the host OutcomeError Outcome = "error" // Feed/transport failure OutcomeNotTried Outcome = "not_tried" // Left unsent because an earlier request stopped the host or timed out )