cache

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

type Noop

type Noop struct{}

Noop is the default purger: every CDN-affecting call is a silent no-op. Used when no CDN is configured in front of hostthis, or when the operator wants to rely solely on Cache-Control TTL expiry.

func (Noop) PurgePaste added in v0.51.0

func (Noop) PurgePaste(slug domain.Slug) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL