Versions in this module Expand all Collapse all v0 v0.3.0 Nov 23, 2026 Changes in this version + const CloudflareIPsURL + const CookieDeviceID + const DefaultFetchAccept + const DefaultFetchUserAgent + const HeaderDeviceID + const HeaderRequestID + func AccessLog(opts AccessLogOptions) func(http.Handler) http.Handler + func Chain(mws ...Middleware) chain + func ClientIP(r *http.Request) string + func ClientIPTrusted(r *http.Request, set *CIDRSet) string + func ContextLogAttrs(ctx context.Context) []log.Attr + func DecodeJSON(w http.ResponseWriter, r *http.Request, dst any, maxBytes int64) bool + func DetectBot(ua string) string + func DeviceIDFromContext(ctx context.Context) string + func FallbackSitemapURLs(domain string) []string + func IntParam(values url.Values, key string, def int) int + func IsTrustedProxy(ip net.IP, trusted []*net.IPNet) bool + func NewFetchClient(opts FetchOptions) *http.Client + func NewHandler() *handlerBuilder + func ParseCIDRs(cidrs ...string) ([]*net.IPNet, error) + func ParseRobotsSitemaps(body []byte) []string + func QuietPaths(patterns ...string) func(r *http.Request) log.Level + func Recover(next http.Handler) http.Handler + func RequestID(base *log.Logger) func(http.Handler) http.Handler + func RequestIDFromContext(ctx context.Context) string + func RequireServiceToken(next http.Handler) http.Handler + func RobotsCandidates(domain string) []string + func WithDeviceID(ctx context.Context, id string) context.Context + func WithRequestID(ctx context.Context, id string) context.Context + func WriteError(w http.ResponseWriter, status int, msg string) + func WriteJSON(w http.ResponseWriter, status int, v any) + type AccessLogOptions struct + ClientMeta bool + ContextAttrs func(ctx context.Context) []log.Attr + ExtraAttrs func(r *http.Request) []log.Attr + Level func(r *http.Request) log.Level + Query bool + TrustedProxies *CIDRSet + type CIDRSet struct + func NewCIDRSet(url string, httpClient *http.Client) *CIDRSet + func NewCloudflareCIDRSet() *CIDRSet + func (s *CIDRSet) Refresh(ctx context.Context) error + func (s *CIDRSet) Snapshot() []*net.IPNet + type ErrorResponse struct + Error string + type FetchOptions struct + Accept string + MaxBodySize int64 + MaxRedirects int + Timeout time.Duration + UserAgent string + type FetchResult struct + Body []byte + BodyTooLarge bool + ContentType string + Err error + SHA256Hex string + StatusCode int + func FetchURL(ctx context.Context, client *http.Client, opts FetchOptions, url string) FetchResult + type Middleware = func(http.Handler) http.Handler + type SSEHub struct + func NewSSEHub() *SSEHub + func NewSSEHubWithKeepAlive(keepAlive time.Duration) *SSEHub + func (h *SSEHub) Broadcast() + func (h *SSEHub) ServeSSE(eventName string) http.HandlerFunc + type SitemapDiscoveryResult struct + RobotsBody []byte + RobotsURL string + SitemapURLs []string + func DiscoverSitemap(ctx context.Context, client *http.Client, opts FetchOptions, domain string) SitemapDiscoveryResult + type SitemapEntry struct + LastMod string + Loc string + func ParseSitemap(body []byte) (entries []SitemapEntry, nested []string, err error) v0.2.0 Nov 23, 2026