Documentation
¶
Rendered for js/wasm
Overview ¶
Package wasmhttp provides interop between the Request and Response objects in JavaScript with their counterparts in net/http. This is useful when building ServiceWorkers in Go which handle the fetch event.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerToFetch ¶
HandlerToFetch returns a fetch compatible function that serves HTTP requests using http.Handler.
func HeaderFromJS ¶
HeaderFromJS converts a JavaScript Headers object to a http.Header.
func HeaderToJS ¶
HeaderToJS converts a http.Header to a js.Value compatible with fetch headers.
Types ¶
type Response ¶
func NewBufferedResponse ¶
NewBufferedResponse returns a Reponse which implements a http.ResponseWriter, and a corresponding js.Value which is a Promise that resolves to a JavaScript Response.
Click to show internal directories.
Click to hide internal directories.