Versions in this module Expand all Collapse all v0 v0.1.0 Feb 4, 2023 v0.0.1 Sep 24, 2022 Changes in this version + const BinaryMessage + const CloseAbnormalClosure + const CloseGoingAway + const CloseInternalServerErr + const CloseInvalidFramePayloadData + const CloseMandatoryExtension + const CloseMessage + const CloseMessageTooBig + const CloseNoStatusReceived + const CloseNormalClosure + const ClosePolicyViolation + const CloseProtocolError + const CloseServiceRestart + const CloseTLSHandshake + const CloseTryAgainLater + const CloseUnsupportedData + const PingMessage + const PongMessage + const TextMessage + var ErrCloseSent = errors.New("websocket: close sent") + var ErrReadLimit = errors.New("websocket: read limit exceeded") + func FormatCloseMessage(closeCode int, text string) []byte + func IsCloseError(err error, codes ...int) bool + func IsUnexpectedCloseError(err error, expectedCodes ...int) bool + type BufferPool interface + Get func() interface{} + Put func(interface{}) + type CloseError struct + Code int + Text string + func (e *CloseError) Error() string + type Conn struct + func (c *Conn) Close() error + func (c *Conn) CloseHandler() func(code int, text string) error + func (c *Conn) EnableWriteCompression(enable bool) + func (c *Conn) LocalAddr() net.Addr + func (c *Conn) NetConn() net.Conn + func (c *Conn) NextReader() (messageType int, r io.Reader, err error) + func (c *Conn) NextWriter(messageType int) (io.WriteCloser, error) + func (c *Conn) PingHandler() func(appData string) error + func (c *Conn) PongHandler() func(appData string) error + func (c *Conn) ReadJSON(v interface{}) error + func (c *Conn) ReadMessage() (messageType int, p []byte, err error) + func (c *Conn) RemoteAddr() net.Addr + func (c *Conn) SetCloseHandler(h func(code int, text string) error) + func (c *Conn) SetCompressionLevel(level int) error + func (c *Conn) SetPingHandler(h func(appData string) error) + func (c *Conn) SetPongHandler(h func(appData string) error) + func (c *Conn) SetReadDeadline(t time.Time) error + func (c *Conn) SetReadLimit(limit int64) + func (c *Conn) SetWriteDeadline(t time.Time) error + func (c *Conn) Subprotocol() string + func (c *Conn) UnderlyingConn() net.Conn + func (c *Conn) WriteControl(messageType int, data []byte, deadline time.Time) error + func (c *Conn) WriteJSON(v interface{}) error + func (c *Conn) WriteMessage(messageType int, data []byte) error + func (c *Conn) WritePreparedMessage(pm *PreparedMessage) error + type HandshakeError struct + func (e HandshakeError) Error() string + type HertzHandler func(*Conn) + type HertzUpgrader struct + CheckOrigin func(ctx *app.RequestContext) bool + EnableCompression bool + Error func(ctx *app.RequestContext, status int, reason error) + HandshakeTimeout time.Duration + ReadBufferSize int + Subprotocols []string + WriteBufferPool BufferPool + WriteBufferSize int + func (u *HertzUpgrader) Upgrade(ctx *app.RequestContext, handler HertzHandler) error + type PreparedMessage struct + func NewPreparedMessage(messageType int, data []byte) (*PreparedMessage, error)