Documentation
¶
Index ¶
Constants ¶
View Source
const CalendarContentType = "text/calendar; charset=utf-8"
View Source
const DefaultTTL = types.TTL(2 * time.Hour)
DefaultTTL is a general purpose slow TTL we use as a fallback for calendars that don't match more specific, faster TTLs. This is a constant, not configurable, since we don't want it to change and isn't really at the discretion of the operator.
Variables ¶
View Source
var ErrNotModified = errors.New("feed has not been modified (cached, 304, etc)")
Functions ¶
func TTLFor ¶
TTLFor returns the TTL for the given url.URL. It uses the hostname to search through config.Config IcalTTLMap.
func WithHttpClient ¶
func WithHttpClient(c IHttpClient, cb func() error) error
WithHttpClient temporarily sets the http client used for fetching. Only use this when testing since it isn't threadsafe.
Types ¶
type Feed ¶
type Feed struct {
Url *url.URL
HttpHeaders map[string]string
HttpStatus int
Body []byte
MD5 types.MD5Hash
FetchedAt time.Time
}
type HeaderMap ¶
func HeadersToMap ¶
Click to show internal directories.
Click to hide internal directories.