websocket

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWebSocketServer

func NewWebSocketServer(log *slog.Logger, port int, sessionsStorage sessionstorage.SessionStorage, peerStorage peerstorage.PeerStorage) server.Server

func NewWebSocketSession

func NewWebSocketSession(log *slog.Logger, conn *websocket.Conn, peer *domain.Peer, incoming bool, lastDial time.Time) session.Session

NewWebSocketSession принимает указатель на УЖЕ готовое подключение websocket.Conn и остальные необходимые данные для создания сессии WebSocketSession

Types

type WebSocketServer

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

func (*WebSocketServer) Serve

func (s *WebSocketServer) Serve() error

func (*WebSocketServer) Stop

func (s *WebSocketServer) Stop(ctx context.Context)

type WebSocketSession

type WebSocketSession struct {
	session.BaseSession
	// contains filtered or unexported fields
}

func (*WebSocketSession) Close

func (s *WebSocketSession) Close(context.Context)

func (*WebSocketSession) GetID

func (s *WebSocketSession) GetID() uuid.UUID

func (*WebSocketSession) GetLastDial added in v0.1.4

func (s *WebSocketSession) GetLastDial() time.Time

func (*WebSocketSession) GetPeerID added in v0.1.4

func (s *WebSocketSession) GetPeerID() uuid.UUID

func (*WebSocketSession) GetReadChannel

func (s *WebSocketSession) GetReadChannel(context.Context) (<-chan *pb.Message, error)

func (*WebSocketSession) GetWriteChannel

func (s *WebSocketSession) GetWriteChannel(context.Context) (chan<- *pb.Message, error)

func (*WebSocketSession) IsIncoming

func (s *WebSocketSession) IsIncoming() bool

func (*WebSocketSession) IsOpen

func (s *WebSocketSession) IsOpen() bool

Jump to

Keyboard shortcuts

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