Documentation
¶
Index ¶
- type WebSocketClient
- func (ws *WebSocketClient) Connect(webSocketUrl string, attempts int, interval time.Duration, isReconnecting bool) (err error)
- func (ws *WebSocketClient) Disconnect(isReconnecting bool)
- func (ws *WebSocketClient) Reconnect(url string, attempts int, interval time.Duration) error
- func (ws *WebSocketClient) SendJSON(v any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WebSocketClient ¶
func NewWebSocketClient ¶
func NewWebSocketClient( onOpen func(ws *WebSocketClient, isReconnecting bool), onClose func(ws *WebSocketClient, isReconnecting bool), onMessage func(ws *WebSocketClient, payload []byte), ) *WebSocketClient
func (*WebSocketClient) Disconnect ¶
func (ws *WebSocketClient) Disconnect(isReconnecting bool)
func (*WebSocketClient) SendJSON ¶
func (ws *WebSocketClient) SendJSON(v any) error
Click to show internal directories.
Click to hide internal directories.