harness

package
v0.0.0-...-886d61f Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package harness provides the scaffolding for the scp test command.

Package harness defines harness test command configuration and helpers.

Index

Constants

View Source
const (
	// PayloadTypeWebRTCBinary matches pion/sctp payload identifier for binary.
	PayloadTypeWebRTCBinary uint32 = 53
	// ReliabilityTypeReliable matches pion/sctp reliable transmission.
	ReliabilityTypeReliable byte = 0
)
View Source
const (
	DefaultPairMode     = "adjacent"
	DefaultTimeout      = "2m"
	DefaultInterleaving = interleavingAuto
)

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, opts Options, registry map[string]AdapterFactory) (err error)

Types

type Adapter

type Adapter interface {
	// Name returns the adapter identifier.
	Name() string
	// Client establishes a client-side association.
	Client(Config) (Association, error)
	// Server establishes a server-side association.
	Server(Config) (Association, error)
}

Adapter exposes the minimum SCTP surface needed by the harness.

type AdapterFactory

type AdapterFactory func() Adapter

AdapterFactory creates a new SCTP adapter instance.

type Association

type Association interface {
	OpenStream(streamID uint16, payloadType uint32) (Stream, error)
	AcceptStream() (Stream, error)
	BytesSent() uint64
	BytesReceived() uint64
	Close() error
}

Association represents an SCTP association.

type Config

type Config struct {
	NetConn            net.Conn
	LoggerFactory      logging.LoggerFactory
	EnableInterleaving bool
	MaxMessageSize     uint32
}

Config contains the transport wiring for SCTP.

type Options

type Options struct {
	LockPath      string
	PairMode      string
	IncludeNames  []string
	ExcludeNames  []string
	ExplicitPairs []string
	Cases         []string
	Timeout       string
	Seed          int64
	JUnitPath     string
	OutDir        string
	Interleaving  string
	PprofCPU      string
	PprofHeap     string
	PprofAllocs   string
	Repeat        int
}

func DefaultOptions

func DefaultOptions() Options

type Stream

type Stream interface {
	Read([]byte) (int, error)
	Write([]byte) (int, error)
	SetReadDeadline(time.Time) error
	SetWriteDeadline(time.Time) error
	SetReliabilityParams(unordered bool, relType byte, relVal uint32)
	Close() error
}

Stream represents an SCTP stream.

Jump to

Keyboard shortcuts

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