mqtt

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidMessage = errors.New("message type not binary")

Functions

This section is empty.

Types

type ACLHook

type ACLHook struct {
	mqtt.HookBase
}

func (*ACLHook) ID

func (h *ACLHook) ID() string

func (*ACLHook) OnACLCheck

func (h *ACLHook) OnACLCheck(cl *mqtt.Client, topic string, write bool) bool

func (*ACLHook) Provides

func (h *ACLHook) Provides(b byte) bool

type AuthHook

type AuthHook struct {
	mqtt.HookBase
	// contains filtered or unexported fields
}

func (*AuthHook) ID

func (h *AuthHook) ID() string

func (*AuthHook) OnConnect

func (h *AuthHook) OnConnect(cl *mqtt.Client, pk packets.Packet) error

func (*AuthHook) OnConnectAuthenticate

func (h *AuthHook) OnConnectAuthenticate(cl *mqtt.Client, pk packets.Packet) bool

func (*AuthHook) OnDisconnect

func (h *AuthHook) OnDisconnect(cl *mqtt.Client, err error, expire bool)

func (*AuthHook) OnPublish

func (h *AuthHook) OnPublish(cl *mqtt.Client, pk packets.Packet) (packets.Packet, error)

func (*AuthHook) OnSubscribe

func (h *AuthHook) OnSubscribe(cl *mqtt.Client, pk packets.Packet) packets.Packet

func (*AuthHook) OnUnsubscribe

func (h *AuthHook) OnUnsubscribe(cl *mqtt.Client, pk packets.Packet) packets.Packet

func (*AuthHook) Provides

func (h *AuthHook) Provides(b byte) bool

type Broker

type Broker struct {
	RoomManager *screenshare.RoomManager
	// contains filtered or unexported fields
}

func NewBroker

func NewBroker(port string, tlsConfig *tls.Config, validateToken func(token string) (string, error), iceServers []interface{}, roomManager *screenshare.RoomManager, hub NotificationHub) *Broker

func (*Broker) EstablishConnection added in v0.0.30

func (b *Broker) EstablishConnection(listenerID string, conn net.Conn) error

func (*Broker) HasConnectedClient added in v0.0.30

func (b *Broker) HasConnectedClient(userID string) bool

func (*Broker) PublishSignaling added in v0.0.30

func (b *Broker) PublishSignaling(userID, clientID string, payload []byte)

func (*Broker) SetTLSConfig added in v0.0.30

func (b *Broker) SetTLSConfig(tlsConfig *tls.Config)

func (*Broker) Start

func (b *Broker) Start() error

func (*Broker) Stop

func (b *Broker) Stop() error

type ConnectionHook

type ConnectionHook struct {
	mqtt.HookBase
	// contains filtered or unexported fields
}

func (*ConnectionHook) ID

func (h *ConnectionHook) ID() string

func (*ConnectionHook) OnDisconnect

func (h *ConnectionHook) OnDisconnect(cl *mqtt.Client, err error, expire bool)

func (*ConnectionHook) OnPacketRead

func (h *ConnectionHook) OnPacketRead(cl *mqtt.Client, pk packets.Packet) (packets.Packet, error)

func (*ConnectionHook) Provides

func (h *ConnectionHook) Provides(b byte) bool

type NotificationHub added in v0.0.30

type NotificationHub interface {
	NotifyScreenshare(uid, fromClientID string, payload interface{})
}

type SignalingMessage

type SignalingMessage struct {
	Type        string                 `json:"type"`
	Room        string                 `json:"room"`
	RoomId      string                 `json:"roomId"`
	UserData    string                 `json:"userdata"`
	AccessCodes []string               `json:"accessCodes"`
	ClientId    string                 `json:"clientId"`
	Payload     map[string]interface{} `json:"payload"`
	IceServers  map[string]interface{} `json:"iceServers"`
}

type WsConn added in v0.0.30

type WsConn struct {
	net.Conn
	C *websocket.Conn
	// contains filtered or unexported fields
}

func NewWsConn added in v0.0.30

func NewWsConn(wsConn *websocket.Conn) *WsConn

func (*WsConn) Close added in v0.0.30

func (ws *WsConn) Close() error

func (*WsConn) Read added in v0.0.30

func (ws *WsConn) Read(p []byte) (int, error)

func (*WsConn) Write added in v0.0.30

func (ws *WsConn) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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