receiver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// IOConfig carries SDP I/O, STUN, QR, and loopback settings.
	transfer.IOConfig
	// Stream is the file the receiver writes into.
	Stream *os.File
	// Path is an optional filesystem path used for cleanup-on-failure.
	// Empty disables removal.
	Path string
}

Config holds receiver-side configuration.

type Session

type Session struct {
	transfer.SessionBase
	// contains filtered or unexported fields
}

Session is a receiver session.

func New

func New(file *os.File) *Session

New creates a receiver writing to file. Cancelling the Start ctx unblocks OnFrames.

func NewWith

func NewWith(cfg Config) *Session

NewWith creates a receiver configured from cfg.

func (*Session) Initialize

func (s *Session) Initialize(ctx context.Context) error

Initialize creates the PC, registers the data-channel handler, reads the offer, and emits the answer. ctx bounds the OnFrames goroutines.

func (*Session) Start

func (s *Session) Start(ctx context.Context) error

Start initializes the connection and runs the transfer. Cancelling ctx unblocks OnFrames.

Jump to

Keyboard shortcuts

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