Documentation ¶
Overview ¶
Package ws contains websocket operations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsUnexpectedCloseError ¶
IsUnexpectedCloseError returns true if the error is not a normal ws close error
Types ¶
type IUpgrader ¶
type IUpgrader interface {
Upgrade(w http.ResponseWriter, r *http.Request) (IWebsocket, error)
}
IUpgrader interface to encapsulate the websocket upgrade procedure
type IWebsocket ¶
type IWebsocket interface { SetReadDeadline(t time.Time) error SetReadLimit(int64) SetPongHandler(h func(appData string) error) ReadMessage() ([]byte, error) WriteMessage(data []byte) error WritePingMessage() error WriteCloseMessage() error Close() error }
IWebsocket represents a websocket
func Dial ¶
func Dial(url string) (IWebsocket, error)
Dial open a websocket connection to the given url
Click to show internal directories.
Click to hide internal directories.