telestrator

package
v0.0.0-...-b8f7dfc Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BroadcastExcept

type BroadcastExcept struct {
	Connection *Connection
	Message    []byte
}

BroadcastExcept contains a payload and a connection to skip during broadcast.

type Connection

type Connection struct {
	Send chan []byte
	// contains filtered or unexported fields
}

Connection is a websocket connection for the OBS Overlay.

func NewOverlayConnection

func NewOverlayConnection(overlay *Overlay, conn *websocket.Conn) *Connection

NewOverlayConnection returns a new overlay connection.

func (*Connection) ReadPump

func (o *Connection) ReadPump()

ReadPump reads incoming socket data on the overlay connection.

func (*Connection) WritePump

func (o *Connection) WritePump()

WritePump writes outgoing socket data on the overlay connection.

type Overlay

type Overlay struct {
	Connections map[*Connection]struct{}

	BroadcastExcept chan BroadcastExcept
	Register        chan *Connection
	Unregister      chan *Connection
	// contains filtered or unexported fields
}

Overlay managed multiple websocket connections to the overlay.

func NewOverlay

func NewOverlay() *Overlay

NewOverlay returns a new Overlay.

func (*Overlay) ConnectionClose

func (o *Overlay) ConnectionClose(connection *Connection)

ConnectionClose closes a connection with the overlay.

func (*Overlay) Init

func (o *Overlay) Init()

Init starts an Overlay. Should be run in a separate go routine.

func (*Overlay) OnMessageReceived

func (o *Overlay) OnMessageReceived(connection *Connection, message []byte)

OnMessageReceived takes an incoming message and broadcasts it to everyone else connected.

func (*Overlay) RegisterConnection

func (o *Overlay) RegisterConnection(connection *Connection)

RegisterConnection registers a connection with the overlay.

func (*Overlay) SendConnectionsExcept

func (o *Overlay) SendConnectionsExcept(except *Connection, message []byte)

SendConnectionsExcept sends all connections except one an event.

func (*Overlay) UnregisterConnection

func (o *Overlay) UnregisterConnection(connection *Connection)

UnregisterConnection unregisters a connection with the overlay.

type Telestrator

type Telestrator struct {
	Overlay *Overlay
}

Telestrator handles the overlay for telestration.

func NewTelestrator

func NewTelestrator() *Telestrator

NewTelestrator returns a new Telestrator.

Jump to

Keyboard shortcuts

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