signallers

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnswerOffer

type AnswerOffer func(context.Context, string, sdp.Offer) (sdp.Answer, error)

type ClientSignaller

type ClientSignaller interface {
	Start(context.Context, OfferHandler) error
	Shutdown() error
}

func NewFileClientSignaller

func NewFileClientSignaller(offerFilePath, answerFilePath string) (ClientSignaller, string, error)

func NewServerClientSignaller

func NewServerClientSignaller(url, sessionID string, offer *webrtc.SessionDescription, client *http.Client) (ClientSignaller, string, error)

type HandleRequest

type HandleRequest func(context.Context, string, *webrtc.Configuration, AnswerOffer) error

HandleRequest is a function that handles a request from a client. A HandleRequest func is called when a client wants to connect to connect to oneshot. The HandleRequest func is expected to create a peer and use it create an offer to the client. The sdp exchange is transacted via the AnswerOffer arg.

func (HandleRequest) HandleRequest

func (h HandleRequest) HandleRequest(ctx context.Context, id string, conf *webrtc.Configuration, offer AnswerOffer) error

type OfferHandler

type OfferHandler interface {
	HandleOffer(context.Context, string, sdp.Offer) (sdp.Answer, error)
}

type RequestHandler

type RequestHandler interface {
	HandleRequest(context.Context, string, *webrtc.Configuration, AnswerOffer) error
}

type ServerSignaller

type ServerSignaller interface {
	// Start starts the Signaller and blocks until it is shutdown.
	Start(context.Context, RequestHandler) error
	// Shutdown stops the Signaller from accepting new requests.
	Shutdown() error
}

ServerSignaller is an interface that allows a client to connect to a server. When a client wants to connect, the session signaller will call on the RequestHandler. The session signaller handles the exchange of SDP offers and answers via the AnswerOffer func it provides to the RequestHandler.

func NewFileServerSignaller

func NewFileServerSignaller(dir string, config *webrtc.Configuration) ServerSignaller

func NewServerServerSignaller

func NewServerServerSignaller() ServerSignaller

Jump to

Keyboard shortcuts

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