Documentation
¶
Index ¶
- type TAddress
- type TWSClient
- func (c *TWSClient) AddHeader(header http.Header)
- func (c *TWSClient) IsOnline() bool
- func (c *TWSClient) SendBinary(data []byte) error
- func (c *TWSClient) SendBinaryBlock(data []byte) error
- func (c *TWSClient) SendBinaryWithTimeout(data []byte, d time.Duration) error
- func (c *TWSClient) SendJSON(v interface{}) error
- func (c *TWSClient) SendJSONBlock(v interface{}) error
- func (c *TWSClient) SendJSONWithTimeout(v interface{}, d time.Duration) error
- func (c *TWSClient) SendText(data []byte) error
- func (c *TWSClient) SendTextBlock(data []byte) error
- func (c *TWSClient) SendTextWithTimeout(data []byte, d time.Duration) error
- func (c *TWSClient) SetProxyAddr(addr string)
- func (c *TWSClient) SetTimeOutHandShake(d time.Duration)
- func (c *TWSClient) SetTimeOutPing(t int64)
- func (c *TWSClient) SetTimeOutRetry(d time.Duration)
- func (c *TWSClient) SetTimeoutRead(d time.Duration)
- func (c *TWSClient) SetTimeoutWrite(d time.Duration)
- func (c *TWSClient) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TWSClient ¶
type TWSClient struct { // DoAfterOpenSuccess will be called after connect to server success. // If err != nil, will disconnect to the server. DoAfterOpenSuccess func(serverName string, curAddr *TAddress, conn *websocket.Conn) error ServerBinaryMsgChan chan []byte ServerTextMsgChan chan []byte // contains filtered or unexported fields }
TWSClient websocket client
func (*TWSClient) SendBinary ¶
SendBinary send binary data
func (*TWSClient) SendBinaryBlock ¶
SendBinaryBlock send binary data
func (*TWSClient) SendBinaryWithTimeout ¶
SendBinaryWithTimeout send binary data with timeout
func (*TWSClient) SendJSONBlock ¶
SendJSONBlock send json data
func (*TWSClient) SendJSONWithTimeout ¶
SendJSONWithTimeout send json data with timeout
func (*TWSClient) SendTextBlock ¶
SendTextBlock send text data
func (*TWSClient) SendTextWithTimeout ¶
SendTextWithTimeout send text data with timeout
func (*TWSClient) SetProxyAddr ¶
SetProxyAddr set proxy address
func (*TWSClient) SetTimeOutHandShake ¶
SetTimeOutHandShake set websocket connection handshake timeout.
func (*TWSClient) SetTimeOutPing ¶
SetTimeOutPing set websocket send ping period. c.pingPeriod must be smaller than c.pongWait
func (*TWSClient) SetTimeOutRetry ¶
SetTimeOutRetry set retry to connect to server timeout.
func (*TWSClient) SetTimeoutRead ¶
SetTimeoutRead set websocket read message timeout.
func (*TWSClient) SetTimeoutWrite ¶
SetTimeoutWrite set websocket write message timeout.