Documentation
¶
Index ¶
- Constants
- Variables
- type CloseError
- type Connection
- func (wsc *Connection) Close()
- func (wsc *Connection) GetMessage() (message string, err error)
- func (wsc *Connection) GetProtocol() int
- func (wsc *Connection) GetReadBytes() int
- func (wsc *Connection) GetUseBinaryMessage() bool
- func (wsc *Connection) GetWriteBytes() int
- func (wsc *Connection) LocalAddr() net.Addr
- func (wsc *Connection) PingParams() (interval, timeout time.Duration)
- func (wsc *Connection) RemoteAddr() net.Addr
- func (wsc *Connection) WriteMessage(message interface{}) error
- type Cors
- type Transport
Constants ¶
View Source
const ( WsDefaultPingInterval = 30 * time.Second WsDefaultPingTimeout = 60 * time.Second WsDefaultReceiveTimeout = 60 * time.Second WsDefaultSendTimeout = 60 * time.Second WsDefaultBufferSize = 1024 * 32 )
View Source
const ( DecodeErrCode = 102 ParseOpenMsgCode = 103 QueueBufferSizeCode = 104 WriteBufferErrCode = 105 BinaryMsgErrCode = 106 BadBufferErrCode = 107 PacketWrongErrCode = 108 )
Variables ¶
View Source
var ( ErrorBinaryMessage = errors.New("binary messages are not supported") ErrorBadBuffer = errors.New("buffer error") ErrorPacketWrong = errors.New("wrong packet type error") ErrorMethodNotAllowed = errors.New("method not allowed") ErrorHttpUpgradeFailed = errors.New("http upgrade failed") )
Functions ¶
This section is empty.
Types ¶
type CloseError ¶
type CloseError struct {
websocket.CloseError
}
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Close ¶
func (wsc *Connection) Close()
func (*Connection) GetMessage ¶
func (wsc *Connection) GetMessage() (message string, err error)
func (*Connection) GetProtocol ¶
func (wsc *Connection) GetProtocol() int
func (*Connection) GetReadBytes ¶
func (wsc *Connection) GetReadBytes() int
func (*Connection) GetUseBinaryMessage ¶
func (wsc *Connection) GetUseBinaryMessage() bool
func (*Connection) GetWriteBytes ¶
func (wsc *Connection) GetWriteBytes() int
func (*Connection) LocalAddr ¶
func (wsc *Connection) LocalAddr() net.Addr
func (*Connection) PingParams ¶
func (wsc *Connection) PingParams() (interval, timeout time.Duration)
func (*Connection) RemoteAddr ¶
func (wsc *Connection) RemoteAddr() net.Addr
func (*Connection) WriteMessage ¶
func (wsc *Connection) WriteMessage(message interface{}) error
type Transport ¶
type Transport struct { PingInterval time.Duration PingTimeout time.Duration ReceiveTimeout time.Duration SendTimeout time.Duration Protocol int BufferSize int BinaryMessage bool UnsecureTLS bool TLSConfig *tls.Config RequestHeader http.Header Cors Cors }
func GetDefaultWebsocketTransport ¶
func GetDefaultWebsocketTransport() *Transport
* Returns websocket connection with default params
func (*Transport) HandleConnection ¶
func (wst *Transport) HandleConnection( w http.ResponseWriter, r *http.Request) (conn *Connection, err error)
Click to show internal directories.
Click to hide internal directories.