websockutil

package
v0.0.0-...-19f3900 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	ReadSize      int           `toml:"read-size"`
	WriteSize     int           `toml:"write-size"`
	WriteDeadline time.Duration `toml:"write-deadline"`
	PingInterval  time.Duration `toml:"ping-interval"`
	PingTimeout   time.Duration `toml:"ping-timeout"`
	ReadMsgLimit  int64         `toml:"read-msg-limit"`
}

func (*Options) FillDefaults

func (o *Options) FillDefaults()

func (*Options) Upgrader

func (o *Options) Upgrader() websocket.Upgrader

type ReceiverFunc

type ReceiverFunc func(msg []byte) error

type Session

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

func (*Session) Close

func (s *Session) Close()

func (*Session) Done

func (s *Session) Done() <-chan struct{}

func (*Session) Shutdown

func (s *Session) Shutdown()

func (*Session) WriteLoop

func (s *Session) WriteLoop()

func (*Session) WriteMsg

func (s *Session) WriteMsg(kind int, data []byte) error

type SessionFactory

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

func NewSessionFactory

func NewSessionFactory(o Options) *SessionFactory

func (*SessionFactory) NewSession

func (f *SessionFactory) NewSession(
	w http.ResponseWriter,
	req *http.Request,
	log *slog.Logger,
	recv ReceiverFunc,
) (*Session, error)

Jump to

Keyboard shortcuts

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