Versions in this module Expand all Collapse all v1 v1.0.0 Jul 10, 2020 Changes in this version + const CloseAbnormalClosure + const CloseGoingAway + const CloseInternalServerErr + const CloseInvalidFramePayloadData + const CloseMandatoryExtension + const CloseMessageTooBig + const CloseNoStatusReceived + const CloseNormalClosure + const ClosePolicyViolation + const CloseProtocolError + const CloseServiceRestart + const CloseTLSHandshake + const CloseTryAgainLater + const CloseUnsupportedData + func FormatCloseMessage(closeCode int, text string) []byte + type Config struct + MaxMessageSize int64 + MessageBufferSize int + PingPeriod time.Duration + PongWait time.Duration + WriteWait time.Duration + type Melody struct + Config *Config + Upgrader *websocket.Upgrader + func New() *Melody + func (m *Melody) Broadcast(msg []byte) error + func (m *Melody) BroadcastBinary(msg []byte) error + func (m *Melody) BroadcastBinaryFilter(msg []byte, fn func(*Session) bool) error + func (m *Melody) BroadcastBinaryOthers(msg []byte, s *Session) error + func (m *Melody) BroadcastFilter(msg []byte, fn func(*Session) bool) error + func (m *Melody) BroadcastMultiple(msg []byte, sessions []*Session) error + func (m *Melody) BroadcastOthers(msg []byte, s *Session) error + func (m *Melody) Close() error + func (m *Melody) CloseWithMsg(msg []byte) error + func (m *Melody) HandleClose(fn func(*Session, int, string) error) + func (m *Melody) HandleConnect(fn func(*Session)) + func (m *Melody) HandleDisconnect(fn func(*Session)) + func (m *Melody) HandleError(fn func(*Session, error)) + func (m *Melody) HandleMessage(fn func(*Session, []byte)) + func (m *Melody) HandleMessageBinary(fn func(*Session, []byte)) + func (m *Melody) HandlePong(fn func(*Session)) + func (m *Melody) HandleRequest(w http.ResponseWriter, r *http.Request) error + func (m *Melody) HandleRequestWithKeys(w http.ResponseWriter, r *http.Request, keys map[string]interface{}) error + func (m *Melody) HandleSentMessage(fn func(*Session, []byte)) + func (m *Melody) HandleSentMessageBinary(fn func(*Session, []byte)) + func (m *Melody) IsClosed() bool + func (m *Melody) Len() int + type Session struct + Conn *websocket.Conn + Melody *Melody + Request *http.Request + func (s *Session) Close() error + func (s *Session) CloseWithErr(err error) error + func (s *Session) CloseWithMsg(msg []byte) error + func (s *Session) Deadline() (deadline time.Time, ok bool) + func (s *Session) Done() <-chan struct{} + func (s *Session) Err() error + func (s *Session) Get(key string) (value interface{}, exists bool) + func (s *Session) IsClosed() bool + func (s *Session) MustGet(key string) interface{} + func (s *Session) Set(key string, value interface{}) + func (s *Session) Value(key interface{}) interface{} + func (s *Session) Write(msg []byte) error + func (s *Session) WriteBinary(msg []byte) error