Documentation
¶
Overview ¶
Package fetcher performs well-behaved HTTP feed retrieval following the rachelbythebay Feed Reader Behavior project (FRB) and earth.org.uk RSS-efficiency recommendations: conditional GETs, identifying User-Agent, compression, server-hint parsing and manual redirect handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version string
Version can be set at build time via -ldflags "-X github.com/Brawl345/rssbot/fetcher.Version=...". Otherwise the VCS revision embedded by the Go toolchain is used.
Functions ¶
This section is empty.
Types ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
type Result ¶
type Result struct {
Status int
NotModified bool // 304: nothing changed since the conditional request
Feed *gofeed.Feed // only set on 200 with a parseable feed
ETag string // exactly as received (FRB003)
LastModified string // exactly as received (FRB001)
MaxAge time.Duration // Cache-Control: max-age (FRB022), 0 if absent
RetryAfter time.Duration // Retry-After on 429/503 (FRB020/021), 0 if absent
FeedInterval time.Duration // ttl hint (FRB023/024), 0 if absent
SkipHours []int // RSS skipHours (FRB024)
SkipDays []string // RSS skipDays (FRB024)
PermanentURL string // set on a 301/308 chain ending in 200/304 (FRB130/131)
Body string // snippet of an error body for the user (FRB101/120)
}
Result is the interpreted outcome of a single feed fetch. ETag and LastModified form an atomic set (FRB014) and are only populated from a status 200 response.
Click to show internal directories.
Click to hide internal directories.