Documentation
¶
Index ¶
Constants ¶
View Source
const ( ErrorMessageType = "error" ChatMessageType = "chat" SubscribeMessageType = "subscribe" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRequest ¶
type ChatResponse ¶
type ISession ¶
type ISession interface {
WriteMessage(msg ChatResponse) error
ReadLoop()
Close() error
}
type Session ¶
type Session struct {
Id string
Conn net.Conn
Validator *validator.Validate
Log *zap.SugaredLogger
Authenticated bool
Claims MyClaims
OnMessageHandler func(session *Session, msg ChatRequest)
OnErrorHandler func(session *Session, err error)
OnClose func(session *Session)
}
func (*Session) WriteMessage ¶
func (s *Session) WriteMessage(msg ChatResponse) error
Click to show internal directories.
Click to hide internal directories.