Documentation
¶
Index ¶
- func DoTransmit(msg *protocol.Message, t time.Time, self *PeerJSServerInstance, ...) error
- func HandleHeartbeat(msg *protocol.Message, t time.Time, self *PeerJSServerInstance, ...) error
- type IFunctionalLogger
- type InvalidDestinationError
- type MessageHandler
- type PeerJSServerInstance
- func (pjs *PeerJSServerInstance) Clear() error
- func (pjs *PeerJSServerInstance) DoExpireCheck(t time.Time) error
- func (pjs *PeerJSServerInstance) DoReceive(client *clients.Client) error
- func (pjs *PeerJSServerInstance) EndSession(client *clients.Client) error
- func (pjs *PeerJSServerInstance) ListPeers() []string
- func (pjs *PeerJSServerInstance) LoopSessionInbound(client *clients.Client) error
- func (pjs *PeerJSServerInstance) LoopSessionOutbound(client *clients.Client) error
- func (pjs *PeerJSServerInstance) SendCachedMessages(client *clients.Client) error
- func (pjs *PeerJSServerInstance) SendOpen(client *clients.Client) error
- func (pjs *PeerJSServerInstance) StartSession(id string, token string, conn *websocket.Conn) (*clients.Client, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoTransmit ¶
func HandleHeartbeat ¶
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 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 ¶
Click to show internal directories.
Click to hide internal directories.