Documentation ¶
Overview ¶
Package channel is websocket and communication between different pages.
Source: HTML Standard (https://html.spec.whatwg.org/)
Index ¶
- Constants
- type BinaryType
- type BroadcastChannel
- func (_this *BroadcastChannel) AddEventMessage(listener func(event *MessageEvent, currentTarget *BroadcastChannel)) js.Func
- func (_this *BroadcastChannel) AddEventMessageError(listener func(event *MessageEvent, currentTarget *BroadcastChannel)) js.Func
- func (_this *BroadcastChannel) Close()
- func (_this *BroadcastChannel) Name() string
- func (_this *BroadcastChannel) OnMessage() domcore.EventHandlerFunc
- func (_this *BroadcastChannel) OnMessageError() domcore.EventHandlerFunc
- func (_this *BroadcastChannel) PostMessage(message interface{})
- func (_this *BroadcastChannel) SetOnMessage(listener func(event *MessageEvent, currentTarget *BroadcastChannel)) js.Func
- func (_this *BroadcastChannel) SetOnMessageError(listener func(event *MessageEvent, currentTarget *BroadcastChannel)) js.Func
- type CloseEvent
- type CloseEventInit
- type MessageChannel
- type MessageEvent
- func (_this *MessageEvent) Data() js.Value
- func (_this *MessageEvent) InitMessageEvent(_type string, bubbles *bool, cancelable *bool, data interface{}, ...)
- func (_this *MessageEvent) LastEventId() string
- func (_this *MessageEvent) Origin() string
- func (_this *MessageEvent) Ports() *javascript.FrozenArray
- func (_this *MessageEvent) Source() *Union
- type MessageEventInit
- type MessagePort
- func (_this *MessagePort) AddEventMessage(listener func(event *MessageEvent, currentTarget *MessagePort)) js.Func
- func (_this *MessagePort) AddEventMessageError(listener func(event *MessageEvent, currentTarget *MessagePort)) js.Func
- func (_this *MessagePort) Close()
- func (_this *MessagePort) OnMessage() domcore.EventHandlerFunc
- func (_this *MessagePort) OnMessageError() domcore.EventHandlerFunc
- func (_this *MessagePort) PostMessage(message interface{}, transfer []*javascript.Object)
- func (_this *MessagePort) PostMessage2(message interface{}, options *PostMessageOptions)
- func (_this *MessagePort) SetOnMessage(listener func(event *MessageEvent, currentTarget *MessagePort)) js.Func
- func (_this *MessagePort) SetOnMessageError(listener func(event *MessageEvent, currentTarget *MessagePort)) js.Func
- func (_this *MessagePort) Start()
- type PostMessageOptions
- type Union
- type WebSocket
- func (_this *WebSocket) AddEventClose(listener func(event *CloseEvent, currentTarget *WebSocket)) js.Func
- func (_this *WebSocket) AddEventError(listener func(event *domcore.Event, currentTarget *WebSocket)) js.Func
- func (_this *WebSocket) AddEventMessage(listener func(event *MessageEvent, currentTarget *WebSocket)) js.Func
- func (_this *WebSocket) AddEventOpen(listener func(event *domcore.Event, currentTarget *WebSocket)) js.Func
- func (_this *WebSocket) BinaryType() BinaryType
- func (_this *WebSocket) BufferedAmount() int
- func (_this *WebSocket) Close(code *int, reason *string)
- func (_this *WebSocket) Extensions() string
- func (_this *WebSocket) OnClose() domcore.EventHandlerFunc
- func (_this *WebSocket) OnError() domcore.EventHandlerFunc
- func (_this *WebSocket) OnMessage() domcore.EventHandlerFunc
- func (_this *WebSocket) OnOpen() domcore.EventHandlerFunc
- func (_this *WebSocket) Protocol() string
- func (_this *WebSocket) ReadyState() int
- func (_this *WebSocket) Send(data string)
- func (_this *WebSocket) Send2(data *file.Blob)
- func (_this *WebSocket) Send3(data *javascript.ArrayBuffer)
- func (_this *WebSocket) Send4(data *Union)
- func (_this *WebSocket) SetBinaryType(value BinaryType)
- func (_this *WebSocket) SetOnClose(listener func(event *CloseEvent, currentTarget *WebSocket)) js.Func
- func (_this *WebSocket) SetOnError(listener func(event *domcore.Event, currentTarget *WebSocket)) js.Func
- func (_this *WebSocket) SetOnMessage(listener func(event *MessageEvent, currentTarget *WebSocket)) js.Func
- func (_this *WebSocket) SetOnOpen(listener func(event *domcore.Event, currentTarget *WebSocket)) js.Func
- func (_this *WebSocket) Url() string
Constants ¶
const ( CONNECTING int = 0 OPEN int = 1 CLOSING int = 2 CLOSED int = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryType ¶
type BinaryType int
enum: BinaryType
const ( Blob BinaryType = iota Arraybuffer )
func BinaryTypeFromJS ¶
func BinaryTypeFromJS(value js.Value) BinaryType
BinaryTypeFromJS is converting a javascript value into a BinaryType enum value.
func (*BinaryType) JSValue ¶
func (this *BinaryType) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (BinaryType) Value ¶
func (this BinaryType) Value() string
Value is converting this into javascript defined string value
type BroadcastChannel ¶
type BroadcastChannel struct {
domcore.EventTarget
}
class: BroadcastChannel
func BroadcastChannelFromJS ¶
func BroadcastChannelFromJS(value js.Wrapper) *BroadcastChannel
BroadcastChannelFromJS is casting a js.Wrapper into BroadcastChannel.
func NewBroadcastChannel ¶
func NewBroadcastChannel(name string) (_result *BroadcastChannel)
func (*BroadcastChannel) AddEventMessage ¶
func (_this *BroadcastChannel) AddEventMessage(listener func(event *MessageEvent, currentTarget *BroadcastChannel)) js.Func
AddMessage is adding doing AddEventListener for 'Message' on target. This method is returning allocated javascript function that need to be released.
func (*BroadcastChannel) AddEventMessageError ¶
func (_this *BroadcastChannel) AddEventMessageError(listener func(event *MessageEvent, currentTarget *BroadcastChannel)) js.Func
AddMessageError is adding doing AddEventListener for 'MessageError' on target. This method is returning allocated javascript function that need to be released.
func (*BroadcastChannel) Close ¶
func (_this *BroadcastChannel) Close()
func (*BroadcastChannel) Name ¶
func (_this *BroadcastChannel) Name() string
Name returning attribute 'name' with type string (idl: DOMString).
func (*BroadcastChannel) OnMessage ¶
func (_this *BroadcastChannel) OnMessage() domcore.EventHandlerFunc
OnMessage returning attribute 'onmessage' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*BroadcastChannel) OnMessageError ¶
func (_this *BroadcastChannel) OnMessageError() domcore.EventHandlerFunc
OnMessageError returning attribute 'onmessageerror' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*BroadcastChannel) PostMessage ¶
func (_this *BroadcastChannel) PostMessage(message interface{})
func (*BroadcastChannel) SetOnMessage ¶
func (_this *BroadcastChannel) SetOnMessage(listener func(event *MessageEvent, currentTarget *BroadcastChannel)) js.Func
SetOnMessage is assigning a function to 'onmessage'. This This method is returning allocated javascript function that need to be released.
func (*BroadcastChannel) SetOnMessageError ¶
func (_this *BroadcastChannel) SetOnMessageError(listener func(event *MessageEvent, currentTarget *BroadcastChannel)) js.Func
SetOnMessageError is assigning a function to 'onmessageerror'. This This method is returning allocated javascript function that need to be released.
type CloseEvent ¶
class: CloseEvent
func CloseEventFromJS ¶
func CloseEventFromJS(value js.Wrapper) *CloseEvent
CloseEventFromJS is casting a js.Wrapper into CloseEvent.
func NewCloseEvent ¶
func NewCloseEvent(_type string, eventInitDict *CloseEventInit) (_result *CloseEvent)
func (*CloseEvent) Code ¶
func (_this *CloseEvent) Code() int
Code returning attribute 'code' with type int (idl: unsigned short).
func (*CloseEvent) Reason ¶
func (_this *CloseEvent) Reason() string
Reason returning attribute 'reason' with type string (idl: USVString).
func (*CloseEvent) WasClean ¶
func (_this *CloseEvent) WasClean() bool
WasClean returning attribute 'wasClean' with type bool (idl: boolean).
type CloseEventInit ¶
type CloseEventInit struct { Bubbles bool Cancelable bool Composed bool WasClean bool Code int Reason string }
dictionary: CloseEventInit
func CloseEventInitFromJS ¶
func CloseEventInitFromJS(value js.Wrapper) *CloseEventInit
CloseEventInitFromJS is allocating a new CloseEventInit object and copy all values from input javascript object
func (*CloseEventInit) JSValue ¶
func (_this *CloseEventInit) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type MessageChannel ¶
type MessageChannel struct { // Value_JS holds a reference to a javascript value Value_JS js.Value }
class: MessageChannel
func MessageChannelFromJS ¶
func MessageChannelFromJS(value js.Wrapper) *MessageChannel
MessageChannelFromJS is casting a js.Wrapper into MessageChannel.
func NewMessageChannel ¶
func NewMessageChannel() (_result *MessageChannel)
func (*MessageChannel) JSValue ¶
func (_this *MessageChannel) JSValue() js.Value
func (*MessageChannel) Port1 ¶
func (_this *MessageChannel) Port1() *MessagePort
Port1 returning attribute 'port1' with type MessagePort (idl: MessagePort).
func (*MessageChannel) Port2 ¶
func (_this *MessageChannel) Port2() *MessagePort
Port2 returning attribute 'port2' with type MessagePort (idl: MessagePort).
type MessageEvent ¶
class: MessageEvent
func MessageEventFromJS ¶
func MessageEventFromJS(value js.Wrapper) *MessageEvent
MessageEventFromJS is casting a js.Wrapper into MessageEvent.
func NewMessageEvent ¶
func NewMessageEvent(_type string, eventInitDict *MessageEventInit) (_result *MessageEvent)
func (*MessageEvent) Data ¶
func (_this *MessageEvent) Data() js.Value
Data returning attribute 'data' with type Any (idl: any).
func (*MessageEvent) InitMessageEvent ¶
func (_this *MessageEvent) InitMessageEvent(_type string, bubbles *bool, cancelable *bool, data interface{}, origin *string, lastEventId *string, source *Union, ports []*MessagePort)
func (*MessageEvent) LastEventId ¶
func (_this *MessageEvent) LastEventId() string
LastEventId returning attribute 'lastEventId' with type string (idl: DOMString).
func (*MessageEvent) Origin ¶
func (_this *MessageEvent) Origin() string
Origin returning attribute 'origin' with type string (idl: USVString).
func (*MessageEvent) Ports ¶
func (_this *MessageEvent) Ports() *javascript.FrozenArray
Ports returning attribute 'ports' with type javascript.FrozenArray (idl: FrozenArray).
func (*MessageEvent) Source ¶
func (_this *MessageEvent) Source() *Union
Source returning attribute 'source' with type Union (idl: Union).
type MessageEventInit ¶
type MessageEventInit struct { Bubbles bool Cancelable bool Composed bool Data js.Value Origin string LastEventId string Source *Union Ports []*MessagePort }
dictionary: MessageEventInit
func MessageEventInitFromJS ¶
func MessageEventInitFromJS(value js.Wrapper) *MessageEventInit
MessageEventInitFromJS is allocating a new MessageEventInit object and copy all values from input javascript object
func (*MessageEventInit) JSValue ¶
func (_this *MessageEventInit) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type MessagePort ¶
type MessagePort struct {
domcore.EventTarget
}
class: MessagePort
func MessagePortFromJS ¶
func MessagePortFromJS(value js.Wrapper) *MessagePort
MessagePortFromJS is casting a js.Wrapper into MessagePort.
func (*MessagePort) AddEventMessage ¶
func (_this *MessagePort) AddEventMessage(listener func(event *MessageEvent, currentTarget *MessagePort)) js.Func
AddMessage is adding doing AddEventListener for 'Message' on target. This method is returning allocated javascript function that need to be released.
func (*MessagePort) AddEventMessageError ¶
func (_this *MessagePort) AddEventMessageError(listener func(event *MessageEvent, currentTarget *MessagePort)) js.Func
AddMessageError is adding doing AddEventListener for 'MessageError' on target. This method is returning allocated javascript function that need to be released.
func (*MessagePort) Close ¶
func (_this *MessagePort) Close()
func (*MessagePort) OnMessage ¶
func (_this *MessagePort) OnMessage() domcore.EventHandlerFunc
OnMessage returning attribute 'onmessage' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*MessagePort) OnMessageError ¶
func (_this *MessagePort) OnMessageError() domcore.EventHandlerFunc
OnMessageError returning attribute 'onmessageerror' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*MessagePort) PostMessage ¶
func (_this *MessagePort) PostMessage(message interface{}, transfer []*javascript.Object)
func (*MessagePort) PostMessage2 ¶
func (_this *MessagePort) PostMessage2(message interface{}, options *PostMessageOptions)
func (*MessagePort) SetOnMessage ¶
func (_this *MessagePort) SetOnMessage(listener func(event *MessageEvent, currentTarget *MessagePort)) js.Func
SetOnMessage is assigning a function to 'onmessage'. This This method is returning allocated javascript function that need to be released.
func (*MessagePort) SetOnMessageError ¶
func (_this *MessagePort) SetOnMessageError(listener func(event *MessageEvent, currentTarget *MessagePort)) js.Func
SetOnMessageError is assigning a function to 'onmessageerror'. This This method is returning allocated javascript function that need to be released.
func (*MessagePort) Start ¶
func (_this *MessagePort) Start()
type PostMessageOptions ¶
type PostMessageOptions struct {
Transfer []*javascript.Object
}
dictionary: PostMessageOptions
func PostMessageOptionsFromJS ¶
func PostMessageOptionsFromJS(value js.Wrapper) *PostMessageOptions
PostMessageOptionsFromJS is allocating a new PostMessageOptions object and copy all values from input javascript object
func (*PostMessageOptions) JSValue ¶
func (_this *PostMessageOptions) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type Union ¶
func UnionFromJS ¶
type WebSocket ¶
type WebSocket struct {
domcore.EventTarget
}
class: WebSocket
func NewWebSocket ¶
func WebSocketFromJS ¶
WebSocketFromJS is casting a js.Wrapper into WebSocket.
func (*WebSocket) AddEventClose ¶
func (_this *WebSocket) AddEventClose(listener func(event *CloseEvent, currentTarget *WebSocket)) js.Func
AddClose is adding doing AddEventListener for 'Close' on target. This method is returning allocated javascript function that need to be released.
func (*WebSocket) AddEventError ¶
func (_this *WebSocket) AddEventError(listener func(event *domcore.Event, currentTarget *WebSocket)) js.Func
AddError is adding doing AddEventListener for 'Error' on target. This method is returning allocated javascript function that need to be released.
func (*WebSocket) AddEventMessage ¶
func (_this *WebSocket) AddEventMessage(listener func(event *MessageEvent, currentTarget *WebSocket)) js.Func
AddMessage is adding doing AddEventListener for 'Message' on target. This method is returning allocated javascript function that need to be released.
func (*WebSocket) AddEventOpen ¶
func (_this *WebSocket) AddEventOpen(listener func(event *domcore.Event, currentTarget *WebSocket)) js.Func
AddOpen is adding doing AddEventListener for 'Open' on target. This method is returning allocated javascript function that need to be released.
func (*WebSocket) BinaryType ¶
func (_this *WebSocket) BinaryType() BinaryType
BinaryType returning attribute 'binaryType' with type BinaryType (idl: BinaryType).
func (*WebSocket) BufferedAmount ¶
BufferedAmount returning attribute 'bufferedAmount' with type int (idl: unsigned long long).
func (*WebSocket) Extensions ¶
Extensions returning attribute 'extensions' with type string (idl: DOMString).
func (*WebSocket) OnClose ¶
func (_this *WebSocket) OnClose() domcore.EventHandlerFunc
OnClose returning attribute 'onclose' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*WebSocket) OnError ¶
func (_this *WebSocket) OnError() domcore.EventHandlerFunc
OnError returning attribute 'onerror' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*WebSocket) OnMessage ¶
func (_this *WebSocket) OnMessage() domcore.EventHandlerFunc
OnMessage returning attribute 'onmessage' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*WebSocket) OnOpen ¶
func (_this *WebSocket) OnOpen() domcore.EventHandlerFunc
OnOpen returning attribute 'onopen' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*WebSocket) Protocol ¶
Protocol returning attribute 'protocol' with type string (idl: DOMString).
func (*WebSocket) ReadyState ¶
ReadyState returning attribute 'readyState' with type int (idl: unsigned short).
func (*WebSocket) Send3 ¶
func (_this *WebSocket) Send3(data *javascript.ArrayBuffer)
func (*WebSocket) SetBinaryType ¶
func (_this *WebSocket) SetBinaryType(value BinaryType)
SetBinaryType setting attribute 'binaryType' with type BinaryType (idl: BinaryType).
func (*WebSocket) SetOnClose ¶
func (_this *WebSocket) SetOnClose(listener func(event *CloseEvent, currentTarget *WebSocket)) js.Func
SetOnClose is assigning a function to 'onclose'. This This method is returning allocated javascript function that need to be released.
func (*WebSocket) SetOnError ¶
func (_this *WebSocket) SetOnError(listener func(event *domcore.Event, currentTarget *WebSocket)) js.Func
SetOnError is assigning a function to 'onerror'. This This method is returning allocated javascript function that need to be released.
func (*WebSocket) SetOnMessage ¶
func (_this *WebSocket) SetOnMessage(listener func(event *MessageEvent, currentTarget *WebSocket)) js.Func
SetOnMessage is assigning a function to 'onmessage'. This This method is returning allocated javascript function that need to be released.