Documentation
¶
Overview ¶
Package v2peer terminates authenticated suite-02 peer-signaling operations at the Go sender and owns the corresponding Pion PeerConnections.
Index ¶
- Constants
- Variables
- func DefaultConfiguration() pion.Configuration
- type AttemptFailureScope
- type Config
- type DataChannelAdapter
- type DataChannelAdapterFunc
- type Factory
- func (factory *Factory) BeginOperationContinuation(requestKind protocolsession.MessageKind, canonicalRequestBody []byte) (protocolsession.OperationContinuationContract, bool, error)
- func (factory *Factory) ClassifyPeerAttemptContinuation(kind protocolsession.MessageKind, body []byte) (protocolsession.PeerAttemptBinding, bool, error)
- func (factory *Factory) ClassifyUnboundOperationContinuation(kind protocolsession.MessageKind, canonicalBody []byte) (protocolsession.OperationContinuationScope, bool, error)
- func (factory *Factory) CompleteObservations() SenderObservationCompletion
- func (factory *Factory) NativeConnectivity() *nativepeer.NativePeerConnectivity
- func (factory *Factory) NewSenderPeerHandler(session sendersession.PeerSession) (sendersession.PeerHandler, error)
- func (factory *Factory) PeerDiagnostics() <-chan PeerDiagnosticObservation
- func (factory *Factory) SenderAttemptObservations() <-chan SenderAttemptObservation
- type ObservationCompletion
- type ObservationLoss
- type PeerAttemptPhase
- type PeerConnection
- type PeerConnectionFactory
- type PeerConnectionFactoryFunc
- type PeerDataChannel
- type PeerDiagnosticCategory
- type PeerDiagnosticObservation
- type PeerDiagnosticReason
- type PeerOperationFailure
- type PeerPhaseTimer
- type PeerPhaseTimerSource
- type PeerRouteObserver
- type PeerTeardownTransition
- type ReceiverAttempt
- func (attempt *ReceiverAttempt) Close() error
- func (attempt *ReceiverAttempt) Done() <-chan struct{}
- func (attempt *ReceiverAttempt) Err() error
- func (attempt *ReceiverAttempt) Lane() (session.LaneIdentity, bool)
- func (attempt *ReceiverAttempt) Outcome() ReceiverAttemptOutcome
- func (attempt *ReceiverAttempt) Ready() <-chan struct{}
- type ReceiverAttemptDisposition
- type ReceiverAttemptOutcome
- func (m ReceiverAttemptOutcome) BenignComponents() []ReceiverBenignCause
- func (outcome ReceiverAttemptOutcome) Cause() error
- func (m ReceiverAttemptOutcome) ConsequenceProvenance() ReceiverTerminalProvenance
- func (m ReceiverAttemptOutcome) DiagnosticsTruncated() bool
- func (m ReceiverAttemptOutcome) Disposition() ReceiverAttemptDisposition
- func (outcome ReceiverAttemptOutcome) HasRetainedCauseClass(class ReceiverCauseClass) bool
- func (m ReceiverAttemptOutcome) LocalGeneration() uint64
- func (outcome ReceiverAttemptOutcome) LocallyCanceled() bool
- func (m ReceiverAttemptOutcome) OperationID() protocolsession.OperationID
- func (outcome ReceiverAttemptOutcome) RecoveryScope() protocolsession.PeerFailureRecoveryScope
- func (m ReceiverAttemptOutcome) RequiresSessionClose() bool
- func (outcome ReceiverAttemptOutcome) RetainedCause() error
- func (m ReceiverAttemptOutcome) RetainedCauseClasses() []ReceiverCauseClass
- func (m ReceiverAttemptOutcome) TransitionAuthority() ReceiverTerminalOwner
- func (m ReceiverAttemptOutcome) TransitionProvenance() ReceiverTerminalProvenance
- type ReceiverBenignCause
- type ReceiverCauseClass
- type ReceiverControl
- type ReceiverFactory
- func (factory *ReceiverFactory) AttemptBudget(limit time.Duration) time.Duration
- func (factory *ReceiverFactory) CompleteObservations() ReceiverObservationCompletion
- func (factory *ReceiverFactory) NativeConnectivity() *nativepeer.NativePeerConnectivity
- func (factory *ReceiverFactory) PeerDiagnostics() <-chan PeerDiagnosticObservation
- func (factory *ReceiverFactory) PrepareBinding(parent context.Context, lanes ReceiverLaneSession, binding v2signal.Binding, ...) (*nativepeer.PreparedAttempt, error)
- func (factory *ReceiverFactory) ReceiverTerminationObservations() <-chan ReceiverTerminationTrace
- func (factory *ReceiverFactory) Start(parent context.Context, signaling ReceiverSignaling, lanes ReceiverLaneSession, ...) (*ReceiverAttempt, error)
- func (factory *ReceiverFactory) StartBinding(parent context.Context, signaling ReceiverSignaling, lanes ReceiverLaneSession, ...) (*ReceiverAttempt, error)
- func (factory *ReceiverFactory) StartPreparedBinding(parent context.Context, signaling ReceiverSignaling, lanes ReceiverLaneSession, ...) (*ReceiverAttempt, error)
- func (f *ReceiverFactory) StartTURNBinding(ctx context.Context, signaling ReceiverSignaling, lanes ReceiverLaneSession, ...) (*ReceiverAttempt, error)
- type ReceiverFactoryConfig
- type ReceiverLaneSession
- type ReceiverObservationCompletion
- type ReceiverPeerConnection
- type ReceiverPeerConnectionFactory
- type ReceiverPeerConnectionFactoryFunc
- type ReceiverSignaling
- type ReceiverSignalingOperation
- type ReceiverSignalingOperationBinding
- type ReceiverSignalingReceiveResult
- type ReceiverSignalingTermination
- type ReceiverTerminalOwner
- type ReceiverTerminalProvenance
- type ReceiverTerminationTrace
- func (m ReceiverTerminationTrace) BenignComponents() []ReceiverBenignCause
- func (trace ReceiverTerminationTrace) ChannelDrainFailed() bool
- func (m ReceiverTerminationTrace) ConsequenceProvenance() ReceiverTerminalProvenance
- func (value ReceiverTerminationTrace) DiagnosticRecord() diag.Record
- func (m ReceiverTerminationTrace) DiagnosticsTruncated() bool
- func (m ReceiverTerminationTrace) Disposition() ReceiverAttemptDisposition
- func (m ReceiverTerminationTrace) LocalGeneration() uint64
- func (m ReceiverTerminationTrace) OperationID() protocolsession.OperationID
- func (trace ReceiverTerminationTrace) PeerShutdownFailed() bool
- func (m ReceiverTerminationTrace) RequiresSessionClose() bool
- func (m ReceiverTerminationTrace) RetainedCauseClasses() []ReceiverCauseClass
- func (trace ReceiverTerminationTrace) TeardownTransitions() []PeerTeardownTransition
- func (m ReceiverTerminationTrace) TransitionAuthority() ReceiverTerminalOwner
- func (m ReceiverTerminationTrace) TransitionProvenance() ReceiverTerminalProvenance
- type RuntimeReceiverSignaling
- type SenderAdmissionDisposition
- type SenderAttemptFailure
- type SenderAttemptObservation
- type SenderAttemptPhase
- type SenderAttemptStage
- type SenderAttemptTermination
- type SenderCandidateCounts
- type SenderLaneRejection
- type SenderObservationCompletion
- type SenderResponseDelivery
- type TypedPeerErrorCode
Constants ¶
const ( DefaultSTUNServer = "stun:stun.l.google.com:19302" DefaultMaxCandidates = v2signal.DefaultMaximumCandidates DefaultRetiredBindingTTL = 30 * time.Second DefaultMaxRetiredBindings = 64 DefaultSenderAttemptObservationCapacity = 256 )
const ( PeerSignalingPreparationBudget = 10 * time.Second PeerAnswerPreparationReserve = 2 * time.Second PeerICECheckingBudget = 32 * time.Second PeerDataChannelEstablishmentBudget = 15 * time.Second PeerCheckingOpportunity = PeerSignalingPreparationBudget + PeerICECheckingBudget // Providers without observable stage boundaries retain the complete checking // opportunity under one explicitly negotiation-owned deadline. DefaultPeerNegotiationBudget = PeerCheckingOpportunity + PeerDataChannelEstablishmentBudget DefaultPeerAdmissionBudget = 20 * time.Second MinimumLaneGrantCompletionMargin = 5 * time.Second MaximumPeerAdmissionBudget = protocolsession.LaneGrantTTL - MinimumLaneGrantCompletionMargin SenderMaxActivePeerAttemptsPerSession = 8 SenderMaxPeerPaths = 64 )
const (
DefaultPeerDiagnosticObservationCapacity = 64
)
const (
DefaultReceiverTerminationObservationCapacity = 64
)
Variables ¶
var ( ErrConfig = errors.New("v2 peer sender configuration is invalid") ErrProtocol = errors.New("authenticated v2 peer signaling is invalid") ErrAttemptCapacity = errors.New("v2 peer attempt capacity is exhausted") ErrReplayCapacity = errors.New("v2 peer replay tombstone capacity is exhausted") ErrEventCapacity = errors.New("v2 peer signaling event capacity is exhausted") ErrPeerPathRetired = errors.New("v2 peer path retired") ErrPeerPathCapacity = errors.New("v2 peer path membership capacity is exhausted") ErrNegotiation = errors.New("v2 peer negotiation failed") )
Functions ¶
func DefaultConfiguration ¶
func DefaultConfiguration() pion.Configuration
Types ¶
type AttemptFailureScope ¶
type AttemptFailureScope string
const ( AttemptFailureScopeAttempt AttemptFailureScope = "attempt" AttemptFailureScopeSession AttemptFailureScope = "session" )
func (AttemptFailureScope) DiagnosticName ¶
func (value AttemptFailureScope) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type Config ¶
type Config struct {
Trace diagnostics.Sink
TURNCapacity *turnsession.Capacity
TURNProvider turnsession.Provider
Native *nativepeer.NativePeerConnectivity
Configuration pion.Configuration
PeerConnections PeerConnectionFactory
DataChannels DataChannelAdapter
NegotiationBudget time.Duration
AdmissionBudget time.Duration
PhaseTimers PeerPhaseTimerSource
MaxCandidates int
RetiredBindingTTL time.Duration
MaxRetiredBindings int
// MaxPeerPaths bounds stable path watermarks for this protocol session.
MaxPeerPaths int
SenderAttemptObservationCapacity int
PeerDiagnosticObservationCapacity int
Now func() time.Time
}
type DataChannelAdapter ¶
type DataChannelAdapter interface {
WrapDataChannel(*pion.DataChannel) (PeerDataChannel, error)
}
DataChannelAdapter installs the channel's callbacks before returning. The sender invokes it inside Pion's OnDataChannel callback, before Open and reads; implementations must not wait for those events or for protocol admission.
type DataChannelAdapterFunc ¶
type DataChannelAdapterFunc func(*pion.DataChannel) (PeerDataChannel, error)
func (DataChannelAdapterFunc) WrapDataChannel ¶
func (function DataChannelAdapterFunc) WrapDataChannel( channel *pion.DataChannel, ) (PeerDataChannel, error)
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
func (*Factory) BeginOperationContinuation ¶
func (factory *Factory) BeginOperationContinuation( requestKind protocolsession.MessageKind, canonicalRequestBody []byte, ) (protocolsession.OperationContinuationContract, bool, error)
func (*Factory) ClassifyPeerAttemptContinuation ¶
func (factory *Factory) ClassifyPeerAttemptContinuation(kind protocolsession.MessageKind, body []byte) (protocolsession.PeerAttemptBinding, bool, error)
func (*Factory) ClassifyUnboundOperationContinuation ¶
func (factory *Factory) ClassifyUnboundOperationContinuation( kind protocolsession.MessageKind, canonicalBody []byte, ) (protocolsession.OperationContinuationScope, bool, error)
func (*Factory) CompleteObservations ¶
func (factory *Factory) CompleteObservations() SenderObservationCompletion
CompleteObservations cuts sender-attempt admission before publishing its final capacity fact and cutting diagnostics. Callers must first stop every handler; the cut proves producer state, not consumer execution or quiescence.
func (*Factory) NativeConnectivity ¶
func (factory *Factory) NativeConnectivity() *nativepeer.NativePeerConnectivity
func (*Factory) NewSenderPeerHandler ¶
func (factory *Factory) NewSenderPeerHandler( session sendersession.PeerSession, ) (sendersession.PeerHandler, error)
func (*Factory) PeerDiagnostics ¶
func (factory *Factory) PeerDiagnostics() <-chan PeerDiagnosticObservation
func (*Factory) SenderAttemptObservations ¶
func (factory *Factory) SenderAttemptObservations() <-chan SenderAttemptObservation
type ObservationCompletion ¶
type ObservationCompletion struct {
Enqueued uint64
Loss ObservationLoss
}
ObservationCompletion is a producer-proven snapshot at one stream's admission cut. Enqueued does not imply that a consumer received or projected an observation.
type ObservationLoss ¶
type ObservationLoss struct {
CapacityDropped uint64
// SourceDropped includes path evidence capacity and unfinished diagnostic cleanup.
SourceDropped uint64
}
ObservationLoss separates queue overflow from evidence unavailable at its source.
func (ObservationLoss) Total ¶
func (loss ObservationLoss) Total() uint64
type PeerAttemptPhase ¶
type PeerAttemptPhase string
const ( PeerAttemptPhaseNegotiation PeerAttemptPhase = "negotiation" PeerAttemptPhaseAdmission PeerAttemptPhase = "lane_admission" PeerAttemptPhasePreparation PeerAttemptPhase = "signaling_preparation" PeerAttemptPhaseResources PeerAttemptPhase = "resource_preparation" PeerAttemptPhaseChecking PeerAttemptPhase = "ice_checking" PeerAttemptPhaseEstablishing PeerAttemptPhase = "datachannel_establishment" )
type PeerConnection ¶
type PeerConnection interface {
OnICECandidate(func(*pion.ICECandidate))
OnConnectionStateChange(func(pion.PeerConnectionState))
OnDataChannel(func(*pion.DataChannel))
SetRemoteDescription(pion.SessionDescription) error
CreateAnswer(*pion.AnswerOptions) (pion.SessionDescription, error)
SetLocalDescription(pion.SessionDescription) error
LocalDescription() *pion.SessionDescription
AddICECandidate(pion.ICECandidateInit) error
Close() error
}
type PeerConnectionFactory ¶
type PeerConnectionFactory interface {
NewPeerConnection(context.Context, nativepeer.AttemptRequest) (PeerConnection, error)
}
type PeerConnectionFactoryFunc ¶
type PeerConnectionFactoryFunc func(pion.Configuration) (PeerConnection, error)
func (PeerConnectionFactoryFunc) NewPeerConnection ¶
func (function PeerConnectionFactoryFunc) NewPeerConnection( _ context.Context, request nativepeer.AttemptRequest, ) (PeerConnection, error)
type PeerDataChannel ¶
type PeerDataChannel interface {
protocolsession.FrameChannel
Opened() <-chan struct{}
Done() <-chan struct{}
Err() error
// Fail records a permanent transport failure without waiting for consumers or
// physical shutdown. Already accepted inbound frames retain their order;
// Done and Close remain the logical completion and physical join barriers.
Fail(error)
}
type PeerDiagnosticCategory ¶
type PeerDiagnosticCategory string
PeerDiagnosticCategory identifies the sealed evidence stream that lost observability. It never conveys transport or fallback authority.
const ( PeerDiagnosticSenderAttempt PeerDiagnosticCategory = "sender_attempt" PeerDiagnosticReceiverTermination PeerDiagnosticCategory = "receiver_termination" )
type PeerDiagnosticObservation ¶
type PeerDiagnosticObservation struct {
Category PeerDiagnosticCategory
Reason PeerDiagnosticReason
Count uint64
}
PeerDiagnosticObservation reports the cumulative, saturating count for one closed category/reason pair. Later observations supersede earlier counts.
func (PeerDiagnosticObservation) DiagnosticRecord ¶
func (value PeerDiagnosticObservation) DiagnosticRecord() diag.Record
type PeerDiagnosticReason ¶
type PeerDiagnosticReason string
PeerDiagnosticReason is deliberately text-free: provider errors remain behind the connectivity boundary.
const ( PeerDiagnosticStreamCapacity PeerDiagnosticReason = "stream_capacity" PeerDiagnosticPathCapacity PeerDiagnosticReason = "path_capacity" PeerDiagnosticCleanupResidue PeerDiagnosticReason = "cleanup_residue" )
type PeerOperationFailure ¶
PeerOperationFailure preserves the exact authenticated operation failure delivered to the browser without retaining provider-controlled error text.
type PeerPhaseTimer ¶
type PeerPhaseTimerSource ¶
type PeerPhaseTimerSource interface {
NewPeerPhaseTimer(PeerAttemptPhase, time.Duration) (PeerPhaseTimer, error)
}
type PeerRouteObserver ¶
type PeerRouteObserver interface {
SelectedPeerRoute() (transferlanes.Route, bool)
}
PeerRouteObserver supplies a local provider witness, never remote signaling.
type PeerTeardownTransition ¶
type PeerTeardownTransition string
PeerTeardownTransition is an ordered, text-free lifecycle milestone suitable for correlating teardown with an attempt's stable signaling identity.
const ( PeerTeardownPeerShutdownInitiated PeerTeardownTransition = "peer_shutdown_initiated" PeerTeardownPeerShutdownReturned PeerTeardownTransition = "peer_shutdown_returned" PeerTeardownChannelDrainStarted PeerTeardownTransition = "channel_drain_started" PeerTeardownChannelDrainJoined PeerTeardownTransition = "channel_drain_joined" )
func (PeerTeardownTransition) DiagnosticName ¶
func (value PeerTeardownTransition) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type ReceiverAttempt ¶
type ReceiverAttempt struct {
// contains filtered or unexported fields
}
func (*ReceiverAttempt) Close ¶
func (attempt *ReceiverAttempt) Close() error
func (*ReceiverAttempt) Done ¶
func (attempt *ReceiverAttempt) Done() <-chan struct{}
func (*ReceiverAttempt) Err ¶
func (attempt *ReceiverAttempt) Err() error
func (*ReceiverAttempt) Lane ¶
func (attempt *ReceiverAttempt) Lane() (session.LaneIdentity, bool)
func (*ReceiverAttempt) Outcome ¶
func (attempt *ReceiverAttempt) Outcome() ReceiverAttemptOutcome
func (*ReceiverAttempt) Ready ¶
func (attempt *ReceiverAttempt) Ready() <-chan struct{}
type ReceiverAttemptDisposition ¶
type ReceiverAttemptDisposition string
const ( ReceiverDispositionFallbackAllowed ReceiverAttemptDisposition = "fallback_allowed" ReceiverDispositionSessionUnsafe ReceiverAttemptDisposition = "session_unsafe" )
func (ReceiverAttemptDisposition) DiagnosticName ¶
func (value ReceiverAttemptDisposition) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type ReceiverAttemptOutcome ¶
type ReceiverAttemptOutcome struct {
// contains filtered or unexported fields
}
ReceiverAttemptOutcome is a sealed value. Diagnostic accessors expose only defensive slice copies, while lifecycle authority remains unexportable.
func (ReceiverAttemptOutcome) BenignComponents ¶
func (m ReceiverAttemptOutcome) BenignComponents() []ReceiverBenignCause
func (ReceiverAttemptOutcome) Cause ¶
func (outcome ReceiverAttemptOutcome) Cause() error
func (ReceiverAttemptOutcome) ConsequenceProvenance ¶
func (m ReceiverAttemptOutcome) ConsequenceProvenance() ReceiverTerminalProvenance
func (ReceiverAttemptOutcome) DiagnosticsTruncated ¶
func (m ReceiverAttemptOutcome) DiagnosticsTruncated() bool
func (ReceiverAttemptOutcome) Disposition ¶
func (m ReceiverAttemptOutcome) Disposition() ReceiverAttemptDisposition
func (ReceiverAttemptOutcome) HasRetainedCauseClass ¶
func (outcome ReceiverAttemptOutcome) HasRetainedCauseClass(class ReceiverCauseClass) bool
func (ReceiverAttemptOutcome) LocalGeneration ¶
func (m ReceiverAttemptOutcome) LocalGeneration() uint64
func (ReceiverAttemptOutcome) LocallyCanceled ¶
func (outcome ReceiverAttemptOutcome) LocallyCanceled() bool
func (ReceiverAttemptOutcome) OperationID ¶
func (m ReceiverAttemptOutcome) OperationID() protocolsession.OperationID
func (ReceiverAttemptOutcome) RecoveryScope ¶
func (outcome ReceiverAttemptOutcome) RecoveryScope() protocolsession.PeerFailureRecoveryScope
RecoveryScope is imported only from authenticated core termination facts. Arbitrary error strings, wrapped diagnostics and Retryable never authorize recovery.
func (ReceiverAttemptOutcome) RequiresSessionClose ¶
func (m ReceiverAttemptOutcome) RequiresSessionClose() bool
func (ReceiverAttemptOutcome) RetainedCause ¶
func (outcome ReceiverAttemptOutcome) RetainedCause() error
func (ReceiverAttemptOutcome) RetainedCauseClasses ¶
func (m ReceiverAttemptOutcome) RetainedCauseClasses() []ReceiverCauseClass
func (ReceiverAttemptOutcome) TransitionAuthority ¶
func (m ReceiverAttemptOutcome) TransitionAuthority() ReceiverTerminalOwner
func (ReceiverAttemptOutcome) TransitionProvenance ¶
func (m ReceiverAttemptOutcome) TransitionProvenance() ReceiverTerminalProvenance
type ReceiverBenignCause ¶
type ReceiverBenignCause string
const ( ReceiverBenignContextCanceled ReceiverBenignCause = "context_canceled" ReceiverBenignLocalOperationMissing ReceiverBenignCause = "local_cancel_operation_missing" ReceiverBenignRemoteOperationMissing ReceiverBenignCause = "remote_final_operation_missing" )
func (ReceiverBenignCause) DiagnosticName ¶
func (value ReceiverBenignCause) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type ReceiverCauseClass ¶
type ReceiverCauseClass string
const ( ReceiverCauseRuntimeClosed ReceiverCauseClass = "runtime_closed" ReceiverCauseConfiguration ReceiverCauseClass = "configuration" ReceiverCauseOperationMissing ReceiverCauseClass = "operation_missing" ReceiverCauseNegotiationTimeout ReceiverCauseClass = "negotiation_timeout" ReceiverCauseAdmissionTimeout ReceiverCauseClass = "admission_timeout" ReceiverCauseCandidateLimit ReceiverCauseClass = "candidate_limit" ReceiverCauseChannelAdmission ReceiverCauseClass = "channel_admission" ReceiverCauseEventCapacity ReceiverCauseClass = "event_capacity" ReceiverCauseNegotiation ReceiverCauseClass = "negotiation" ReceiverCauseProtocol ReceiverCauseClass = "protocol" ReceiverCauseDeadline ReceiverCauseClass = "deadline_exceeded" ReceiverCausePeerShutdown ReceiverCauseClass = "peer_shutdown" ReceiverCauseChannelDrain ReceiverCauseClass = "channel_drain" ReceiverCauseUnknown ReceiverCauseClass = "unknown" )
func ReceiverCauseClasses ¶
func ReceiverCauseClasses(cause error) []ReceiverCauseClass
ReceiverCauseClasses returns text-free diagnostic classes for a receiver error. Session lifetime comes only from the sealed decision on ReceiverAttemptOutcome.
func (ReceiverCauseClass) DiagnosticName ¶
func (value ReceiverCauseClass) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type ReceiverControl ¶
type ReceiverControl interface {
Kind() protocolsession.MessageKind
Body() []byte
}
type ReceiverFactory ¶
type ReceiverFactory struct {
// contains filtered or unexported fields
}
func NewReceiverFactory ¶
func NewReceiverFactory(config ReceiverFactoryConfig) (*ReceiverFactory, error)
func (*ReceiverFactory) AttemptBudget ¶ added in v0.1.6
func (factory *ReceiverFactory) AttemptBudget(limit time.Duration) time.Duration
AttemptBudget bounds recovery reservations by the phases this provider runs.
func (*ReceiverFactory) CompleteObservations ¶
func (factory *ReceiverFactory) CompleteObservations() ReceiverObservationCompletion
CompleteObservations cuts termination admission before publishing its final capacity fact and cutting diagnostics. Attempts must be joined by the caller first so the returned producer snapshot is final.
func (*ReceiverFactory) NativeConnectivity ¶
func (factory *ReceiverFactory) NativeConnectivity() *nativepeer.NativePeerConnectivity
func (*ReceiverFactory) PeerDiagnostics ¶
func (factory *ReceiverFactory) PeerDiagnostics() <-chan PeerDiagnosticObservation
func (*ReceiverFactory) PrepareBinding ¶
func (factory *ReceiverFactory) PrepareBinding(parent context.Context, lanes ReceiverLaneSession, binding v2signal.Binding, queueWait time.Duration) (*nativepeer.PreparedAttempt, error)
PrepareBinding waits for process resources without arming signaling/ICE timers.
func (*ReceiverFactory) ReceiverTerminationObservations ¶
func (factory *ReceiverFactory) ReceiverTerminationObservations() <-chan ReceiverTerminationTrace
func (*ReceiverFactory) Start ¶
func (factory *ReceiverFactory) Start( parent context.Context, signaling ReceiverSignaling, lanes ReceiverLaneSession, slot *peerslot.Lease, ) (*ReceiverAttempt, error)
Start borrows a session-owned slot; the caller retains it until the attempt has joined. Successive physical paths must share the same session pool.
func (*ReceiverFactory) StartBinding ¶
func (factory *ReceiverFactory) StartBinding(parent context.Context, signaling ReceiverSignaling, lanes ReceiverLaneSession, binding v2signal.Binding) (*ReceiverAttempt, error)
StartBinding executes exactly one immutable attempt. PeerSet supplies the stable path and advancing sequence; a failed operation is never reopened.
func (*ReceiverFactory) StartPreparedBinding ¶
func (factory *ReceiverFactory) StartPreparedBinding(parent context.Context, signaling ReceiverSignaling, lanes ReceiverLaneSession, binding v2signal.Binding, prepared *nativepeer.PreparedAttempt) (*ReceiverAttempt, error)
StartPreparedBinding transfers an admitted preparation into one timed attempt.
func (*ReceiverFactory) StartTURNBinding ¶ added in v0.1.6
func (f *ReceiverFactory) StartTURNBinding(ctx context.Context, signaling ReceiverSignaling, lanes ReceiverLaneSession, binding v2signal.Binding, g p.TURNGrant) (*ReceiverAttempt, error)
type ReceiverFactoryConfig ¶
type ReceiverFactoryConfig struct {
TURNCapacity *turnsession.Capacity
Native *nativepeer.NativePeerConnectivity
Configuration pion.Configuration
PeerConnections ReceiverPeerConnectionFactory
DataChannels DataChannelAdapter
NegotiationBudget time.Duration
AdmissionBudget time.Duration
PhaseTimers PeerPhaseTimerSource
MaxCandidates int
Random io.Reader
ReceiverTerminationObservationCapacity int
PeerDiagnosticObservationCapacity int
}
type ReceiverLaneSession ¶
type ReceiverLaneSession interface {
RequestLane(context.Context, uint32) (protocolsession.LaneGrant, error)
AttachLane(
context.Context,
protocolsession.LaneGrant,
protocolsession.FrameChannel,
transferlanes.Route,
) (receiversession.LaneAdmissionResult, error)
}
type ReceiverObservationCompletion ¶
type ReceiverObservationCompletion struct {
Terminations ObservationCompletion
Diagnostics ObservationCompletion
}
type ReceiverPeerConnection ¶
type ReceiverPeerConnection interface {
OnICECandidate(func(*pion.ICECandidate))
OnConnectionStateChange(func(pion.PeerConnectionState))
OnDataChannel(func(*pion.DataChannel))
CreateDataChannel(string, *pion.DataChannelInit) (*pion.DataChannel, error)
CreateOffer(*pion.OfferOptions) (pion.SessionDescription, error)
SetLocalDescription(pion.SessionDescription) error
LocalDescription() *pion.SessionDescription
SetRemoteDescription(pion.SessionDescription) error
AddICECandidate(pion.ICECandidateInit) error
Close() error
}
type ReceiverPeerConnectionFactory ¶
type ReceiverPeerConnectionFactory interface {
NewReceiverPeerConnection(context.Context, nativepeer.AttemptRequest) (ReceiverPeerConnection, error)
}
type ReceiverPeerConnectionFactoryFunc ¶
type ReceiverPeerConnectionFactoryFunc func(pion.Configuration) (ReceiverPeerConnection, error)
func (ReceiverPeerConnectionFactoryFunc) NewReceiverPeerConnection ¶
func (function ReceiverPeerConnectionFactoryFunc) NewReceiverPeerConnection( _ context.Context, request nativepeer.AttemptRequest, ) (ReceiverPeerConnection, error)
type ReceiverSignaling ¶
type ReceiverSignaling interface {
OpenPeerOperation(
context.Context,
ReceiverSignalingOperationBinding,
[]byte,
) (ReceiverSignalingOperation, error)
}
type ReceiverSignalingOperation ¶
type ReceiverSignalingOperation interface {
OperationID() protocolsession.OperationID
MaximumContinuations() (int, bool)
SendCandidate(context.Context, []byte) (protocolsession.OperationDisposition, error)
Receive(context.Context) ReceiverSignalingReceiveResult
Terminate(context.Context) ReceiverSignalingTermination
}
type ReceiverSignalingOperationBinding ¶
type ReceiverSignalingOperationBinding struct {
// contains filtered or unexported fields
}
ReceiverSignalingOperationBinding is an opaque, attempt-issued capability. Adapters receive it before Open so every later terminal can retain the exact local operation identity instead of relying on the reusable wire ID.
type ReceiverSignalingReceiveResult ¶
type ReceiverSignalingReceiveResult struct {
// contains filtered or unexported fields
}
ReceiverSignalingReceiveResult keeps the test seam mutually exclusive. Its public constructors cannot create a session-unsafe consequence; only the production exact-core validation boundary can import that authority.
func NewReceiverSignalingControlResult ¶
func NewReceiverSignalingControlResult(control ReceiverControl) ReceiverSignalingReceiveResult
func NewReceiverSignalingTerminationResult ¶
func NewReceiverSignalingTerminationResult( termination ReceiverSignalingTermination, ) ReceiverSignalingReceiveResult
func (ReceiverSignalingReceiveResult) Control ¶
func (result ReceiverSignalingReceiveResult) Control() (ReceiverControl, bool)
func (ReceiverSignalingReceiveResult) Termination ¶
func (result ReceiverSignalingReceiveResult) Termination() (ReceiverSignalingTermination, bool)
type ReceiverSignalingTermination ¶
type ReceiverSignalingTermination struct {
// contains filtered or unexported fields
}
func NewReceiverSignalingLocalTermination ¶
func NewReceiverSignalingLocalTermination( binding ReceiverSignalingOperationBinding, cause error, ) ReceiverSignalingTermination
NewReceiverSignalingLocalTermination supports consumer-side test adapters without allowing them to mint authenticated session authority.
func NewReceiverSignalingRemoteTermination ¶
func NewReceiverSignalingRemoteTermination( binding ReceiverSignalingOperationBinding, cause error, ) ReceiverSignalingTermination
NewReceiverSignalingRemoteTermination represents an ordinary remote attempt rejection for non-production test adapters. Unsafe remote facts are sealed at the core adapter boundary and have no public constructor.
type ReceiverTerminalOwner ¶
type ReceiverTerminalOwner string
const ( ReceiverTerminalUnbound ReceiverTerminalOwner = "unbound" ReceiverTerminalLocal ReceiverTerminalOwner = "local" ReceiverTerminalRemote ReceiverTerminalOwner = "remote" ReceiverTerminalRuntime ReceiverTerminalOwner = "runtime" )
func (ReceiverTerminalOwner) DiagnosticName ¶
func (value ReceiverTerminalOwner) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type ReceiverTerminalProvenance ¶
type ReceiverTerminalProvenance string
const ( ReceiverProvenanceUnbound ReceiverTerminalProvenance = "unbound" ReceiverProvenanceLocalExplicitStop ReceiverTerminalProvenance = "local_explicit_stop" ReceiverProvenanceLocalContextEnded ReceiverTerminalProvenance = "local_context_ended" ReceiverProvenanceLocalNegotiationFailure ReceiverTerminalProvenance = "local_negotiation_failure" ReceiverProvenanceLocalNegotiationTimeout ReceiverTerminalProvenance = "local_negotiation_timeout" ReceiverProvenanceLocalAdmissionTimeout ReceiverTerminalProvenance = "local_admission_timeout" ReceiverProvenanceLocalOperationContract ReceiverTerminalProvenance = "local_operation_contract" ReceiverProvenanceRemoteOperationRejected ReceiverTerminalProvenance = "remote_operation_rejected" ReceiverProvenanceRemoteOperationRetry ReceiverTerminalProvenance = "remote_operation_retry" ReceiverProvenanceRemoteSessionRejected ReceiverTerminalProvenance = "remote_session_rejected" ReceiverProvenanceRemoteUnknownControl ReceiverTerminalProvenance = "remote_unknown_control" ReceiverProvenanceRemoteControlMalformed ReceiverTerminalProvenance = "remote_control_malformed" ReceiverProvenanceRemoteFailureMalformed ReceiverTerminalProvenance = "remote_failure_malformed" ReceiverProvenanceRemoteFailureScopeViolation ReceiverTerminalProvenance = "remote_failure_scope_violation" ReceiverProvenanceRuntimeStopping ReceiverTerminalProvenance = "runtime_stopping" ReceiverProvenanceSignalingAdapterContract ReceiverTerminalProvenance = "signaling_adapter_contract" ReceiverProvenanceAuthenticatedSecondAnswer ReceiverTerminalProvenance = "authenticated_second_answer" ReceiverProvenanceAuthenticatedFinalConflict ReceiverTerminalProvenance = "authenticated_final_conflict" ReceiverProvenanceAuthenticatedAnswerBindingMismatch ReceiverTerminalProvenance = "authenticated_answer_binding_mismatch" ReceiverProvenanceAuthenticatedCandidateBindingMismatch ReceiverTerminalProvenance = "authenticated_candidate_binding_mismatch" ReceiverProvenanceAuthenticatedContinuationViolation ReceiverTerminalProvenance = "authenticated_continuation_violation" )
type ReceiverTerminationTrace ¶
type ReceiverTerminationTrace struct {
// contains filtered or unexported fields
}
func (ReceiverTerminationTrace) BenignComponents ¶
func (m ReceiverTerminationTrace) BenignComponents() []ReceiverBenignCause
func (ReceiverTerminationTrace) ChannelDrainFailed ¶
func (trace ReceiverTerminationTrace) ChannelDrainFailed() bool
func (ReceiverTerminationTrace) ConsequenceProvenance ¶
func (m ReceiverTerminationTrace) ConsequenceProvenance() ReceiverTerminalProvenance
func (ReceiverTerminationTrace) DiagnosticRecord ¶
func (value ReceiverTerminationTrace) DiagnosticRecord() diag.Record
func (ReceiverTerminationTrace) DiagnosticsTruncated ¶
func (m ReceiverTerminationTrace) DiagnosticsTruncated() bool
func (ReceiverTerminationTrace) Disposition ¶
func (m ReceiverTerminationTrace) Disposition() ReceiverAttemptDisposition
func (ReceiverTerminationTrace) LocalGeneration ¶
func (m ReceiverTerminationTrace) LocalGeneration() uint64
func (ReceiverTerminationTrace) OperationID ¶
func (m ReceiverTerminationTrace) OperationID() protocolsession.OperationID
func (ReceiverTerminationTrace) PeerShutdownFailed ¶
func (trace ReceiverTerminationTrace) PeerShutdownFailed() bool
func (ReceiverTerminationTrace) RequiresSessionClose ¶
func (m ReceiverTerminationTrace) RequiresSessionClose() bool
func (ReceiverTerminationTrace) RetainedCauseClasses ¶
func (m ReceiverTerminationTrace) RetainedCauseClasses() []ReceiverCauseClass
func (ReceiverTerminationTrace) TeardownTransitions ¶
func (trace ReceiverTerminationTrace) TeardownTransitions() []PeerTeardownTransition
func (ReceiverTerminationTrace) TransitionAuthority ¶
func (m ReceiverTerminationTrace) TransitionAuthority() ReceiverTerminalOwner
func (ReceiverTerminationTrace) TransitionProvenance ¶
func (m ReceiverTerminationTrace) TransitionProvenance() ReceiverTerminalProvenance
type RuntimeReceiverSignaling ¶
type RuntimeReceiverSignaling struct {
// contains filtered or unexported fields
}
func NewRuntimeReceiverSignaling ¶
func NewRuntimeReceiverSignaling(runtime *receiversession.Runtime) (*RuntimeReceiverSignaling, error)
func (*RuntimeReceiverSignaling) OpenPeerOperation ¶
func (signaling *RuntimeReceiverSignaling) OpenPeerOperation( ctx context.Context, binding ReceiverSignalingOperationBinding, offer []byte, ) (ReceiverSignalingOperation, error)
type SenderAdmissionDisposition ¶
type SenderAdmissionDisposition string
const ( SenderAdmissionAccepted SenderAdmissionDisposition = "accepted" SenderAdmissionRejected SenderAdmissionDisposition = "rejected" )
func (SenderAdmissionDisposition) DiagnosticName ¶
func (value SenderAdmissionDisposition) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type SenderAttemptFailure ¶
type SenderAttemptFailure struct {
LastCompletedStage SenderAttemptStage
StageElapsedMillis uint64
DeadlineExpired bool
Termination SenderAttemptTermination
FailedAtStage SenderAttemptStage
Scope AttemptFailureScope
TypedPeerErrorCode TypedPeerErrorCode
Message string
Operation *PeerOperationFailure
}
type SenderAttemptObservation ¶
type SenderAttemptObservation struct {
SessionID protocolsession.ProtocolSessionID
PeerPathID v2signal.PeerPathID
AttemptID v2signal.AttemptID
OfferOperationID protocolsession.OperationID
SideSequence uint64
AttemptElapsedMillis uint64
Stage SenderAttemptStage
Phase SenderAttemptPhase
DeadlineMillis uint64
CandidateCounts *SenderCandidateCounts
GrantOperationID protocolsession.OperationID
Lane *session.LaneIdentity
Route transferlanes.Route
AdmissionDisposition SenderAdmissionDisposition
ResponseDelivery SenderResponseDelivery
Rejection *SenderLaneRejection
Failure *SenderAttemptFailure
}
func (SenderAttemptObservation) DiagnosticRecord ¶
func (value SenderAttemptObservation) DiagnosticRecord() diag.Record
type SenderAttemptPhase ¶
type SenderAttemptPhase string
const ( SenderAttemptPhaseNegotiation SenderAttemptPhase = "negotiation" SenderAttemptPhaseAdmission SenderAttemptPhase = "admission" )
func (SenderAttemptPhase) DiagnosticName ¶
func (value SenderAttemptPhase) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type SenderAttemptStage ¶
type SenderAttemptStage string
SenderAttemptStage orders product diagnostics for one sender-side peer attempt. A failed terminal names the next stage that could not complete.
const ( SenderAttemptStarted SenderAttemptStage = "started" SenderAttemptNegotiationDeadlineArmed SenderAttemptStage = "negotiation-deadline-armed" SenderAttemptNegotiationDeadlineExpired SenderAttemptStage = "negotiation-deadline-expired" SenderAttemptOfferReceived SenderAttemptStage = "offer-received" SenderAttemptAnswerCreated SenderAttemptStage = "answer-created" SenderAttemptAnswerSent SenderAttemptStage = "answer-sent" SenderAttemptDataChannelOpen SenderAttemptStage = "datachannel-open" SenderAttemptAdmissionDeadlineArmed SenderAttemptStage = "admission-deadline-armed" SenderAttemptAdmissionDeadlineExpired SenderAttemptStage = "admission-deadline-expired" SenderAttemptLaneHelloAuthenticated SenderAttemptStage = "lane-hello-authenticated" SenderAttemptAdmissionResponseSettled SenderAttemptStage = "admission-response-settled" SenderAttemptAdmitted SenderAttemptStage = "admitted" SenderAttemptFailed SenderAttemptStage = "failed" )
func (SenderAttemptStage) DiagnosticName ¶
func (value SenderAttemptStage) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type SenderCandidateCounts ¶
type SenderLaneRejection ¶
type SenderLaneRejection struct {
Code protocolsession.LaneRejectCode
RetryAfterMillis uint64
}
type SenderObservationCompletion ¶
type SenderObservationCompletion struct {
Attempts ObservationCompletion
Diagnostics ObservationCompletion
}
type SenderResponseDelivery ¶
type SenderResponseDelivery string
const ( SenderResponseDelivered SenderResponseDelivery = "delivered" SenderResponseDeliveryFailed SenderResponseDelivery = "delivery-failed" )
func (SenderResponseDelivery) DiagnosticName ¶
func (value SenderResponseDelivery) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type TypedPeerErrorCode ¶
type TypedPeerErrorCode string
const ( TypedPeerErrorNegotiation TypedPeerErrorCode = "peer-negotiation" TypedPeerErrorTimeout TypedPeerErrorCode = "peer-timeout" TypedPeerErrorCandidates TypedPeerErrorCode = "peer-candidates" TypedPeerErrorAdmission TypedPeerErrorCode = "peer-admission" TypedPeerErrorPolicy TypedPeerErrorCode = "peer-policy" TypedPeerErrorBusy TypedPeerErrorCode = "peer-busy" TypedPeerErrorSignaling TypedPeerErrorCode = "signaling-contract" TypedPeerErrorCancelled TypedPeerErrorCode = "attempt-cancelled" TypedPeerErrorStopped TypedPeerErrorCode = "runtime-stopped" TypedPeerErrorUnexpected TypedPeerErrorCode = "unexpected" )
Source Files
¶
- attempt.go
- attempt_failure.go
- factory.go
- observation_stream.go
- peer_diagnostic.go
- phase.go
- receiver.go
- receiver_admission.go
- receiver_cause.go
- receiver_execution.go
- receiver_outcome.go
- receiver_signaling.go
- receiver_signaling_lifecycle.go
- sender_admission.go
- sender_lifecycle.go
- sender_observer.go
- teardown.go
- turn.go
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
candidatewriter
Package candidatewriter isolates ordered ICE signaling I/O from peer lifecycle dispatch.
|
Package candidatewriter isolates ordered ICE signaling I/O from peer lifecycle dispatch. |
|
Package peerset owns demand-driven peer path recovery.
|
Package peerset owns demand-driven peer path recovery. |