Documentation ¶
Index ¶
- func Enable(runtime *goja.Runtime, proxyHandler func(r *http.Request) (*url.URL, error)) error
- func NewMultipart(w io.Writer) *multipartWrapper
- type EventProp
- type ProgressEvent
- type XMLHttpRequest
- func (xhr *XMLHttpRequest) Abort()
- func (xhr *XMLHttpRequest) GetAllResponseHeaders() string
- func (xhr *XMLHttpRequest) GetResponseHeader(key string) string
- func (xhr *XMLHttpRequest) Open(method, url string)
- func (xhr *XMLHttpRequest) Send(data goja.Value)
- func (xhr *XMLHttpRequest) SetRequestHeader(key, value string)
- type XMLHttpRequestUpload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMultipart ¶
Types ¶
type EventProp ¶
type EventProp struct { Onload func(event *ProgressEvent) `json:"onload"` Onprogress func(event *ProgressEvent) `json:"onprogress"` Onabort func(event *ProgressEvent) `json:"onabort"` Onerror func(event *ProgressEvent) `json:"onerror"` Ontimeout func(event *ProgressEvent) `json:"ontimeout"` // contains filtered or unexported fields }
func (*EventProp) AddEventListener ¶
func (ep *EventProp) AddEventListener(event string, cb func(event *ProgressEvent))
func (*EventProp) RemoveEventListener ¶
type ProgressEvent ¶
type XMLHttpRequest ¶
type XMLHttpRequest struct { WithCredentials bool `json:"withCredentials"` Upload *XMLHttpRequestUpload `json:"upload"` Timeout int `json:"timeout"` ReadyState int `json:"readyState"` Status int `json:"status"` StatusText string `json:"statusText"` Response string `json:"response"` ResponseText string `json:"responseText"` // https://developer.mozilla.org/zh-CN/docs/Web/API/XMLHttpRequest/responseURL // https://xhr.spec.whatwg.org/#the-responseurl-attribute ResponseUrl string `json:"responseURL"` // extend fetch redirect // https://developer.mozilla.org/en-US/docs/Web/API/RequestInit#redirect // https://fetch.spec.whatwg.org/#concept-request-redirect-mode Redirect string `json:"redirect"` *EventProp Onreadystatechange func(event *ProgressEvent) `json:"onreadystatechange"` // contains filtered or unexported fields }
func (*XMLHttpRequest) Abort ¶
func (xhr *XMLHttpRequest) Abort()
func (*XMLHttpRequest) GetAllResponseHeaders ¶
func (xhr *XMLHttpRequest) GetAllResponseHeaders() string
func (*XMLHttpRequest) GetResponseHeader ¶
func (xhr *XMLHttpRequest) GetResponseHeader(key string) string
func (*XMLHttpRequest) Open ¶
func (xhr *XMLHttpRequest) Open(method, url string)
func (*XMLHttpRequest) Send ¶
func (xhr *XMLHttpRequest) Send(data goja.Value)
func (*XMLHttpRequest) SetRequestHeader ¶
func (xhr *XMLHttpRequest) SetRequestHeader(key, value string)
type XMLHttpRequestUpload ¶
type XMLHttpRequestUpload struct {
*EventProp
}
Click to show internal directories.
Click to hide internal directories.