fix documentation
This commit is contained in:
@@ -58,7 +58,7 @@ func (m *Melody) HandleMessage(fn func(*Session, []byte)) {
|
||||
}
|
||||
|
||||
// Fires when a session has an error.
|
||||
func (m *Melody) HandleError(fn handleErrorFunc) {
|
||||
func (m *Melody) HandleError(fn func(*Session, error)) {
|
||||
m.errorHandler = fn
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -83,12 +83,12 @@ func (s *Session) readPump(messageHandler handleMessageFunc, errorHandler handle
|
||||
}
|
||||
}
|
||||
|
||||
// Write a message to session.
|
||||
// Write message to session.
|
||||
func (s *Session) Write(msg []byte) {
|
||||
s.writeMessage(&envelope{t: websocket.TextMessage, msg: msg})
|
||||
}
|
||||
|
||||
// Close a session.
|
||||
// Close session.
|
||||
func (s *Session) Close() {
|
||||
s.writeMessage(&envelope{t: websocket.CloseMessage, msg: []byte{}})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user