signaling

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 10 Imported by: ? 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 DoTransmit

func DoTransmit(msg *protocol.Message, t time.Time, self *PeerJSServerInstance, c *clients.Client) error

func HandleHeartbeat

func HandleHeartbeat(msg *protocol.Message, t time.Time, self *PeerJSServerInstance, c *clients.Client) error

Types

type IFunctionalLogger

type IFunctionalLogger interface {

	// TraceMessage logs a message at Trace level
	TraceMessage(id string, msg *protocol.Message)

	// TraceExpireCheck
	TraceExpireCheck(map[string]utils.Iterable[msgstorage.IMessage])

	// Debug logs a message at Debug level. id is the client ID, can be empty.
	Debug(msg string, id string)

	// Debug logs a message at Debug level. id is the client ID, can be empty.
	DebugWithError(msg string, id string, err error)

	// Info logs a message at Info level. id is the client ID, can be empty.
	Info(msg string, id string)

	// Warn logs a message at Warn level. id is the client ID, can be empty.
	Warn(msg string, id string, err error)

	// Error logs a message at Error level. id is the client ID, can be empty.
	Error(msg string, id string, err error)
}

type InvalidDestinationError

type InvalidDestinationError struct {
	Dst string
}

func (InvalidDestinationError) Error

func (e InvalidDestinationError) Error() string

type MessageHandler

type MessageHandler func(msg *protocol.Message, t time.Time, self *PeerJSServerInstance, c *clients.Client) error

type PeerJSServerInstance

type PeerJSServerInstance struct {
	MsgExpireTimeout  time.Duration
	ConnExpireTimeout time.Duration
	ClientIdValidator idprovider.IClientIdValidator
	// contains filtered or unexported fields
}

func NewInstance

func NewInstance(
	msgExpireTimeout time.Duration,
	connExpireTimeout time.Duration,
	clientIdValidator idprovider.IClientIdValidator,
	handlers map[string]MessageHandler,
	maxClients uint,
	maxMessagesPerClient uint,
	logger IFunctionalLogger,
) *PeerJSServerInstance

func (*PeerJSServerInstance) Clear

func (pjs *PeerJSServerInstance) Clear() error

func (*PeerJSServerInstance) DoExpireCheck

func (pjs *PeerJSServerInstance) DoExpireCheck(t time.Time) error

func (*PeerJSServerInstance) DoExpireCheckContext

func (pjs *PeerJSServerInstance) DoExpireCheckContext(ctx context.Context, t time.Time) error

DoExpireCheckContext allows shutdown to interrupt delivery to a blocked client.

func (*PeerJSServerInstance) DoReceive

func (pjs *PeerJSServerInstance) DoReceive(client *clients.Client) error

func (*PeerJSServerInstance) EndSession

func (pjs *PeerJSServerInstance) EndSession(client *clients.Client) error

func (*PeerJSServerInstance) ListPeers

func (pjs *PeerJSServerInstance) ListPeers() []string

func (*PeerJSServerInstance) LoopSessionInbound

func (pjs *PeerJSServerInstance) LoopSessionInbound(client *clients.Client) error

func (*PeerJSServerInstance) LoopSessionOutbound

func (pjs *PeerJSServerInstance) LoopSessionOutbound(client *clients.Client) error

func (*PeerJSServerInstance) SendCachedMessages

func (pjs *PeerJSServerInstance) SendCachedMessages(client *clients.Client) error

func (*PeerJSServerInstance) SendOpen

func (pjs *PeerJSServerInstance) SendOpen(client *clients.Client) error

func (*PeerJSServerInstance) StartSession

func (pjs *PeerJSServerInstance) StartSession(id string, token string, conn *websocket.Conn) (*clients.Client, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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