Documentation
¶
Overview ¶
Package siteindex keeps a published site's posts and guides in the index (spec 0008). It joins pkg/site, which fetches with no credential, to pkg/index, which is why it is a package of its own: the index reaches forge, and the fetcher must not.
Index ¶
Constants ¶
const DefaultMaxPages = 500
DefaultMaxPages bounds how many pages one run fetches (R-KB-15). The site declared 241 on 2026-10-30.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
Indexer refreshes one site.
func (*Indexer) Refresh ¶
Refresh brings the site's pages up to date. With full set it ignores cache validators, so every page is fetched, though unchanged text is still not re-chunked.
A site that cannot be reached, or a page that fails, is recorded on the site and in the report, and is never an error: the bot answers from what it holds (spec 0008 section 6). Only a failure to write the index is returned.
type Option ¶
type Option func(*Indexer)
Option configures an Indexer.
func WithCutoff ¶
WithCutoff sets the publication date before which a post is not indexed.
func WithMaxPages ¶
WithMaxPages bounds how many pages one run fetches.
type Report ¶
type Report struct {
Origin string
// Posts and Routes count what was indexed or confirmed this run.
Posts int
Routes int
Indexed int
Unchanged int
// Missing counts listed pages the site answered 404 for. They keep their
// last good copy until the listing drops them.
Missing int
// Failed maps a page URL to why it could not be indexed.
Failed map[string]string
// Removed names the pages this run took out of the index, and Pending
// those that recent listings have omitted (spec 0008 Q-3).
Removed []string
Pending []string
// Problem says why the run was incomplete, empty when it was not.
Problem string
}
Report is what one run of a site did.