Documentation
¶
Overview ¶
Package memory provides an in-memory transport for testing and stress testing. It implements transport.Transport using channels only (no WebRTC). Callers push frames via SendInput and read pipeline output via Out().
Index ¶
- type Transport
- func (t *Transport) Close() error
- func (t *Transport) Input() <-chan frames.Frame
- func (t *Transport) Out() <-chan frames.Frame
- func (t *Transport) Output() chan<- frames.Frame
- func (t *Transport) SendInput(ctx context.Context, f frames.Frame) bool
- func (t *Transport) Start(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is an in-memory transport that satisfies transport.Transport. Use SendInput to push frames into the pipeline; use Out() to read frames from the pipeline.
func NewTransport ¶
func NewTransport() *Transport
NewTransport creates a new in-memory transport with buffered channels (default 128).
func NewTransportWithBuffer ¶
NewTransportWithBuffer creates a new in-memory transport with the given buffer size per channel.
func (*Transport) Close ¶
Close closes the transport. It closes the input channel so the runner's input goroutine exits, but does not close the output channel to avoid panics from in-flight pipeline sends (sink may still be sending when the runner exits).
func (*Transport) Input ¶
Input returns the channel of frames that the pipeline consumes (runner reads from this).
func (*Transport) Out ¶
Out returns the output channel for reading pipeline results (e.g. TTSAudioRawFrame). The test receives from this channel to consume frames the pipeline sends to the client.
func (*Transport) Output ¶
Output returns the channel the pipeline writes to (sink sends TTS and other frames here).