site

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 19 Imported by: 1 module, 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 site reads a page from its site's own public API when the page is a bot wall or leaves content out. Every request goes through the caller's getter, so through refetch's clients and their public-only dialer.

Index

Constants

View Source
const Client = "site_api"

Client is the attempt client name of a read through a site's API.

Variables

View Source
var ErrRateLimited = errors.New("rate limited")

ErrRateLimited marks a read refused for the API's rate limit, as HTTP 429 is.

Functions

This section is empty.

Types

type Getter

type Getter func(ctx context.Context, url string) ([]byte, error)

Getter fetches one public URL: its body, or an error and the error answer's.

type Route

type Route struct {
	Name string // the API, as the result names it: "Stack Exchange API"
	Read func(ctx context.Context, get Getter) (markdown string, err error)
}

Route reads one page through its site's API.

func ForPage

func ForPage(raw string, body []byte) *Route

ForPage is the route for a page its markup names, read after it.

func ForURL

func ForURL(raw string) *Route

ForURL is the route for a page known by its address, read instead of it.

Jump to

Keyboard shortcuts

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