Versions in this module Expand all Collapse all v0 v0.1.1 Mar 22, 2026 v0.1.0 Mar 22, 2026 Changes in this version + type Action func(conn *Conn, messageType int, payload []byte) error + type Conn struct + func (c *Conn) Close() error + func (c *Conn) CloseWithCode(code int, reason string) error + func (c *Conn) DropConnection() error + func (c *Conn) SendBinary(data []byte) error + func (c *Conn) SendJSON(v any) error + func (c *Conn) SendMessage(msg string) error + type Expectation struct + func (e *Expectation) AnyTimes() *Expectation + func (e *Expectation) CloseWithCode(code int, reason string) *Expectation + func (e *Expectation) Delay(d time.Duration) *Expectation + func (e *Expectation) DropConnection() *Expectation + func (e *Expectation) Once() *Expectation + func (e *Expectation) Reply(msg string) *Expectation + func (e *Expectation) ReplyBinary(data []byte) *Expectation + func (e *Expectation) ReplyJSON(v any) *Expectation + func (e *Expectation) Times(n int) *Expectation + type Matcher func(messageType int, payload []byte) bool + type Option func(*Server) + func WithCheckOrigin(check func(r *http.Request) bool) Option + type ReceivedMessage struct + Payload []byte + Timestamp time.Time + Type int + func (m ReceivedMessage) JSON(target any) error + func (m ReceivedMessage) Text() string + type Server struct + func NewServer(t testing.TB, opts ...Option) *Server + func (s *Server) AssertExpectationsMet() + func (s *Server) AssertReceived(expected string) + func (s *Server) AssertReceivedCount(expectedCount int) + func (s *Server) AssertReceivedJSON(expected any) + func (s *Server) Broadcast(msg string) + func (s *Server) BroadcastJSON(v any) error + func (s *Server) ClientCount() int + func (s *Server) Close() + func (s *Server) Connections() []*Conn + func (s *Server) ExpectBinary(data []byte) *Expectation + func (s *Server) ExpectCustom(matcher Matcher, desc string) *Expectation + func (s *Server) ExpectJSON(v any) *Expectation + func (s *Server) ExpectMessage(msg string) *Expectation + func (s *Server) OnConnect(fn func(*Conn)) *Server + func (s *Server) OnDisconnect(fn func(*Conn)) *Server + func (s *Server) ReceivedMessages() []ReceivedMessage + func (s *Server) URL() string + func (s *Server) WaitMessages(count int, timeout time.Duration) error