v2signal

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 10 Imported by: 1 module, 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 v2signal owns the E2E WebRTC signaling schema. Provider, TURN, relay-node, and path-cost policy deliberately remain outside core/session.

Index

Constants

View Source
const (
	IdentityBytes          = 16
	SignalingSchemaVersion = 4
	MaximumSDPBytes        = 60 << 10
	MaximumCandidateBytes  = 4 << 10
	MaximumSDPMidBytes     = 256
	MaximumUsernameBytes   = 256
)
View Source
const (
	MaximumCandidates        = 64
	DefaultMaximumCandidates = MaximumCandidates
)

Variables

View Source
var (
	ErrInvalidSignal      = errors.New("v2 peer signaling is invalid")
	ErrNonCanonicalSignal = errors.New("v2 peer signaling is not canonical")
	ErrSignalBinding      = errors.New("v2 peer signaling changed path or attempt identity")
)
View Source
var ErrContinuationLimit = errors.New("v2 peer continuation limit is invalid")

Functions

func EncodeAnswer

func EncodeAnswer(answer Answer) ([]byte, error)

func EncodeCandidate

func EncodeCandidate(candidate Candidate) ([]byte, error)

func EncodeOffer

func EncodeOffer(offer Offer) ([]byte, error)

Types

type Answer

type Answer struct {
	Binding Binding
	SDP     string
}

func DecodeAnswer

func DecodeAnswer(encoded []byte) (Answer, error)

func (Answer) Kind

func (Answer) Kind() MessageKind

type AttemptID

type AttemptID [IdentityBytes]byte

type Binding

type Binding struct {
	Purpose         ConnectionPurpose
	PeerSlot        uint8
	PeerPathID      PeerPathID
	AttemptID       AttemptID
	AttemptSequence uint64
}

func (Binding) RequireSame

func (binding Binding) RequireSame(candidate Binding) error

RequireSame enforces that the first offer reserves the sole path/attempt identity for every answer and candidate in this R-track negotiation.

func (Binding) String

func (binding Binding) String() string

func (Binding) Validate

func (binding Binding) Validate() error

type Candidate

type Candidate struct {
	Binding          Binding
	Candidate        string
	SDPMid           *string
	SDPMLineIndex    *uint16
	UsernameFragment *string
}

func DecodeCandidate

func DecodeCandidate(encoded []byte) (Candidate, error)

func (Candidate) Kind

func (Candidate) Kind() MessageKind

type ConnectionPurpose

type ConnectionPurpose uint8

ConnectionPurpose is authenticated with every signal in an attempt. Optional growth must not inherit the admission rights of initial connectivity or recovery.

const (
	InitialConnectivity ConnectionPurpose = iota
	Recovery
	ThroughputExploration
)

func (ConnectionPurpose) String

func (purpose ConnectionPurpose) String() string

type MessageKind

type MessageKind uint8

MessageKind is the transport-neutral signaling codec's view of the frozen E2E operation registry. Keeping the wire codec independent of the session runtime lets signaling bodies be validated in isolation; canonical vectors lock these duplicated values to protocolsession's registry.

const (
	MessagePeerOffer     MessageKind = 16
	MessagePeerAnswer    MessageKind = 17
	MessagePeerCandidate MessageKind = 18
)

type Offer

type Offer struct {
	Binding Binding
	SDP     string
}

func DecodeOffer

func DecodeOffer(encoded []byte) (Offer, error)

func (Offer) Kind

func (Offer) Kind() MessageKind

type OperationContinuationClassifier

type OperationContinuationClassifier struct {
	MaximumCandidates int
}

OperationContinuationClassifier is the transport-schema half of core's generation contract. It decodes only canonical suite-02 signaling values; replay ownership and lifecycle remain in protocolsession.

func (OperationContinuationClassifier) BeginOperationContinuation

func (classifier OperationContinuationClassifier) BeginOperationContinuation(
	requestKind protocolsession.MessageKind,
	canonicalRequestBody []byte,
) (protocolsession.OperationContinuationContract, bool, error)

func (OperationContinuationClassifier) ClassifyPeerAttemptContinuation

func (classifier OperationContinuationClassifier) ClassifyPeerAttemptContinuation(kind protocolsession.MessageKind, body []byte) (protocolsession.PeerAttemptBinding, bool, error)

func (OperationContinuationClassifier) ClassifyUnboundOperationContinuation

func (classifier OperationContinuationClassifier) ClassifyUnboundOperationContinuation(
	kind protocolsession.MessageKind,
	canonicalBody []byte,
) (protocolsession.OperationContinuationScope, bool, error)

type PeerPathID

type PeerPathID [IdentityBytes]byte

type ReceiverControlValidator

type ReceiverControlValidator struct {
	MaximumCandidates int
}

ReceiverControlValidator is injected into receiversession by a Go receiver that enables peer connectivity. Signatures remain core-owned while this transport module owns the typed SDP/ICE schema, avoiding either import cycle.

func (ReceiverControlValidator) BeginOperationContinuation

func (validator ReceiverControlValidator) BeginOperationContinuation(
	requestKind protocolsession.MessageKind,
	canonicalRequestBody []byte,
) (protocolsession.OperationContinuationContract, bool, error)

func (ReceiverControlValidator) ClassifyPeerAttemptContinuation

func (validator ReceiverControlValidator) ClassifyPeerAttemptContinuation(kind protocolsession.MessageKind, body []byte) (protocolsession.PeerAttemptBinding, bool, error)

func (ReceiverControlValidator) ClassifyUnboundOperationContinuation

func (validator ReceiverControlValidator) ClassifyUnboundOperationContinuation(
	kind protocolsession.MessageKind,
	canonicalBody []byte,
) (protocolsession.OperationContinuationScope, bool, error)

func (ReceiverControlValidator) ValidateSenderControl

func (ReceiverControlValidator) ValidateSenderControl(
	kind protocolsession.MessageKind,
	operationID protocolsession.OperationID,
	semantic []byte,
) error

Jump to

Keyboard shortcuts

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