v2peer

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: AGPL-3.0 Imports: 33 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 v2peer terminates authenticated suite-02 peer-signaling operations at the Go sender and owns the corresponding Pion PeerConnections.

Index

Constants

View Source
const (
	DefaultSTUNServer                       = "stun:stun.l.google.com:19302"
	DefaultMaxCandidates                    = v2signal.DefaultMaximumCandidates
	DefaultRetiredBindingTTL                = protocolsession.OperationTombstoneLifetime
	DefaultMaxRetiredBindings               = 64
	DefaultSenderAttemptObservationCapacity = 256
)
View Source
const (
	PeerSignalingPreparationBudget     = 10 * time.Second
	PeerAnswerPreparationReserve       = 2 * time.Second
	PeerICECheckingBudget              = 40 * time.Second
	PeerDataChannelEstablishmentBudget = 15 * time.Second
	// Providers without observable stage boundaries retain the complete checking
	// opportunity under one explicitly negotiation-owned deadline.
	DefaultPeerNegotiationBudget          = PeerSignalingPreparationBudget + PeerICECheckingBudget + PeerDataChannelEstablishmentBudget
	DefaultPeerAdmissionBudget            = 20 * time.Second
	MinimumLaneGrantCompletionMargin      = 5 * time.Second
	MaximumPeerAdmissionBudget            = protocolsession.LaneGrantTTL - MinimumLaneGrantCompletionMargin
	SenderMaxActivePeerAttemptsPerSession = 8
	SenderMaxPeerPaths                    = 64
)
View Source
const (
	DefaultPeerDiagnosticObservationCapacity = 64
)
View Source
const (
	DefaultReceiverTerminationObservationCapacity = 64
)

Variables

View Source
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")
)
View Source
var (
	ErrPeerNegotiationTimeout         = errors.New("peer negotiation phase timed out")
	ErrPeerResourcePreparationTimeout = errors.New("peer resource preparation timed out")
	ErrPeerAdmissionTimeout           = errors.New("peer lane-admission phase timed out")
)

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 {
	TURN               turnpath.Accounts
	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 ConnectionPath

type ConnectionPath struct {
	ICE                iceconfig.Connection
	ReplacesPeerPathID [16]byte
	OnTURNRecovery     func(turncontrol.RecoveryReason)
}

ConnectionPath carries authenticated handoff ownership into resource admission.

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 NewFactory(config Config) (*Factory, error)

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

type PeerOperationFailure struct {
	Code    uint16
	Message string
}

PeerOperationFailure preserves the exact authenticated operation failure delivered to the browser without retaining provider-controlled error text.

type PeerPhaseTimer

type PeerPhaseTimer interface {
	C() <-chan time.Time
	Stop()
}

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"
	ReceiverDispositionSessionUnavailable ReceiverAttemptDisposition = "session_unavailable"
	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 immutable errors or defensive slice copies, while lifecycle authority remains impossible to manufacture with a public literal.

func (ReceiverAttemptOutcome) BenignComponents

func (outcome ReceiverAttemptOutcome) BenignComponents() []ReceiverBenignCause

func (ReceiverAttemptOutcome) Cause

func (outcome ReceiverAttemptOutcome) Cause() error

func (ReceiverAttemptOutcome) ConsequenceProvenance

func (outcome ReceiverAttemptOutcome) ConsequenceProvenance() ReceiverTerminalProvenance

func (ReceiverAttemptOutcome) DiagnosticsTruncated

func (outcome ReceiverAttemptOutcome) DiagnosticsTruncated() bool

func (ReceiverAttemptOutcome) Disposition

func (outcome ReceiverAttemptOutcome) Disposition() ReceiverAttemptDisposition

func (ReceiverAttemptOutcome) HasRetainedCauseClass

func (outcome ReceiverAttemptOutcome) HasRetainedCauseClass(class ReceiverCauseClass) bool

func (ReceiverAttemptOutcome) LocalGeneration

func (outcome ReceiverAttemptOutcome) LocalGeneration() uint64

func (ReceiverAttemptOutcome) LocallyCanceled

func (outcome ReceiverAttemptOutcome) LocallyCanceled() bool

func (ReceiverAttemptOutcome) OperationID

func (outcome ReceiverAttemptOutcome) OperationID() protocolsession.OperationID

func (ReceiverAttemptOutcome) RecoveryScope

RecoveryScope is imported only from authenticated core termination facts. Arbitrary error strings, wrapped diagnostics and Retryable never authorize recovery.

func (ReceiverAttemptOutcome) RequiresSessionClose

func (outcome ReceiverAttemptOutcome) RequiresSessionClose() bool

func (ReceiverAttemptOutcome) RetainedCause

func (outcome ReceiverAttemptOutcome) RetainedCause() error

func (ReceiverAttemptOutcome) RetainedCauseClasses

func (outcome ReceiverAttemptOutcome) RetainedCauseClasses() []ReceiverCauseClass

func (ReceiverAttemptOutcome) TransitionAuthority

func (outcome ReceiverAttemptOutcome) TransitionAuthority() ReceiverTerminalOwner

func (ReceiverAttemptOutcome) TransitionProvenance

func (outcome 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 bounded, text-free diagnostics for an arbitrary error tree. It deliberately avoids errors.Is so malformed cyclic wrappers cannot recurse without a limit. Session lifetime comes only from the sealed producer 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) 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) (*nativepeer.PreparedAttempt, error)

PrepareBinding waits for process resources without arming signaling/ICE timers.

func (*ReceiverFactory) PrepareConnection

func (factory *ReceiverFactory) PrepareConnection(parent context.Context, lanes ReceiverLaneSession, binding v2signal.Binding, path ConnectionPath) (*nativepeer.PreparedAttempt, error)

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) StartPreparedConnection

func (factory *ReceiverFactory) StartPreparedConnection(parent context.Context, signaling ReceiverSignaling, lanes ReceiverLaneSession, binding v2signal.Binding, prepared *nativepeer.PreparedAttempt, ice iceconfig.Connection) (*ReceiverAttempt, error)

type ReceiverFactoryConfig

type ReceiverFactoryConfig struct {
	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 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 (ReceiverSignalingReceiveResult) Termination

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"
	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 (trace ReceiverTerminationTrace) BenignComponents() []ReceiverBenignCause

func (ReceiverTerminationTrace) ChannelDrainFailed

func (trace ReceiverTerminationTrace) ChannelDrainFailed() bool

func (ReceiverTerminationTrace) ConsequenceProvenance

func (trace ReceiverTerminationTrace) ConsequenceProvenance() ReceiverTerminalProvenance

func (ReceiverTerminationTrace) DiagnosticRecord

func (value ReceiverTerminationTrace) DiagnosticRecord() diag.Record

func (ReceiverTerminationTrace) DiagnosticsTruncated

func (trace ReceiverTerminationTrace) DiagnosticsTruncated() bool

func (ReceiverTerminationTrace) Disposition

func (ReceiverTerminationTrace) LocalGeneration

func (trace ReceiverTerminationTrace) LocalGeneration() uint64

func (ReceiverTerminationTrace) OperationID

func (ReceiverTerminationTrace) PeerShutdownFailed

func (trace ReceiverTerminationTrace) PeerShutdownFailed() bool

func (ReceiverTerminationTrace) RequiresSessionClose

func (trace ReceiverTerminationTrace) RequiresSessionClose() bool

func (ReceiverTerminationTrace) RetainedCauseClasses

func (trace ReceiverTerminationTrace) RetainedCauseClasses() []ReceiverCauseClass

func (ReceiverTerminationTrace) TeardownTransitions

func (trace ReceiverTerminationTrace) TeardownTransitions() []PeerTeardownTransition

func (ReceiverTerminationTrace) TransitionAuthority

func (trace ReceiverTerminationTrace) TransitionAuthority() ReceiverTerminalOwner

func (ReceiverTerminationTrace) TransitionProvenance

func (trace 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 SenderAttemptTermination

type SenderAttemptTermination struct {
	Initiator string
	Cause     string
}

type SenderCandidateCounts

type SenderCandidateCounts struct {
	LocalEmitted   uint32
	RemoteAccepted uint32
}

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"
)

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.

Jump to

Keyboard shortcuts

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