Versions in this module Expand all Collapse all v0 v0.2.47 Oct 12, 2026 v0.2.46 Oct 8, 2026 Changes in this version + const CodeConnectionFailed + const CodeDNSFailed + const CodeDestinationDenied + const CodeHTTPError + const CodeInvalidURL + const CodeRedirectLimit + const CodeResponseTooLarge + const CodeTimeout + const CodeUnsupportedEncoding + const CodeUnsupportedType + const DefaultMaxBytes + const DefaultMaxHeaderBytes + const DefaultMaxRedirects + const DefaultTimeout + type DialFunc func(ctx context.Context, network, address string) (net.Conn, error) + type Error struct + Bytes int64 + Code string + ContentType string + Message string + Status int + func CheckURL(rawURL string) (*url.URL, *Error) + func (e *Error) Error() string + type Fetcher struct + func New(opts Options) (*Fetcher, error) + func (f *Fetcher) Get(ctx context.Context, r Request) (*Result, error) + type Options struct + Accept string + Dial DialFunc + Guard egress.Guard + MaxBytes int64 + MaxRedirects int + MediaTypes []string + Resolver Resolver + TLSConfig *tls.Config + Timeout time.Duration + type Request struct + URL string + UserAgent string + type Resolver interface + LookupNetIP func(ctx context.Context, network, host string) ([]netip.Addr, error) + type Result struct + Body []byte + Bytes int64 + ContentType string + FinalURL string + Redirects int + Status int + URL string