Documentation
¶
Overview ¶
Package cache holds CachePurger implementations. The interface is declared in internal/service; concrete adapters live here so the service layer doesn't import any specific CDN's SDK.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cloudflare ¶
type Cloudflare struct {
ZoneID string
Token string
Scheme string // public scheme, e.g. "https"
Apex string // apex domain, e.g. "hostthis.dev"
Mode string // url mode: "subdomain" (prod) | "path" (dev)
Logger *log.Logger
// Defaults to a 5-second-timeout client.
HTTPClient *http.Client
}
Cloudflare purges a paste's cached representations from the Cloudflare CDN edge. The token needs only the zone "Cache:Purge" permission.
Scheme/Apex/Mode map a slug to its public URL variants (pasteCacheURLs). That policy lives in the adapter; the service layer only names the slug.
func (*Cloudflare) PurgePaste ¶ added in v0.51.0
func (c *Cloudflare) PurgePaste(slug domain.Slug) error
PurgePaste purges every CDN cache key the slug is reachable at. The variant policy is provider-agnostic (pasteCacheURLs in urls.go); this adapter only submits the list.