Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientSignaller ¶
type ClientSignaller interface { Start(context.Context, OfferHandler) error Shutdown() error }
func NewFileClientSignaller ¶
func NewFileClientSignaller(offerFilePath, answerFilePath string) (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 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
Click to show internal directories.
Click to hide internal directories.