mock

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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