fetch

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(opts Options) *Client

func (*Client) Allowed

func (c *Client) Allowed(ctx context.Context, rawURL string) (bool, error)

func (*Client) Fetch

func (c *Client) Fetch(ctx context.Context, req Request) (Result, error)

type Options

type Options struct {
	UserAgent    string
	PerHostRate  float64
	PerHostBurst int
	Timeout      time.Duration
	MaxRetries   int
}

type Request

type Request struct {
	URL          string
	ETag         string
	LastModified string
}

type Result

type Result struct {
	Status       int
	Body         []byte
	ETag         string
	LastModified string
	NotModified  bool
}

Jump to

Keyboard shortcuts

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