Documentation
¶
Overview ¶
Package xhr contains XMLHttpRequest Standard that provides scripted client functionality for transferring data between a client and a server.
Index ¶
- Constants
- type ProgressEvent
- type ProgressEventInit
- type Union
- type XMLHttpRequest
- func (_this *XMLHttpRequest) Abort()
- func (_this *XMLHttpRequest) AddEventReadyStateChange(listener func(event *domcore.Event, currentTarget *XMLHttpRequest)) js.Func
- func (_this *XMLHttpRequest) GetAllResponseHeaders() (_result *patch.ByteString)
- func (_this *XMLHttpRequest) GetResponseHeader(name *patch.ByteString) (_result *patch.ByteString)
- func (_this *XMLHttpRequest) OnReadyStateChange() domcore.EventHandlerFunc
- func (_this *XMLHttpRequest) Open(method *patch.ByteString, url string)
- func (_this *XMLHttpRequest) Open2(method *patch.ByteString, url string, async bool, username *string, ...)
- func (_this *XMLHttpRequest) OverrideMimeType(mime string)
- func (_this *XMLHttpRequest) ReadyState() int
- func (_this *XMLHttpRequest) Response() js.Value
- func (_this *XMLHttpRequest) ResponseText() string
- func (_this *XMLHttpRequest) ResponseType() XMLHttpRequestResponseType
- func (_this *XMLHttpRequest) ResponseURL() string
- func (_this *XMLHttpRequest) ResponseXML() js.Value
- func (_this *XMLHttpRequest) Send(body *Union)
- func (_this *XMLHttpRequest) SetOnReadyStateChange(listener func(event *domcore.Event, currentTarget *XMLHttpRequest)) js.Func
- func (_this *XMLHttpRequest) SetRequestHeader(name *patch.ByteString, value *patch.ByteString)
- func (_this *XMLHttpRequest) SetResponseType(value XMLHttpRequestResponseType)
- func (_this *XMLHttpRequest) SetTimeout(value uint)
- func (_this *XMLHttpRequest) SetWithCredentials(value bool)
- func (_this *XMLHttpRequest) Status() int
- func (_this *XMLHttpRequest) StatusText() *patch.ByteString
- func (_this *XMLHttpRequest) Timeout() uint
- func (_this *XMLHttpRequest) Upload() *XMLHttpRequestUpload
- func (_this *XMLHttpRequest) WithCredentials() bool
- type XMLHttpRequestEventTarget
- func (_this *XMLHttpRequestEventTarget) AddEventAbort(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) AddEventError(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) AddEventLoad(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) AddEventLoadEnd(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) AddEventLoadStart(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) AddEventProgress(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) AddEventTimeOut(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) OnAbort() domcore.EventHandlerFunc
- func (_this *XMLHttpRequestEventTarget) OnError() domcore.EventHandlerFunc
- func (_this *XMLHttpRequestEventTarget) OnLoad() domcore.EventHandlerFunc
- func (_this *XMLHttpRequestEventTarget) OnLoadEnd() domcore.EventHandlerFunc
- func (_this *XMLHttpRequestEventTarget) OnLoadStart() domcore.EventHandlerFunc
- func (_this *XMLHttpRequestEventTarget) OnProgress() domcore.EventHandlerFunc
- func (_this *XMLHttpRequestEventTarget) OnTimeOut() domcore.EventHandlerFunc
- func (_this *XMLHttpRequestEventTarget) SetOnAbort(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) SetOnError(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) SetOnLoad(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) SetOnLoadEnd(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) SetOnLoadStart(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) SetOnProgress(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- func (_this *XMLHttpRequestEventTarget) SetOnTimeOut(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
- type XMLHttpRequestResponseType
- type XMLHttpRequestUpload
Examples ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProgressEvent ¶
class: ProgressEvent
func NewProgressEvent ¶
func NewProgressEvent(_type string, eventInitDict *ProgressEventInit) (_result *ProgressEvent)
func ProgressEventFromJS ¶
func ProgressEventFromJS(value js.Value) *ProgressEvent
ProgressEventFromJS is casting a js.Value into ProgressEvent.
func ProgressEventFromWrapper ¶
func ProgressEventFromWrapper(input core.Wrapper) *ProgressEvent
ProgressEventFromJS is casting from something that holds a js.Value into ProgressEvent.
func (*ProgressEvent) LengthComputable ¶
func (_this *ProgressEvent) LengthComputable() bool
LengthComputable returning attribute 'lengthComputable' with type bool (idl: boolean).
func (*ProgressEvent) Loaded ¶
func (_this *ProgressEvent) Loaded() int
Loaded returning attribute 'loaded' with type int (idl: unsigned long long).
func (*ProgressEvent) Total ¶
func (_this *ProgressEvent) Total() int
Total returning attribute 'total' with type int (idl: unsigned long long).
type ProgressEventInit ¶
type ProgressEventInit struct { Bubbles bool Cancelable bool Composed bool LengthComputable bool Loaded int Total int }
dictionary: ProgressEventInit
func ProgressEventInitFromJS ¶
func ProgressEventInitFromJS(value js.Value) *ProgressEventInit
ProgressEventInitFromJS is allocating a new ProgressEventInit object and copy all values in the value javascript object.
func (*ProgressEventInit) JSValue ¶
func (_this *ProgressEventInit) JSValue() js.Value
JSValue is allocating a new javascript object and copy all values
type Union ¶
func UnionFromJS ¶
type XMLHttpRequest ¶
type XMLHttpRequest struct {
XMLHttpRequestEventTarget
}
class: XMLHttpRequest
func NewXMLHttpRequest ¶
func NewXMLHttpRequest() (_result *XMLHttpRequest)
func XMLHttpRequestFromJS ¶
func XMLHttpRequestFromJS(value js.Value) *XMLHttpRequest
XMLHttpRequestFromJS is casting a js.Value into XMLHttpRequest.
func XMLHttpRequestFromWrapper ¶
func XMLHttpRequestFromWrapper(input core.Wrapper) *XMLHttpRequest
XMLHttpRequestFromJS is casting from something that holds a js.Value into XMLHttpRequest.
func (*XMLHttpRequest) Abort ¶
func (_this *XMLHttpRequest) Abort()
func (*XMLHttpRequest) AddEventReadyStateChange ¶
func (_this *XMLHttpRequest) AddEventReadyStateChange(listener func(event *domcore.Event, currentTarget *XMLHttpRequest)) js.Func
AddReadyStateChange is adding doing AddEventListener for 'ReadyStateChange' on target. This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequest) GetAllResponseHeaders ¶
func (_this *XMLHttpRequest) GetAllResponseHeaders() (_result *patch.ByteString)
func (*XMLHttpRequest) GetResponseHeader ¶
func (_this *XMLHttpRequest) GetResponseHeader(name *patch.ByteString) (_result *patch.ByteString)
func (*XMLHttpRequest) OnReadyStateChange ¶
func (_this *XMLHttpRequest) OnReadyStateChange() domcore.EventHandlerFunc
OnReadyStateChange returning attribute 'onreadystatechange' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*XMLHttpRequest) Open ¶
func (_this *XMLHttpRequest) Open(method *patch.ByteString, url string)
func (*XMLHttpRequest) Open2 ¶
func (_this *XMLHttpRequest) Open2(method *patch.ByteString, url string, async bool, username *string, password *string)
func (*XMLHttpRequest) OverrideMimeType ¶
func (_this *XMLHttpRequest) OverrideMimeType(mime string)
func (*XMLHttpRequest) ReadyState ¶
func (_this *XMLHttpRequest) ReadyState() int
ReadyState returning attribute 'readyState' with type int (idl: unsigned short).
func (*XMLHttpRequest) Response ¶
func (_this *XMLHttpRequest) Response() js.Value
Response returning attribute 'response' with type Any (idl: any).
func (*XMLHttpRequest) ResponseText ¶
func (_this *XMLHttpRequest) ResponseText() string
ResponseText returning attribute 'responseText' with type string (idl: USVString).
func (*XMLHttpRequest) ResponseType ¶
func (_this *XMLHttpRequest) ResponseType() XMLHttpRequestResponseType
ResponseType returning attribute 'responseType' with type XMLHttpRequestResponseType (idl: XMLHttpRequestResponseType).
func (*XMLHttpRequest) ResponseURL ¶
func (_this *XMLHttpRequest) ResponseURL() string
ResponseURL returning attribute 'responseURL' with type string (idl: USVString).
func (*XMLHttpRequest) ResponseXML ¶
func (_this *XMLHttpRequest) ResponseXML() js.Value
ResponseXML returning attribute 'responseXML' with type js.Value (idl: Document).
Example ¶
package main import ( "github.com/gowebapi/webapi" "github.com/gowebapi/webapi/communication/xhr" ) func main() { var req *xhr.XMLHttpRequest // cast to correct type value := webapi.DocumentFromJS(req.ResponseXML()) // do something with value _ = value }
Output:
func (*XMLHttpRequest) Send ¶
func (_this *XMLHttpRequest) Send(body *Union)
func (*XMLHttpRequest) SetOnReadyStateChange ¶
func (_this *XMLHttpRequest) SetOnReadyStateChange(listener func(event *domcore.Event, currentTarget *XMLHttpRequest)) js.Func
SetOnReadyStateChange is assigning a function to 'onreadystatechange'. This This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequest) SetRequestHeader ¶
func (_this *XMLHttpRequest) SetRequestHeader(name *patch.ByteString, value *patch.ByteString)
func (*XMLHttpRequest) SetResponseType ¶
func (_this *XMLHttpRequest) SetResponseType(value XMLHttpRequestResponseType)
SetResponseType setting attribute 'responseType' with type XMLHttpRequestResponseType (idl: XMLHttpRequestResponseType).
func (*XMLHttpRequest) SetTimeout ¶
func (_this *XMLHttpRequest) SetTimeout(value uint)
SetTimeout setting attribute 'timeout' with type uint (idl: unsigned long).
func (*XMLHttpRequest) SetWithCredentials ¶
func (_this *XMLHttpRequest) SetWithCredentials(value bool)
SetWithCredentials setting attribute 'withCredentials' with type bool (idl: boolean).
func (*XMLHttpRequest) Status ¶
func (_this *XMLHttpRequest) Status() int
Status returning attribute 'status' with type int (idl: unsigned short).
func (*XMLHttpRequest) StatusText ¶
func (_this *XMLHttpRequest) StatusText() *patch.ByteString
StatusText returning attribute 'statusText' with type patch.ByteString (idl: ByteString).
func (*XMLHttpRequest) Timeout ¶
func (_this *XMLHttpRequest) Timeout() uint
Timeout returning attribute 'timeout' with type uint (idl: unsigned long).
func (*XMLHttpRequest) Upload ¶
func (_this *XMLHttpRequest) Upload() *XMLHttpRequestUpload
Upload returning attribute 'upload' with type XMLHttpRequestUpload (idl: XMLHttpRequestUpload).
func (*XMLHttpRequest) WithCredentials ¶
func (_this *XMLHttpRequest) WithCredentials() bool
WithCredentials returning attribute 'withCredentials' with type bool (idl: boolean).
type XMLHttpRequestEventTarget ¶
type XMLHttpRequestEventTarget struct {
domcore.EventTarget
}
class: XMLHttpRequestEventTarget
func XMLHttpRequestEventTargetFromJS ¶
func XMLHttpRequestEventTargetFromJS(value js.Value) *XMLHttpRequestEventTarget
XMLHttpRequestEventTargetFromJS is casting a js.Value into XMLHttpRequestEventTarget.
func XMLHttpRequestEventTargetFromWrapper ¶
func XMLHttpRequestEventTargetFromWrapper(input core.Wrapper) *XMLHttpRequestEventTarget
XMLHttpRequestEventTargetFromJS is casting from something that holds a js.Value into XMLHttpRequestEventTarget.
func (*XMLHttpRequestEventTarget) AddEventAbort ¶
func (_this *XMLHttpRequestEventTarget) AddEventAbort(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
AddAbort is adding doing AddEventListener for 'Abort' on target. This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) AddEventError ¶
func (_this *XMLHttpRequestEventTarget) AddEventError(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
AddError is adding doing AddEventListener for 'Error' on target. This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) AddEventLoad ¶
func (_this *XMLHttpRequestEventTarget) AddEventLoad(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
AddLoad is adding doing AddEventListener for 'Load' on target. This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) AddEventLoadEnd ¶
func (_this *XMLHttpRequestEventTarget) AddEventLoadEnd(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
AddLoadEnd is adding doing AddEventListener for 'LoadEnd' on target. This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) AddEventLoadStart ¶
func (_this *XMLHttpRequestEventTarget) AddEventLoadStart(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
AddLoadStart is adding doing AddEventListener for 'LoadStart' on target. This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) AddEventProgress ¶
func (_this *XMLHttpRequestEventTarget) AddEventProgress(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
AddProgress is adding doing AddEventListener for 'Progress' on target. This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) AddEventTimeOut ¶
func (_this *XMLHttpRequestEventTarget) AddEventTimeOut(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
AddTimeOut is adding doing AddEventListener for 'TimeOut' on target. This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) OnAbort ¶
func (_this *XMLHttpRequestEventTarget) OnAbort() domcore.EventHandlerFunc
OnAbort returning attribute 'onabort' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*XMLHttpRequestEventTarget) OnError ¶
func (_this *XMLHttpRequestEventTarget) OnError() domcore.EventHandlerFunc
OnError returning attribute 'onerror' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*XMLHttpRequestEventTarget) OnLoad ¶
func (_this *XMLHttpRequestEventTarget) OnLoad() domcore.EventHandlerFunc
OnLoad returning attribute 'onload' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*XMLHttpRequestEventTarget) OnLoadEnd ¶
func (_this *XMLHttpRequestEventTarget) OnLoadEnd() domcore.EventHandlerFunc
OnLoadEnd returning attribute 'onloadend' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*XMLHttpRequestEventTarget) OnLoadStart ¶
func (_this *XMLHttpRequestEventTarget) OnLoadStart() domcore.EventHandlerFunc
OnLoadStart returning attribute 'onloadstart' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*XMLHttpRequestEventTarget) OnProgress ¶
func (_this *XMLHttpRequestEventTarget) OnProgress() domcore.EventHandlerFunc
OnProgress returning attribute 'onprogress' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*XMLHttpRequestEventTarget) OnTimeOut ¶
func (_this *XMLHttpRequestEventTarget) OnTimeOut() domcore.EventHandlerFunc
OnTimeOut returning attribute 'ontimeout' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*XMLHttpRequestEventTarget) SetOnAbort ¶
func (_this *XMLHttpRequestEventTarget) SetOnAbort(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
SetOnAbort is assigning a function to 'onabort'. This This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) SetOnError ¶
func (_this *XMLHttpRequestEventTarget) SetOnError(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
SetOnError is assigning a function to 'onerror'. This This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) SetOnLoad ¶
func (_this *XMLHttpRequestEventTarget) SetOnLoad(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
SetOnLoad is assigning a function to 'onload'. This This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) SetOnLoadEnd ¶
func (_this *XMLHttpRequestEventTarget) SetOnLoadEnd(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
SetOnLoadEnd is assigning a function to 'onloadend'. This This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) SetOnLoadStart ¶
func (_this *XMLHttpRequestEventTarget) SetOnLoadStart(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
SetOnLoadStart is assigning a function to 'onloadstart'. This This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) SetOnProgress ¶
func (_this *XMLHttpRequestEventTarget) SetOnProgress(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
SetOnProgress is assigning a function to 'onprogress'. This This method is returning allocated javascript function that need to be released.
func (*XMLHttpRequestEventTarget) SetOnTimeOut ¶
func (_this *XMLHttpRequestEventTarget) SetOnTimeOut(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func
SetOnTimeOut is assigning a function to 'ontimeout'. This This method is returning allocated javascript function that need to be released.
type XMLHttpRequestResponseType ¶
type XMLHttpRequestResponseType int
enum: XMLHttpRequestResponseType
const ( EmptyString0XMLHttpRequestResponseType XMLHttpRequestResponseType = iota ArraybufferXMLHttpRequestResponseType BlobXMLHttpRequestResponseType DocumentXMLHttpRequestResponseType JsonXMLHttpRequestResponseType TextXMLHttpRequestResponseType )
func XMLHttpRequestResponseTypeFromJS ¶
func XMLHttpRequestResponseTypeFromJS(value js.Value) XMLHttpRequestResponseType
XMLHttpRequestResponseTypeFromJS is converting a javascript value into a XMLHttpRequestResponseType enum value.
func (*XMLHttpRequestResponseType) JSValue ¶
func (this *XMLHttpRequestResponseType) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (XMLHttpRequestResponseType) Value ¶
func (this XMLHttpRequestResponseType) Value() string
Value is converting this into javascript defined string value
type XMLHttpRequestUpload ¶
type XMLHttpRequestUpload struct {
XMLHttpRequestEventTarget
}
class: XMLHttpRequestUpload
func XMLHttpRequestUploadFromJS ¶
func XMLHttpRequestUploadFromJS(value js.Value) *XMLHttpRequestUpload
XMLHttpRequestUploadFromJS is casting a js.Value into XMLHttpRequestUpload.
func XMLHttpRequestUploadFromWrapper ¶
func XMLHttpRequestUploadFromWrapper(input core.Wrapper) *XMLHttpRequestUpload
XMLHttpRequestUploadFromJS is casting from something that holds a js.Value into XMLHttpRequestUpload.