Documentation
¶
Index ¶
- type Socket
- type WebsocketOption
- func WithConfigFile(filePath string) WebsocketOption
- func WithHeaders(headers http.Header) WebsocketOption
- func WithOnClose(f func(code int, reason string)) WebsocketOption
- func WithOnConnect(f func(socket *Socket)) WebsocketOption
- func WithOnError(f func(err error, socket *Socket)) WebsocketOption
- func WithOnMessage(f func(messageType int, data []byte, socket *Socket)) WebsocketOption
- func WithOnNoReconnect(f func(attemp int, socket *Socket)) WebsocketOption
- func WithOnPingReceived(f func(data string, socket *Socket)) WebsocketOption
- func WithOnPongReceived(f func(data string, socket *Socket)) WebsocketOption
- func WithOnReconnect(f func(attempt int, delay time.Duration, socket *Socket)) WebsocketOption
- func WithProxy(f func(*http.Request) (*url.URL, error)) WebsocketOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
func (*Socket) IsConnected ¶
type WebsocketOption ¶
type WebsocketOption func(s *Socket)
func WithConfigFile ¶
func WithConfigFile(filePath string) WebsocketOption
func WithHeaders ¶
func WithHeaders(headers http.Header) WebsocketOption
func WithOnClose ¶
func WithOnClose(f func(code int, reason string)) WebsocketOption
func WithOnConnect ¶
func WithOnConnect(f func(socket *Socket)) WebsocketOption
func WithOnError ¶
func WithOnError(f func(err error, socket *Socket)) WebsocketOption
func WithOnMessage ¶
func WithOnMessage(f func(messageType int, data []byte, socket *Socket)) WebsocketOption
func WithOnNoReconnect ¶
func WithOnNoReconnect(f func(attemp int, socket *Socket)) WebsocketOption
func WithOnPingReceived ¶
func WithOnPingReceived(f func(data string, socket *Socket)) WebsocketOption
func WithOnPongReceived ¶
func WithOnPongReceived(f func(data string, socket *Socket)) WebsocketOption
func WithOnReconnect ¶
func WithOnReconnect(f func(attempt int, delay time.Duration, socket *Socket)) WebsocketOption
Click to show internal directories.
Click to hide internal directories.