Documentation ¶
Index ¶
- Constants
- type CloseHandler
- type DefaultSession
- func (s *DefaultSession) Close()
- func (s *DefaultSession) Done() <-chan struct{}
- func (s *DefaultSession) IsOK() bool
- func (s *DefaultSession) RemoteAddr() string
- func (s *DefaultSession) SendBinary(data []byte)
- func (s *DefaultSession) SendControl(messageType int, data []byte, deadline time.Time) error
- func (s *DefaultSession) SendJson(data interface{})
- func (s *DefaultSession) SendRaw(data []byte)
- func (s *DefaultSession) SetCloseHandler(closeHandler CloseHandler)
- func (s *DefaultSession) SetPingHandler(pingHandler PingHandler)
- func (s *DefaultSession) SetPongHandler(pongHandler PongHandler)
- func (s *DefaultSession) SetReadHandler(readHandler ReadHandler)
- func (s *DefaultSession) UpdateLastCommTime()
- type PingHandler
- type PongHandler
- type Pusher
- type ReadHandler
- type Session
Constants ¶
View Source
const ( INIT state = 0 CONNECTED state = 1 DISCONNECTED state = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultSession ¶
type DefaultSession struct {
// contains filtered or unexported fields
}
func NewDefaultServerSession ¶
func NewDefaultServerSession(ctx context.Context, writer http.ResponseWriter, req *http.Request) (*DefaultSession, error)
func (*DefaultSession) Close ¶
func (s *DefaultSession) Close()
func (*DefaultSession) Done ¶ added in v0.8.0
func (s *DefaultSession) Done() <-chan struct{}
func (*DefaultSession) IsOK ¶
func (s *DefaultSession) IsOK() bool
func (*DefaultSession) RemoteAddr ¶
func (s *DefaultSession) RemoteAddr() string
func (*DefaultSession) SendBinary ¶
func (s *DefaultSession) SendBinary(data []byte)
func (*DefaultSession) SendControl ¶
func (*DefaultSession) SendJson ¶
func (s *DefaultSession) SendJson(data interface{})
func (*DefaultSession) SendRaw ¶ added in v0.8.0
func (s *DefaultSession) SendRaw(data []byte)
func (*DefaultSession) SetCloseHandler ¶
func (s *DefaultSession) SetCloseHandler(closeHandler CloseHandler)
func (*DefaultSession) SetPingHandler ¶
func (s *DefaultSession) SetPingHandler(pingHandler PingHandler)
func (*DefaultSession) SetPongHandler ¶
func (s *DefaultSession) SetPongHandler(pongHandler PongHandler)
func (*DefaultSession) SetReadHandler ¶
func (s *DefaultSession) SetReadHandler(readHandler ReadHandler)
func (*DefaultSession) UpdateLastCommTime ¶
func (s *DefaultSession) UpdateLastCommTime()
type Pusher ¶
type Pusher struct {
// contains filtered or unexported fields
}
type Session ¶
type Session interface { SetPingHandler(pingHandler PingHandler) SetPongHandler(pongHandler PongHandler) SetCloseHandler(closeHandler CloseHandler) SendJson(data interface{}) SendRaw(data []byte) SendBinary(data []byte) SendControl(messageType int, data []byte, deadline time.Time) error RemoteAddr() string IsOK() bool Close() Done() <-chan struct{} }
Click to show internal directories.
Click to hide internal directories.