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
- Variables
- func EncodeAnswer(answer Answer) ([]byte, error)
- func EncodeCandidate(candidate Candidate) ([]byte, error)
- func EncodeOffer(offer Offer) ([]byte, error)
- type Answer
- type AttemptID
- type Binding
- type Candidate
- type ConnectionPurpose
- type MessageKind
- type Offer
- type OperationContinuationClassifier
- func (classifier OperationContinuationClassifier) BeginOperationContinuation(requestKind protocolsession.MessageKind, canonicalRequestBody []byte) (protocolsession.OperationContinuationContract, bool, error)
- func (classifier OperationContinuationClassifier) ClassifyPeerAttemptContinuation(kind protocolsession.MessageKind, body []byte) (protocolsession.PeerAttemptBinding, bool, error)
- func (classifier OperationContinuationClassifier) ClassifyUnboundOperationContinuation(kind protocolsession.MessageKind, canonicalBody []byte) (protocolsession.OperationContinuationScope, bool, error)
- type PeerPathID
- type ReceiverControlValidator
- func (validator ReceiverControlValidator) BeginOperationContinuation(requestKind protocolsession.MessageKind, canonicalRequestBody []byte) (protocolsession.OperationContinuationContract, bool, error)
- func (validator ReceiverControlValidator) ClassifyPeerAttemptContinuation(kind protocolsession.MessageKind, body []byte) (protocolsession.PeerAttemptBinding, bool, error)
- func (validator ReceiverControlValidator) ClassifyUnboundOperationContinuation(kind protocolsession.MessageKind, canonicalBody []byte) (protocolsession.OperationContinuationScope, bool, error)
- func (ReceiverControlValidator) ValidateSenderControl(kind protocolsession.MessageKind, operationID protocolsession.OperationID, ...) error
Constants ¶
const ( IdentityBytes = 16 SignalingSchemaVersion = 4 MaximumSDPBytes = 60 << 10 MaximumCandidateBytes = 4 << 10 MaximumSDPMidBytes = 256 MaximumUsernameBytes = 256 )
const ( MaximumCandidates = 64 DefaultMaximumCandidates = MaximumCandidates )
Variables ¶
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") )
var ErrContinuationLimit = errors.New("v2 peer continuation limit is invalid")
Functions ¶
func EncodeAnswer ¶
func EncodeCandidate ¶
func EncodeOffer ¶
Types ¶
type AttemptID ¶
type AttemptID [IdentityBytes]byte
type Binding ¶
type Binding struct {
Purpose ConnectionPurpose
PeerSlot uint8
PeerPathID PeerPathID
AttemptID AttemptID
AttemptSequence uint64
}
func (Binding) RequireSame ¶
RequireSame enforces that the first offer reserves the sole path/attempt identity for every answer and candidate in this R-track negotiation.
type Candidate ¶
type Candidate struct {
Binding Binding
Candidate string
SDPMid *string
SDPMLineIndex *uint16
UsernameFragment *string
}
func DecodeCandidate ¶
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 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