fetch

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 9 Imported by: 0 modules, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body interface {
	io.Reader
	Body() streams.ReadableStream
}

Body represents the Body IDL mixin defined in the fetch API.

type Fetch

type Fetch struct {
	BrowsingContext html.BrowsingContext
}

func New

func New(bc html.BrowsingContext) Fetch

func (Fetch) Fetch

func (f Fetch) Fetch(req Request) (*Response, error)

func (Fetch) FetchAsync

func (f Fetch) FetchAsync(req Request) promise.Promise[*Response]

func (Fetch) NewRequest

func (f Fetch) NewRequest(url string, opts ...RequestOption) Request

type ReadableStream

type ReadableStream struct {
	Reader io.Reader
}

func (ReadableStream) GetReader

func (s ReadableStream) GetReader(opts ...streams.GetReaderOption) streams.Reader

type Reader

type Reader struct {
	Reader io.Reader
	Done   bool
}

func (*Reader) Read

type Request

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

func (*Request) URL

func (r *Request) URL() string

type RequestOption

type RequestOption func(*Request)

func WithSignal

func WithSignal(s *dom.AbortSignal) RequestOption

type Response

type Response struct {
	io.Reader
	Status int
	// contains filtered or unexported fields
}

func (Response) Body

func (r Response) Body() streams.ReadableStream

Jump to

Keyboard shortcuts

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