channeltest

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 7 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 channeltest defines the transport-neutral FrameChannel behavior matrix. Transport packages provide a factory that exposes peer-side controls without leaking their implementation details into the session module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, factory Factory)

Run executes the named behavior matrix shared by relay and future WebRTC adapters. Subtest names are stable so the TypeScript implementation can mirror the same contract even though its test code cannot import this Go package.

Types

type Factory

type Factory func(testing.TB) Fixture

Factory returns an independent open fixture for each conformance case.

type Fixture

type Fixture struct {
	Channel framechannel.Channel

	ReceiveSent     func(context.Context) (SentFrame, error)
	Deliver         func(framechannel.Frame) error
	DeliverTerminal func(framechannel.Frame) error
	RemoteClose     func() error

	// SaturateSends must return only after the next valid Send will wait for
	// capacity. ReleaseSends must be idempotent so cleanup can always call it.
	SaturateSends func(testing.TB)
	ReleaseSends  func()
	Cleanup       func()
}

Fixture projects the peer side of one freshly opened adapter. The callbacks let the suite drive remote events while keeping transport construction, framing, and saturation mechanics inside the implementing package.

type SentFrame

type SentFrame struct {
	Frame    framechannel.Frame
	Terminal bool
}

SentFrame is one frame observed after the adapter accepted it for transport. Terminal remains explicit because terminal delivery has stronger completion and lifecycle semantics than an ordinary frame.

Jump to

Keyboard shortcuts

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