Documentation
¶
Rendered for js/wasm
Index ¶
Constants ¶
View Source
const ( WsConnecting = 0 WsOpen = 1 WsClosing = 2 WsClosed = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MsgCallBack ¶ added in v0.0.3
type Promise ¶
type Promise struct {
// contains filtered or unexported fields
}
Promise implement js.Promise
func NewPromise ¶
func NewPromise() *Promise
type WebSocket ¶
type WebSocket struct {
// contains filtered or unexported fields
}
WebSocket represent ws JavaScript adapter https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
func NewWebSocket ¶ added in v0.0.2
func NewWebSocket(host string, reconnect bool, cb MsgCallBack) *WebSocket
NewWebSocket create JS WebSocket adapter @host - URI with wss:// or ws:// format @reconnect - enable reconnection operation during close connection or during send attempt to closed connection
func (*WebSocket) Connect ¶ added in v0.0.2
Connect evaluate connection operation to provided host @return JS Promise where would be send connection result
func (*WebSocket) ReadyState ¶
Click to show internal directories.
Click to hide internal directories.