Documentation ¶
Index ¶
- Variables
- type Cond
- type Conn
- type ContextReadCloser
- type ContextWriteCloser
- type DataChannel
- func (dc *DataChannel) Close() error
- func (dc *DataChannel) LocalAddr() net.Addr
- func (dc *DataChannel) Read(b []byte) (n int, err error)
- func (dc *DataChannel) RemoteAddr() net.Addr
- func (dc *DataChannel) SetDeadline(t time.Time) error
- func (dc *DataChannel) SetReadDeadline(t time.Time) error
- func (dc *DataChannel) SetWriteDeadline(t time.Time) error
- func (dc *DataChannel) Write(b []byte) (n int, err error)
- type DialOption
- type Dispatcher
- type RTCDataChannel
- type RTCPeerConnection
- type SignalMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosedByPeer = errors.New("closed by peer")
Functions ¶
This section is empty.
Types ¶
type Cond ¶
type Cond struct { C chan struct{} // contains filtered or unexported fields }
A Cond is a condition variable like sync.Cond, but using a channel so we can use select.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn wraps an RTCPeerConnection so connections can be made and accepted.
type ContextReadCloser ¶
type ContextReadCloser struct { context.Context io.ReadCloser // contains filtered or unexported fields }
func (ContextReadCloser) Close ¶
func (cr ContextReadCloser) Close() error
func (ContextReadCloser) SetReadDeadline ¶
func (cr ContextReadCloser) SetReadDeadline(t time.Time) error
type ContextWriteCloser ¶
type ContextWriteCloser struct { context.Context io.WriteCloser // contains filtered or unexported fields }
func (ContextWriteCloser) Close ¶
func (cw ContextWriteCloser) Close() error
func (ContextWriteCloser) SetWriteDeadline ¶
func (cw ContextWriteCloser) SetWriteDeadline(t time.Time) error
type DataChannel ¶
type DataChannel struct {
// contains filtered or unexported fields
}
A DataChannel implements the net.Conn interface over a webrtc data channel
func WrapDataChannel ¶
func WrapDataChannel(rtcDataChannel RTCDataChannel) (*DataChannel, error)
WrapDataChannel wraps an rtc data channel and implements the net.Conn interface
func (*DataChannel) Close ¶
func (dc *DataChannel) Close() error
func (*DataChannel) LocalAddr ¶
func (dc *DataChannel) LocalAddr() net.Addr
func (*DataChannel) RemoteAddr ¶
func (dc *DataChannel) RemoteAddr() net.Addr
func (*DataChannel) SetDeadline ¶
func (dc *DataChannel) SetDeadline(t time.Time) error
func (*DataChannel) SetReadDeadline ¶
func (dc *DataChannel) SetReadDeadline(t time.Time) error
func (*DataChannel) SetWriteDeadline ¶
func (dc *DataChannel) SetWriteDeadline(t time.Time) error
type DialOption ¶
type DialOption (func(*dialConfig))
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(conn *Conn) *Dispatcher
type RTCDataChannel ¶
type RTCDataChannel interface { Close() error Label() string OnClose(func()) OnMessage(func([]byte)) OnOpen(func()) Send([]byte) error }
An RTCDataChannel abstracts an RTCDataChannel
type RTCPeerConnection ¶
type RTCPeerConnection interface { AddICECandidate(string) error Close() error CreateDataChannel(label string) (RTCDataChannel, error) OnDataChannel(func(dc RTCDataChannel)) OnICECandidate(func(string)) OnICEConnectionStateChange(func(string)) CreateAnswer() (string, error) CreateOffer() (string, error) SetAnswer(answer string) error SetOffer(offer string) error }
An RTCPeerConnection abstracts an RTCPeerConnection
func NewRTCPeerConnection ¶
func NewRTCPeerConnection() (RTCPeerConnection, error)
type SignalMessage ¶
Click to show internal directories.
Click to hide internal directories.