wrtcsgl

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signaler

type Signaler struct {
	// contains filtered or unexported fields
}

Signaler provides a WebRTC signaling server

func NewSignaler

func NewSignaler(
	laddr string,
	dbURL string,
	brokerURL string,
	config *SignalerConfig,
	ctx context.Context,
) *Signaler

NewSignaler creates the signaler

func (*Signaler) Close

func (s *Signaler) Close() error

Close stops listening and disconnects from the database and broker

func (*Signaler) Open

func (s *Signaler) Open() error

Open starts listening and connects to the database and broker

func (*Signaler) Wait

func (s *Signaler) Wait() error

Wait waits for any errors

type SignalerConfig

type SignalerConfig struct {
	Heartbeat            time.Duration // Duration between heartbeats
	Cleanup              bool          // Whether to cleanup leftover ephemeral communities before starting
	EphemeralCommunities bool          // Whether to enable ephemeral communities
	APIUsername          string        // Username for the API endpoint
	APIPassword          string        // Password for the API endpoint; ignored if any of the OIDC parameters are set
	OIDCIssuer           string        // OpenID Connect issuer
	OIDCClientID         string        // OpenID Connect client id

	OnConnect    func(raddr string, community string)                  // Handler to be called when a client has connected to the signaler
	OnDisconnect func(raddr string, community string, err interface{}) // Handler to be called when a client has disconnected from the signaler
}

SignalerConfig configures the adapter

Jump to

Keyboard shortcuts

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