Documentation
¶
Index ¶
- type CompletionHandler
- type Session
- func (s *Session) CreateAnswer() error
- func (s *Session) CreateConnection(onConnectionStateChange func(connectionState webrtc.ICEConnectionState)) error
- func (s *Session) CreateDataChannel(c *webrtc.DataChannelInit) (*webrtc.DataChannel, error)
- func (s *Session) CreateOffer() error
- func (s *Session) OnCompletion()
- func (s *Session) OnDataChannel(handler func(d *webrtc.DataChannel))
- func (s *Session) ReadSDP() error
- func (s *Session) SDPProvider() io.Reader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompletionHandler ¶
type CompletionHandler func()
CompletionHandler to be called when transfer is done
type Session ¶
type Session struct {
Done chan struct{}
NetworkStats *stats.Stats
// contains filtered or unexported fields
}
Session contains common elements to perform send/receive
func (*Session) CreateAnswer ¶
CreateAnswer set the local description and print the answer SDP
func (*Session) CreateConnection ¶
func (s *Session) CreateConnection(onConnectionStateChange func(connectionState webrtc.ICEConnectionState)) error
CreateConnection prepares a WebRTC connection
func (*Session) CreateDataChannel ¶
func (s *Session) CreateDataChannel(c *webrtc.DataChannelInit) (*webrtc.DataChannel, error)
CreateDataChannel that will be used to send data
func (*Session) CreateOffer ¶
CreateOffer set the local description and print the offer SDP
func (*Session) OnCompletion ¶
func (s *Session) OnCompletion()
OnCompletion is called when session ends
func (*Session) OnDataChannel ¶
func (s *Session) OnDataChannel(handler func(d *webrtc.DataChannel))
OnDataChannel sets an OnDataChannel handler
func (*Session) SDPProvider ¶
SDPProvider returns the SDP input
Click to show internal directories.
Click to hide internal directories.