Documentation
¶
Index ¶
- func MessageTypeString(i int) string
- type Client
- func (o *Client) Cancel()
- func (o *Client) Close()
- func (o *Client) Connected() bool
- func (o *Client) Log() *ulog.Log
- func (o *Client) Run()
- func (o *Client) Running() bool
- func (o *Client) Send(messageType int, data []byte) error
- func (o *Client) SendBinary(data []byte) error
- func (o *Client) SendJson(v any) (err error)
- func (o *Client) SendText(data string) error
- func (o *Client) WithAppendPath(path string) *Client
- func (o *Client) WithBase(base string) *Client
- func (o *Client) WithLog(log *ulog.Log) *Client
- func (o *Client) WithOnBinaryMessage(f func([]byte))
- func (o *Client) WithOnCloseError(f func(error))
- func (o *Client) WithOnConnected(f func())
- func (o *Client) WithOnDial(f func(string))
- func (o *Client) WithOnDialDelay(f func() time.Duration)
- func (o *Client) WithOnDialError(f func(error) bool)
- func (o *Client) WithOnDisconnected(f func())
- func (o *Client) WithOnMessage(f func(int, []byte))
- func (o *Client) WithOnPing(f func())
- func (o *Client) WithOnPreDial(f func(string) string)
- func (o *Client) WithOnTextMessage(f func(string))
- func (o *Client) WithPath(path string) *Client
- func (o *Client) WithProxy(proxy string) *Client
- func (o *Client) WithProxyUrl(url *url.URL) *Client
- type Events
- type LogMessage
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MessageTypeString ¶ added in v0.2.37
Types ¶
type Client ¶
func (*Client) SendBinary ¶ added in v0.2.37
func (*Client) WithAppendPath ¶ added in v0.2.37
func (*Client) WithOnBinaryMessage ¶ added in v0.2.37
func (*Client) WithOnCloseError ¶ added in v0.2.37
func (*Client) WithOnConnected ¶ added in v0.2.37
func (o *Client) WithOnConnected(f func())
func (*Client) WithOnDial ¶ added in v0.2.37
func (*Client) WithOnDialDelay ¶ added in v0.7.33
func (*Client) WithOnDialError ¶ added in v0.2.37
func (*Client) WithOnDisconnected ¶ added in v0.2.37
func (o *Client) WithOnDisconnected(f func())
func (*Client) WithOnMessage ¶ added in v0.2.37
func (*Client) WithOnPing ¶ added in v0.2.38
func (o *Client) WithOnPing(f func())
func (*Client) WithOnPreDial ¶ added in v0.2.58
func (*Client) WithOnTextMessage ¶ added in v0.2.37
type Events ¶ added in v0.2.38
type Events struct {
OnPing func()
OnMessage func(int, []byte)
OnPreDial func(string) string
OnDial func(string)
OnDialDelay func() time.Duration
OnDialError func(error) bool
OnConnected func()
OnDisconnected func()
OnCloseError func(error)
}
func (*Events) SetOnBinaryMessage ¶ added in v0.2.38
func (*Events) SetOnTextMessage ¶ added in v0.2.38
type LogMessage ¶ added in v0.2.38
type Options ¶ added in v0.2.37
type Options struct {
Base string
Path string
Proxy *url.URL
InsecureSkipVerify bool
PingInterval time.Duration
ReDialInterval time.Duration
ReDialDelay time.Duration
HandshakeTimeout time.Duration
ReadTimeout time.Duration
SendTimeout time.Duration
LogSent LogMessage
LogRecv LogMessage
}
func (*Options) AppendPath ¶ added in v0.2.37
func (*Options) SetDefaultTimeouts ¶ added in v0.2.38
func (o *Options) SetDefaultTimeouts()
Click to show internal directories.
Click to hide internal directories.