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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap[T any](reg js.ClassBuilder[T])

func Configure

func Configure[T any](host js.ScriptEngine[T])

func EncodeJSONBytes

func EncodeJSONBytes[T any](scope js.Scope[T], b []byte) (js.Value[T], error)

func Fetch

func Fetch[T any](info js.CallbackContext[T]) (js.Value[T], error)

Types

type Body

type Body[T any] struct{}

func NewBody

func NewBody[T any](scriptHost js.ScriptEngine[T]) *Body[T]

func (Body[T]) Constructor

func (w Body[T]) Constructor(cbCtx js.CallbackContext[T]) (js.Value[T], error)

func (Body[T]) Initialize

func (wrapper Body[T]) Initialize(jsClass js.Class[T])

type Request

type Request[T any] struct {
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest[T any](scriptHost js.ScriptEngine[T]) *Request[T]

func (Request[T]) Constructor

func (w Request[T]) Constructor(cbCtx js.CallbackContext[T]) (js.Value[T], error)

func (Request[T]) CreateInstance

func (w Request[T]) CreateInstance(
	cbCtx js.CallbackContext[T],
	url string,
	options ...fetch.RequestOption,
) (js.Value[T], error)

func (Request[T]) Initialize

func (wrapper Request[T]) Initialize(jsClass js.Class[T])

type Response

type Response[T any] struct {
	// contains filtered or unexported fields
}

func NewResponse

func NewResponse[T any](scriptHost js.ScriptEngine[T]) *Response[T]

func (Response[T]) Constructor

func (wrapper Response[T]) Constructor(cbCtx js.CallbackContext[T]) (js.Value[T], error)

func (Response[T]) Initialize

func (wrapper Response[T]) Initialize(jsClass js.Class[T])

Jump to

Keyboard shortcuts

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