mock

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mock provides mock Interceptor for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory added in v0.1.0

type Factory struct {
	NewInterceptorFn func(id string) (interceptor.Interceptor, error)
}

Factory is a mock Factory for testing.

func (*Factory) NewInterceptor added in v0.1.0

func (f *Factory) NewInterceptor(id string) (interceptor.Interceptor, error)

NewInterceptor implements Interceptor

type Interceptor

type Interceptor struct {
	BindRTCPReaderFn     func(reader interceptor.RTCPReader) interceptor.RTCPReader
	BindRTCPWriterFn     func(writer interceptor.RTCPWriter) interceptor.RTCPWriter
	BindLocalStreamFn    func(i *interceptor.StreamInfo, writer interceptor.RTPWriter) interceptor.RTPWriter
	UnbindLocalStreamFn  func(i *interceptor.StreamInfo)
	BindRemoteStreamFn   func(i *interceptor.StreamInfo, reader interceptor.RTPReader) interceptor.RTPReader
	UnbindRemoteStreamFn func(i *interceptor.StreamInfo)
	CloseFn              func() error
}

Interceptor is an mock Interceptor fot testing.

func (*Interceptor) BindLocalStream

func (i *Interceptor) BindLocalStream(info *interceptor.StreamInfo, writer interceptor.RTPWriter) interceptor.RTPWriter

BindLocalStream implements Interceptor.

func (*Interceptor) BindRTCPReader

func (i *Interceptor) BindRTCPReader(reader interceptor.RTCPReader) interceptor.RTCPReader

BindRTCPReader implements Interceptor.

func (*Interceptor) BindRTCPWriter

func (i *Interceptor) BindRTCPWriter(writer interceptor.RTCPWriter) interceptor.RTCPWriter

BindRTCPWriter implements Interceptor.

func (*Interceptor) BindRemoteStream

func (i *Interceptor) BindRemoteStream(info *interceptor.StreamInfo, reader interceptor.RTPReader) interceptor.RTPReader

BindRemoteStream implements Interceptor.

func (*Interceptor) Close

func (i *Interceptor) Close() error

Close implements Interceptor.

func (*Interceptor) UnbindLocalStream

func (i *Interceptor) UnbindLocalStream(info *interceptor.StreamInfo)

UnbindLocalStream implements Interceptor.

func (*Interceptor) UnbindRemoteStream

func (i *Interceptor) UnbindRemoteStream(info *interceptor.StreamInfo)

UnbindRemoteStream implements Interceptor.

type RTCPReader

type RTCPReader struct {
	ReadFn func([]byte, interceptor.Attributes) (int, interceptor.Attributes, error)
}

RTCPReader is a mock RTCPReader.

func (*RTCPReader) Read

func (r *RTCPReader) Read(b []byte, attributes interceptor.Attributes) (int, interceptor.Attributes, error)

Read implements RTCPReader.

type RTCPWriter

type RTCPWriter struct {
	WriteFn func([]rtcp.Packet, interceptor.Attributes) (int, error)
}

RTCPWriter is a mock RTCPWriter.

func (*RTCPWriter) Write

func (w *RTCPWriter) Write(pkts []rtcp.Packet, attributes interceptor.Attributes) (int, error)

Write implements RTCPWriter.

type RTPReader

type RTPReader struct {
	ReadFn func([]byte, interceptor.Attributes) (int, interceptor.Attributes, error)
}

RTPReader is a mock RTPReader.

func (*RTPReader) Read

func (r *RTPReader) Read(b []byte, attributes interceptor.Attributes) (int, interceptor.Attributes, error)

Read implements RTPReader.

type RTPWriter

type RTPWriter struct {
	WriteFn func(*rtp.Header, []byte, interceptor.Attributes) (int, error)
}

RTPWriter is a mock RTPWriter.

func (*RTPWriter) Write

func (w *RTPWriter) Write(header *rtp.Header, payload []byte, attributes interceptor.Attributes) (int, error)

Write implements RTPWriter.

Jump to

Keyboard shortcuts

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