webfetch

package
v2026.621.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxBodyBytes    = 5 * 1024 * 1024
	DefaultTimeoutS = 30
	MaxTimeoutSecs  = 120
	UserAgent       = defaultUserAgent
)

Variables

This section is empty.

Functions

func ClassifyHTTPStatusForTest

func ClassifyHTTPStatusForTest(status int, body []byte) string

func DomainBlockedForTest

func DomainBlockedForTest(host string, rules []string) (bool, string)

func ResetSharedClientForTest

func ResetSharedClientForTest()

func RetryableFetchErrorForTest

func RetryableFetchErrorForTest(err error) bool

Types

type Result

type Result struct {
	URL         string
	Status      int
	ContentType string
	Markdown    string
	Title       string
}

func FetchURL

func FetchURL(ctx context.Context, rawURL string, timeoutSec int, cfg *config.Root) (Result, error)

Jump to

Keyboard shortcuts

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