signaling

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

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) 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