Documentation ¶
Overview ¶
Package test provides helpers for testing interceptors
Index ¶
- type MockStream
- func (s *MockStream) Close() error
- func (s *MockStream) ReadRTCP() chan RTCPWithError
- func (s *MockStream) ReadRTP() chan RTPWithError
- func (s *MockStream) ReceiveRTCP(pkts []rtcp.Packet)
- func (s *MockStream) ReceiveRTP(packet *rtp.Packet)
- func (s *MockStream) WriteRTCP(pkts []rtcp.Packet) error
- func (s *MockStream) WriteRTP(p *rtp.Packet) error
- func (s *MockStream) WrittenRTCP() chan []rtcp.Packet
- func (s *MockStream) WrittenRTP() chan *rtp.Packet
- type MockTicker
- type MockTime
- type RTCPWithError
- type RTPWithError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockStream ¶
type MockStream struct {
// contains filtered or unexported fields
}
MockStream is a helper struct for testing interceptors.
func NewMockStream ¶
func NewMockStream(info *interceptor.StreamInfo, i interceptor.Interceptor) *MockStream
NewMockStream creates a new MockStream
func (*MockStream) Close ¶
func (s *MockStream) Close() error
Close closes the stream and the underlying interceptor
func (*MockStream) ReadRTCP ¶
func (s *MockStream) ReadRTCP() chan RTCPWithError
ReadRTCP returns a channel containing the rtcp batched read, modified by the interceptor
func (*MockStream) ReadRTP ¶
func (s *MockStream) ReadRTP() chan RTPWithError
ReadRTP returns a channel containing the rtp packets read, modified by the interceptor
func (*MockStream) ReceiveRTCP ¶
func (s *MockStream) ReceiveRTCP(pkts []rtcp.Packet)
ReceiveRTCP schedules a new rtcp batch, so it can be read be the stream
func (*MockStream) ReceiveRTP ¶
func (s *MockStream) ReceiveRTP(packet *rtp.Packet)
ReceiveRTP schedules a rtp packet, so it can be read be the stream
func (*MockStream) WriteRTCP ¶
func (s *MockStream) WriteRTCP(pkts []rtcp.Packet) error
WriteRTCP writes a batch of rtcp packet to the stream, using the interceptor
func (*MockStream) WriteRTP ¶
func (s *MockStream) WriteRTP(p *rtp.Packet) error
WriteRTP writes an rtp packet to the stream, using the interceptor
func (*MockStream) WrittenRTCP ¶
func (s *MockStream) WrittenRTCP() chan []rtcp.Packet
WrittenRTCP returns a channel containing the rtcp batches written, modified by the interceptor
func (*MockStream) WrittenRTP ¶
func (s *MockStream) WrittenRTP() chan *rtp.Packet
WrittenRTP returns a channel containing rtp packets written, modified by the interceptor
type MockTicker ¶
MockTicker is a helper to replace time.Ticker for testing purposes.
type MockTime ¶
type MockTime struct {
// contains filtered or unexported fields
}
MockTime is a helper to replace time.Now() for testing purposes.
type RTCPWithError ¶
RTCPWithError is used to send a batch of rtcp packets or an error on a channel
type RTPWithError ¶
RTPWithError is used to send an rtp packet or an error on a channel