Documentation ¶
Index ¶
- Variables
- type Logger
- type NoopLogger
- type ReConn
- func (r *ReConn) Close() error
- func (r *ReConn) Dial() error
- func (r *ReConn) GetDialBody() []byte
- func (r *ReConn) ReadMessage() (messageType int, data []byte, readErr error)
- func (r *ReConn) SetHandshakeTimeout(d time.Duration) *ReConn
- func (r *ReConn) SetLogger(log Logger) *ReConn
- func (r *ReConn) SetReconnectTimeout(d time.Duration) *ReConn
- func (r *ReConn) SetSubscribeHandler(f SubscribeHandler) *ReConn
- func (r *ReConn) SetURL(url string) *ReConn
- func (r *ReConn) WriteMessage(messageType int, data []byte) error
- type SubscribeHandler
- type WsConnection
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotDialed = errors.New("method 'Dial' wasn't called") ErrAlreadyDialed = errors.New("method 'Dial' was already called") ErrNotConnected = errors.New("not connected") // ErrDial is used when 'websocket.Dial' returns an error ErrDial = errors.New("dial error") // ErrSubscribe is used when subscribe handler returns an error ErrSubscribe = errors.New("subscribe error") // ErrReconnect is used when reconnection wasn't successful ErrReconnect = errors.New("reconnect error") )
Functions ¶
This section is empty.
Types ¶
type NoopLogger ¶
type NoopLogger struct{}
func (NoopLogger) Debug ¶
func (NoopLogger) Debug(msg string)
func (NoopLogger) Error ¶
func (NoopLogger) Error(msg string)
func (NoopLogger) Info ¶
func (NoopLogger) Info(msg string)
type ReConn ¶
type ReConn struct {
// contains filtered or unexported fields
}
func New ¶
func New() *ReConn
New creates a new instance of 'ReConn'. To set url, timeouts and etc. use methods 'Set...'
func (*ReConn) GetDialBody ¶
func (*ReConn) ReadMessage ¶
func (*ReConn) SetHandshakeTimeout ¶
SetHandshakeTimeout sets handshake timeout. After 'Dial' call it does nothing
func (*ReConn) SetReconnectTimeout ¶
SetReconnectTimeout sets reconnect timeout. After 'Dial' call it does nothing
func (*ReConn) SetSubscribeHandler ¶
func (r *ReConn) SetSubscribeHandler(f SubscribeHandler) *ReConn
SetSubscribeHandler sets subscribe handler. After 'Dial' call it does nothing
type SubscribeHandler ¶
type SubscribeHandler func(WsConnection) error
Click to show internal directories.
Click to hide internal directories.