websocket

package
v0.0.0-...-0f16109 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ReadBufferSize  int `koanf:"read_buffer_size"`
	WriteBufferSize int `koanf:"write_buffer_size"`
}

type GorillaConnection

type GorillaConnection struct {
	// contains filtered or unexported fields
}

func (*GorillaConnection) Close

func (c *GorillaConnection) Close() error

func (*GorillaConnection) ReadMessage

func (c *GorillaConnection) ReadMessage() (int, []byte, error)

func (*GorillaConnection) RemoteAddr

func (c *GorillaConnection) RemoteAddr() string

func (*GorillaConnection) SetCloseHandler

func (c *GorillaConnection) SetCloseHandler(h func(code int, text string) error)

SetCloseHandler sets the handler for close messages received from the peer.

func (*GorillaConnection) SetPongHandler

func (c *GorillaConnection) SetPongHandler(h func(appData string) error)

SetPongHandler sets the handler for pong messages received from the peer.

func (*GorillaConnection) SetReadDeadline

func (c *GorillaConnection) SetReadDeadline(t time.Time) error

SetReadDeadline sets the read deadline on the underlying connection.

func (*GorillaConnection) SetReadLimit

func (c *GorillaConnection) SetReadLimit(limit int64)

SetReadLimit sets the maximum size for a message read from the peer.

func (*GorillaConnection) SetWriteDeadline

func (c *GorillaConnection) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the write deadline on the underlying connection.

func (*GorillaConnection) WriteMessage

func (c *GorillaConnection) WriteMessage(messageType int, data []byte) error

type GorillaUpgrader

type GorillaUpgrader struct {
	// contains filtered or unexported fields
}

func NewGorillaUpgrader

func NewGorillaUpgrader(cfg Config, checkOrigin func(r *http.Request) bool) *GorillaUpgrader

func (*GorillaUpgrader) Upgrade

func (u *GorillaUpgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*GorillaConnection, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL