sessionruntime

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package sessionruntime composes the transcript, sole pump/writer, role router, and business services into one owned ProtocolSession lifecycle.

Index

Constants

View Source
const (
	DefaultActiveOperations     = 256
	DefaultOperationTombstones  = 4_096
	SessionStoppedCode          = protocolsession.SessionTerminalCodeLast
	MaximumTerminalMessageBytes = protocolsession.MaxSessionTerminalMessageBytes
)
View Source
const DefaultTerminalCleanupTimeout = 15 * time.Second

Variables

View Source
var (
	ErrLaneUnavailable = errors.New("session runtime has no usable lane")
	ErrLaneStale       = errors.New("session runtime lane epoch is stale")
)
View Source
var (
	ErrOperationMissing     = errors.New("session runtime operation is not active")
	ErrOperationOverflow    = errors.New("session runtime operation response queue is full")
	ErrOperationIDExhausted = errors.New("session runtime operation identity space is exhausted")
)
View Source
var (
	ErrRuntimeConfig = errors.New("session runtime configuration is invalid")
	ErrRuntimeClosed = errors.New("session runtime is closed")
	ErrHandshake     = errors.New("session runtime handshake failed")
	ErrScanProgress  = errors.New("session runtime scan progress changed identity or regressed")
)
View Source
var ErrRemoteLeaseCollision = errors.New("sender reused an active lease identifier")

Functions

This section is empty.

Types

type CatalogScanProgress

type CatalogScanProgress struct {
	DirectoryID       catalog.DirectoryID
	AttemptID         catalog.ScanAttemptID
	DiscoveredEntries uint64
}

type CatalogScanProgressObserver

type CatalogScanProgressObserver interface {
	ObserveCatalogScanProgress(context.Context, CatalogScanProgress) error
}

type CatalogScanProgressObserverFunc

type CatalogScanProgressObserverFunc func(context.Context, CatalogScanProgress) error

func (CatalogScanProgressObserverFunc) ObserveCatalogScanProgress

func (observe CatalogScanProgressObserverFunc) ObserveCatalogScanProgress(
	ctx context.Context,
	progress CatalogScanProgress,
) error

type InitialLaneIDSource

type InitialLaneIDSource interface {
	NextInitialLaneID() (uint32, error)
}

type InitialLaneIDSourceFunc

type InitialLaneIDSourceFunc func() (uint32, error)

func (InitialLaneIDSourceFunc) NextInitialLaneID

func (function InitialLaneIDSourceFunc) NextInitialLaneID() (uint32, error)

type LaneAttachmentGrant

type LaneAttachmentGrant struct {
	LaneID      uint32
	LaneEpoch   uint32
	OperationID protocolsession.OperationID
	AttachNonce [protocolsession.LaneAttachNonceBytes]byte
}

LaneAttachmentGrant is the receiver-visible signed grant content. Expiry is intentionally absent because it is sender-local admission authority and is not carried by the wire body.

type LaneIdentity

type LaneIdentity struct {
	ID    uint32
	Epoch uint32
}

LaneIdentity names one physical FrameChannel incarnation without leaking any provider or path metadata into core. Epoch zero is reserved for the transcript lane; authenticated attachments always use a positive epoch.

type LaneRejectedError

type LaneRejectedError struct {
	Rejection protocolsession.LaneRejection
}

LaneRejectedError is safe to expose only after WS2N's sender signature has been verified against the exact LaneHello digest.

func (*LaneRejectedError) Error

func (err *LaneRejectedError) Error() string

type ReceiverFactory

type ReceiverFactory struct {
	// contains filtered or unexported fields
}

func NewReceiverFactory

func NewReceiverFactory(config ReceiverFactoryConfig) (*ReceiverFactory, error)

func (*ReceiverFactory) BeginClose

func (factory *ReceiverFactory) BeginClose()

BeginClose seals the admission boundary before returning. Existing runtimes remain independent owners of their derived keys and resource leases.

func (*ReceiverFactory) Close

func (factory *ReceiverFactory) Close()

func (*ReceiverFactory) Connect

func (*ReceiverFactory) WaitClosed

func (factory *ReceiverFactory) WaitClosed()

type ReceiverFactoryConfig

type ReceiverFactoryConfig struct {
	Descriptor        catalog.ShareDescriptor
	SessionAuthKey    []byte
	SenderPublicKey   ed25519.PublicKey
	CatalogVerifier   catalogflow.ObjectVerifier
	RecordOpener      RecordOpener
	ReassemblyProcess *contentflow.ReassemblyAccount
	ReassemblyShare   *contentflow.ReassemblyAccount
	PlaintextProcess  *transfer.PlaintextBudget
	Random            io.Reader
	ReceiverInstances ReceiverInstanceSource
	CatalogProgress   CatalogScanProgressObserver
	PeerControls      ReceiverPeerSemantics
	RuntimeResources  ReceiverRuntimeResourceSource
	OperationLimits   protocolsession.OperationLimits
	RouterLimits      protocolsession.RouterLimits
	LaneRaceWidth     int
	Now               func() time.Time
	After             func(time.Duration) <-chan time.Time
}

type ReceiverInstanceSource

type ReceiverInstanceSource interface {
	NewReceiverInstanceID() (protocolsession.ReceiverInstanceID, error)
}

type ReceiverInstanceSourceFunc

type ReceiverInstanceSourceFunc func() (protocolsession.ReceiverInstanceID, error)

func (ReceiverInstanceSourceFunc) NewReceiverInstanceID

func (function ReceiverInstanceSourceFunc) NewReceiverInstanceID() (protocolsession.ReceiverInstanceID, error)

type ReceiverPeerControl

type ReceiverPeerControl struct {
	// contains filtered or unexported fields
}

ReceiverPeerControl is an authenticated sender signaling value. The runtime exposes semantic bytes only after the lane-bound signature and the injected peer schema validator have both succeeded.

func (ReceiverPeerControl) Body

func (control ReceiverPeerControl) Body() []byte

func (ReceiverPeerControl) Kind

type ReceiverPeerDiagnostic

type ReceiverPeerDiagnostic struct {
	// contains filtered or unexported fields
}

func (ReceiverPeerDiagnostic) Code

func (ReceiverPeerDiagnostic) RemoteFailure

func (diagnostic ReceiverPeerDiagnostic) RemoteFailure() (
	RemoteOperationFailureSnapshot,
	bool,
)

type ReceiverPeerDiagnosticCode

type ReceiverPeerDiagnosticCode uint16
const (
	ReceiverPeerDiagnosticOpaqueFailure ReceiverPeerDiagnosticCode = iota + 1
	ReceiverPeerDiagnosticContextCanceled
	ReceiverPeerDiagnosticOperationMissing
	ReceiverPeerDiagnosticRuntimeClosed
	ReceiverPeerDiagnosticOperationOverflow
	ReceiverPeerDiagnosticUnknownControl
	ReceiverPeerDiagnosticControlMalformed
	ReceiverPeerDiagnosticRemoteOperationRejected
	ReceiverPeerDiagnosticRemoteFailureMalformed
	ReceiverPeerDiagnosticRemoteFailureScopeViolation
	ReceiverPeerDiagnosticRemoteAnswerConflict
	ReceiverPeerDiagnosticRemoteFinalConflict
	ReceiverPeerDiagnosticRemoteContinuationAuthorityViolation
	ReceiverPeerDiagnosticCleanupFailed
	ReceiverPeerDiagnosticTruncated
)

type ReceiverPeerDiagnosticSnapshot

type ReceiverPeerDiagnosticSnapshot struct {
	// contains filtered or unexported fields
}

func (ReceiverPeerDiagnosticSnapshot) Components

func (ReceiverPeerDiagnosticSnapshot) Truncated

func (snapshot ReceiverPeerDiagnosticSnapshot) Truncated() bool

type ReceiverPeerOperation

type ReceiverPeerOperation struct {
	// contains filtered or unexported fields
}

ReceiverPeerOperation owns one long-lived PEER_OFFER operation. Answer and candidates are fragments; a remote final, explicit Terminate, or runtime shutdown ends the exact operation object.

func (*ReceiverPeerOperation) MaximumContinuations

func (operation *ReceiverPeerOperation) MaximumContinuations() (int, bool)

func (*ReceiverPeerOperation) OperationID

func (operation *ReceiverPeerOperation) OperationID() protocolsession.OperationID

func (*ReceiverPeerOperation) OwnsTermination

func (operation *ReceiverPeerOperation) OwnsTermination(
	termination ReceiverPeerTermination,
) bool

func (*ReceiverPeerOperation) Receive

func (*ReceiverPeerOperation) SendCandidate

func (operation *ReceiverPeerOperation) SendCandidate(
	ctx context.Context,
	body []byte,
) (protocolsession.OperationDisposition, error)

func (*ReceiverPeerOperation) Terminate

Terminate atomically claims local ownership when the exact operation is still active. If Receive or runtime shutdown already won, it joins that outcome instead. Every caller observes the same accumulated cause after in-flight Receive and exact-call cleanup complete.

type ReceiverPeerReceiveResult

type ReceiverPeerReceiveResult struct {
	// contains filtered or unexported fields
}

ReceiverPeerReceiveResult is an immutable sum: invalid control/terminal combinations cannot be assembled with a public literal or mutable pointer.

func (ReceiverPeerReceiveResult) Control

func (ReceiverPeerReceiveResult) Termination

func (result ReceiverPeerReceiveResult) Termination() (ReceiverPeerTermination, bool)

type ReceiverPeerTerminalAuthority

type ReceiverPeerTerminalAuthority uint8
const (
	ReceiverPeerTerminalAuthorityLocal ReceiverPeerTerminalAuthority
	ReceiverPeerTerminalAuthorityRemote
	ReceiverPeerTerminalAuthorityRuntime
)

type ReceiverPeerTerminalProvenance

type ReceiverPeerTerminalProvenance uint16
const (
	ReceiverPeerProvenanceLocalExplicitStop ReceiverPeerTerminalProvenance
	ReceiverPeerProvenanceLocalContextEnded
	ReceiverPeerProvenanceLocalOperationContract
	ReceiverPeerProvenanceRemoteOperationRejected
	ReceiverPeerProvenanceRemoteUnknownControl
	ReceiverPeerProvenanceRemoteControlMalformed
	ReceiverPeerProvenanceRemoteFailureMalformed
	ReceiverPeerProvenanceRemoteFailureScopeViolation
	ReceiverPeerProvenanceRemoteAnswerConflict
	ReceiverPeerProvenanceRemoteFinalConflict
	ReceiverPeerProvenanceRemoteContinuationAuthorityViolation
	ReceiverPeerProvenanceRuntimeStopping
)

type ReceiverPeerTerminalSeverity

type ReceiverPeerTerminalSeverity uint8
const (
	ReceiverPeerTerminalOperationOnly ReceiverPeerTerminalSeverity
	ReceiverPeerTerminalSessionUnavailable
	ReceiverPeerTerminalSessionUnsafe
)

type ReceiverPeerTermination

type ReceiverPeerTermination struct {
	// contains filtered or unexported fields
}

ReceiverPeerTermination is a sealed value. Diagnostics cannot manufacture authority, and a termination is valid only for the exact operation token that published it after receive and cleanup joined.

func (ReceiverPeerTermination) Authority

func (ReceiverPeerTermination) ConsequenceProvenance

func (termination ReceiverPeerTermination) ConsequenceProvenance() ReceiverPeerTerminalProvenance

func (ReceiverPeerTermination) Diagnostics

func (termination ReceiverPeerTermination) Diagnostics() ReceiverPeerDiagnosticSnapshot

func (ReceiverPeerTermination) Severity

func (ReceiverPeerTermination) TransitionProvenance

func (termination ReceiverPeerTermination) TransitionProvenance() ReceiverPeerTerminalProvenance

type ReceiverRuntime

type ReceiverRuntime struct {
	// contains filtered or unexported fields
}

func (*ReceiverRuntime) AttachLane

func (runtime *ReceiverRuntime) AttachLane(
	ctx context.Context,
	grant LaneAttachmentGrant,
	channel protocolsession.FrameChannel,
) (LaneIdentity, error)

AttachLane authenticates a connectivity-owned FrameChannel as exactly the granted LaneID/Epoch, then makes it available to both the shared router and the receiver-scoped LaneSet. Provider, path, and cost remain outside core.

func (*ReceiverRuntime) AttachedLanes

func (runtime *ReceiverRuntime) AttachedLanes() int

func (*ReceiverRuntime) BeginClose

func (runtime *ReceiverRuntime) BeginClose()

func (*ReceiverRuntime) BlockBroker

func (runtime *ReceiverRuntime) BlockBroker() *transfer.BlockBroker

func (*ReceiverRuntime) Catalog

func (runtime *ReceiverRuntime) Catalog() *catalogflow.Client

func (*ReceiverRuntime) Close

func (runtime *ReceiverRuntime) Close()

func (*ReceiverRuntime) Descriptor

func (runtime *ReceiverRuntime) Descriptor() catalog.ShareDescriptor

func (*ReceiverRuntime) DetachLane

func (runtime *ReceiverRuntime) DetachLane(identity LaneIdentity) bool

func (ReceiverRuntime) Done

func (runtime ReceiverRuntime) Done() <-chan struct{}

func (ReceiverRuntime) Err

func (runtime ReceiverRuntime) Err() error

func (ReceiverRuntime) LaneIdentity

func (runtime ReceiverRuntime) LaneIdentity() (uint32, uint32)

func (*ReceiverRuntime) LaneSet

func (runtime *ReceiverRuntime) LaneSet() *transfer.LaneSet

func (*ReceiverRuntime) NewTransferJob

NewTransferJob binds one confirmed receive intent to a single transfer run. The materializer may reopen durable state, but the live protocol session can never derive OperationID from its per-run TransferJobID.

func (*ReceiverRuntime) OpenPeerOperation

func (runtime *ReceiverRuntime) OpenPeerOperation(
	ctx context.Context,
	offer []byte,
) (*ReceiverPeerOperation, error)

func (*ReceiverRuntime) OpenRevision

func (runtime *ReceiverRuntime) OpenRevision(
	ctx context.Context,
	file catalog.FileID,
) (transfer.OpenedRevision, error)

func (ReceiverRuntime) ProtocolSessionID

func (runtime ReceiverRuntime) ProtocolSessionID() protocolsession.ProtocolSessionID

func (*ReceiverRuntime) ReleaseRevision

func (runtime *ReceiverRuntime) ReleaseRevision(ctx context.Context, lease content.LeaseID) error

func (*ReceiverRuntime) RequestLane

func (runtime *ReceiverRuntime) RequestLane(
	ctx context.Context,
	requestedLaneID uint32,
) (LaneAttachmentGrant, error)

RequestLane obtains the one-use sender-signed grant before connectivity opens or attaches a new physical channel.

func (ReceiverRuntime) Stopping

func (runtime ReceiverRuntime) Stopping() bool

func (*ReceiverRuntime) WaitClosed

func (runtime *ReceiverRuntime) WaitClosed()

type ReceiverRuntimeResourceLease

type ReceiverRuntimeResourceLease interface {
	Release()
}

type ReceiverRuntimeResourceSource

type ReceiverRuntimeResourceSource interface {
	AcquireReceiverRuntimeResources() (ReceiverRuntimeResourceLease, error)
}

type RecordOpener

type RecordOpener interface {
	OpenRevision(catalog.FileID, uint32, []byte) (content.FileRevisionDescriptor, error)
	OpenBlock(content.FileRevisionDescriptor, uint64, []byte) (records.BlockRecord, error)
}

type RemoteOperationError

type RemoteOperationError struct {
	// contains filtered or unexported fields
}

func NewRemoteOperationError

func NewRemoteOperationError(failure RemoteOperationFailureSnapshot) RemoteOperationError

NewRemoteOperationError materializes an immutable diagnostic value from an already-owned snapshot. It carries no terminal authority; consumers obtain session consequences only from a sealed operation termination.

func (RemoteOperationError) Error

func (RemoteOperationError) Error() string

func (RemoteOperationError) Failure

type RemoteOperationFailureSnapshot

type RemoteOperationFailureSnapshot struct {
	// contains filtered or unexported fields
}

func (RemoteOperationFailureSnapshot) Code

func (failure RemoteOperationFailureSnapshot) Code() uint16

func (RemoteOperationFailureSnapshot) Message

func (failure RemoteOperationFailureSnapshot) Message() string

func (RemoteOperationFailureSnapshot) RetryAfter

func (failure RemoteOperationFailureSnapshot) RetryAfter() time.Duration

func (RemoteOperationFailureSnapshot) Retryable

func (failure RemoteOperationFailureSnapshot) Retryable() bool

func (RemoteOperationFailureSnapshot) Scope

func (failure RemoteOperationFailureSnapshot) Scope() uint8

type RemoteRevisionError

type RemoteRevisionError struct {
	// contains filtered or unexported fields
}

RemoteRevisionError retains the authenticated OPEN_RESULTS diagnostic without letting observers mutate the semantic authority already assigned to the job.

func (*RemoteRevisionError) Error

func (err *RemoteRevisionError) Error() string

func (*RemoteRevisionError) Failure

type SenderCatalogFactory

type SenderCatalogFactory interface {
	NewSenderCatalogService() (*catalogflow.AddressedSenderService, error)
}

type SenderCatalogFactoryFunc

type SenderCatalogFactoryFunc func() (*catalogflow.AddressedSenderService, error)

func (SenderCatalogFactoryFunc) NewSenderCatalogService

func (function SenderCatalogFactoryFunc) NewSenderCatalogService() (*catalogflow.AddressedSenderService, error)

type SenderChannelAdmission

type SenderChannelAdmission struct {
	Kind    SenderChannelKind
	Session *SenderRuntime
	Lane    LaneIdentity
}

type SenderChannelKind

type SenderChannelKind uint8
const (
	SenderChannelNewProtocolSession SenderChannelKind = iota + 1
	SenderChannelAttachedLane
)

type SenderContentFactory

type SenderContentFactory interface {
	NewSenderContentService() (*contentflow.SenderService, error)
}

type SenderContentFactoryFunc

type SenderContentFactoryFunc func() (*contentflow.SenderService, error)

func (SenderContentFactoryFunc) NewSenderContentService

func (function SenderContentFactoryFunc) NewSenderContentService() (*contentflow.SenderService, error)

type SenderFactory

type SenderFactory struct {
	// contains filtered or unexported fields
}

func NewSenderFactory

func NewSenderFactory(config SenderFactoryConfig) (*SenderFactory, error)

func (*SenderFactory) Accept

func (factory *SenderFactory) Accept(ctx context.Context, channel protocolsession.FrameChannel) (*SenderRuntime, error)

func (*SenderFactory) ActiveSessions

func (factory *SenderFactory) ActiveSessions() int

func (*SenderFactory) AdmitChannel

func (factory *SenderFactory) AdmitChannel(
	ctx context.Context,
	channel protocolsession.FrameChannel,
) (SenderChannelAdmission, error)

AdmitChannel owns the first-frame dispatch boundary for opaque relay and P2P channels. A valid WS2A can only attach to a still-live ProtocolSession; every other candidate must prove a fresh WS2C transcript before it becomes a new session. Keeping this decision beside both authenticators prevents a transport owner from routing on untrusted session identities.

func (*SenderFactory) Attach

func (factory *SenderFactory) Attach(
	ctx context.Context,
	channel protocolsession.FrameChannel,
) (LaneIdentity, error)

Attach routes an untrusted WS2A only far enough to find its live ProtocolSession. Unknown/malformed candidates are closed without a response; all signed responses remain behind LaneRegistry's traffic-key proof.

func (*SenderFactory) BeginStop

func (factory *SenderFactory) BeginStop(message string) error

BeginStop closes factory admission synchronously, then runs every external callback and bounded join in the terminal worker. This makes it safe for connectivity cleanup to reenter BeginStop without deadlocking its caller.

func (*SenderFactory) Stop

func (factory *SenderFactory) Stop(ctx context.Context, message string) error

func (*SenderFactory) String

func (factory *SenderFactory) String() string

type SenderFactoryConfig

type SenderFactoryConfig struct {
	ShareInstance        catalog.ShareInstance
	SessionAuthKey       []byte
	SenderPrivateKey     ed25519.PrivateKey
	Catalog              SenderCatalogFactory
	Content              SenderContentFactory
	Peers                SenderPeerHandlerFactory
	ReplayGuard          *protocolsession.ClientHelloReplayGuard
	Random               io.Reader
	InitialLaneIDs       InitialLaneIDSource
	OperationLimits      protocolsession.OperationLimits
	RouterLimits         protocolsession.RouterLimits
	Now                  func() time.Time
	TerminalConnectivity TerminalConnectivity
	TerminalTimeout      time.Duration
	TerminalObserver     SenderTerminalObserver
}

type SenderPeerHandler

type SenderPeerHandler interface {
	protocolsession.MessageHandler
	Cancel(context.Context, protocolsession.OperationID) error
	Run(context.Context) error
}

SenderPeerHandler owns provider policy, SDP/ICE interpretation, and physical PeerConnection lifetime outside core. Run must synchronously close all owned attempts before returning so ProtocolSession termination cannot leak peers.

type SenderPeerHandlerFactory

type SenderPeerHandlerFactory interface {
	protocolsession.OperationContinuationClassifier
	NewSenderPeerHandler(SenderPeerSession) (SenderPeerHandler, error)
}

SenderPeerHandlerFactory creates one isolated signaling owner per ProtocolSession. Implementations must not start asynchronous work before Run.

type SenderPeerHandlerFactoryFunc

type SenderPeerHandlerFactoryFunc func(SenderPeerSession) (SenderPeerHandler, error)

func (SenderPeerHandlerFactoryFunc) BeginOperationContinuation

func (SenderPeerHandlerFactoryFunc) ClassifyUnboundOperationContinuation

func (function SenderPeerHandlerFactoryFunc) ClassifyUnboundOperationContinuation(
	protocolsession.MessageKind,
	[]byte,
) (protocolsession.OperationContinuationScope, bool, error)

func (SenderPeerHandlerFactoryFunc) NewSenderPeerHandler

func (function SenderPeerHandlerFactoryFunc) NewSenderPeerHandler(
	session SenderPeerSession,
) (SenderPeerHandler, error)

type SenderPeerSession

SenderPeerSession is the transport-neutral authority granted to one connectivity-owned peer-signaling handler. The handler can emit only the two sender signaling controls and can admit a DataChannel only into the exact ProtocolSession that created it.

type SenderRuntime

type SenderRuntime struct {
	// contains filtered or unexported fields
}

func (*SenderRuntime) AdmitPeerChannel

func (runtime *SenderRuntime) AdmitPeerChannel(
	ctx context.Context,
	channel protocolsession.FrameChannel,
) (LaneIdentity, error)

AdmitPeerChannel binds a connectivity-owned channel to this exact ProtocolSession before parsing its lane proof. A peer negotiation therefore cannot use the factory-wide untrusted route lookup to attach to a sibling receiver session.

func (*SenderRuntime) AttachedLanes

func (runtime *SenderRuntime) AttachedLanes() int

func (*SenderRuntime) BeginClose

func (runtime *SenderRuntime) BeginClose()

func (*SenderRuntime) BeginStop

func (runtime *SenderRuntime) BeginStop(ctx context.Context, message string) error

func (*SenderRuntime) Close

func (runtime *SenderRuntime) Close()

func (*SenderRuntime) DetachLane

func (runtime *SenderRuntime) DetachLane(identity LaneIdentity) bool

func (SenderRuntime) Done

func (runtime SenderRuntime) Done() <-chan struct{}

func (SenderRuntime) Err

func (runtime SenderRuntime) Err() error

func (SenderRuntime) LaneIdentity

func (runtime SenderRuntime) LaneIdentity() (uint32, uint32)

func (*SenderRuntime) LaneRegistry

func (runtime *SenderRuntime) LaneRegistry() *protocolsession.LaneRegistry

func (SenderRuntime) ProtocolSessionID

func (runtime SenderRuntime) ProtocolSessionID() protocolsession.ProtocolSessionID

func (*SenderRuntime) Stop

func (runtime *SenderRuntime) Stop(ctx context.Context, message string) error

func (SenderRuntime) Stopping

func (runtime SenderRuntime) Stopping() bool

func (*SenderRuntime) WaitClosed

func (runtime *SenderRuntime) WaitClosed()

func (*SenderRuntime) WaitStopped

func (runtime *SenderRuntime) WaitStopped(ctx context.Context) error

type SenderTerminalDecision

type SenderTerminalDecision string
const (
	SenderTerminalDecisionDelivered         SenderTerminalDecision = "delivered"
	SenderTerminalDecisionNaturalRetirement SenderTerminalDecision = "natural_retirement"
	SenderTerminalDecisionFailed            SenderTerminalDecision = "failed"
)

type SenderTerminalObservation

type SenderTerminalObservation struct {
	ProtocolSessionID    protocolsession.ProtocolSessionID
	Lane                 LaneIdentity
	Settled              bool
	TransportDisposition SenderTerminalTransportDisposition
	Outcome              SenderTerminalOutcome
	Decision             SenderTerminalDecision
}

SenderTerminalObservation exposes only stable identities and decisions. The terminal body, cryptographic material, and provider-specific error text stay below this boundary so production logs cannot leak share content or keys.

type SenderTerminalObserver

type SenderTerminalObserver interface {
	ObserveSenderTerminal(SenderTerminalObservation)
}

type SenderTerminalObserverFunc

type SenderTerminalObserverFunc func(SenderTerminalObservation)

func (SenderTerminalObserverFunc) ObserveSenderTerminal

func (function SenderTerminalObserverFunc) ObserveSenderTerminal(observation SenderTerminalObservation)

type SenderTerminalOutcome

type SenderTerminalOutcome string
const (
	SenderTerminalOutcomeDelivered SenderTerminalOutcome = "delivered"
	SenderTerminalOutcomeDropped   SenderTerminalOutcome = "dropped"
	SenderTerminalOutcomeUnknown   SenderTerminalOutcome = "unknown"
)

type SenderTerminalTransportDisposition

type SenderTerminalTransportDisposition string
const (
	SenderTerminalTransportAccepted   SenderTerminalTransportDisposition = "accepted"
	SenderTerminalTransportNotReached SenderTerminalTransportDisposition = "not_reached"
	SenderTerminalTransportUnsettled  SenderTerminalTransportDisposition = "unsettled"
	SenderTerminalTransportRejected   SenderTerminalTransportDisposition = "rejected_before_acceptance"
	SenderTerminalTransportRetired    SenderTerminalTransportDisposition = "retired_before_acceptance"
)

type TerminalConnectivity

type TerminalConnectivity interface {
	// StopRecovery must return promptly after preventing new registration or
	// path-recovery work. Existing lanes remain available for terminal delivery
	// until Cleanup runs.
	StopRecovery()
	// Cleanup deregisters every relay route and closes connectivity-owned lanes.
	Cleanup(context.Context) error
}

TerminalConnectivity is defined at the session consumer boundary. Core never learns provider, TURN, relay-node, or path-cost details; it only coordinates monotonic share termination with the owner of those resources.

type TerminalConnectivityFuncs

type TerminalConnectivityFuncs struct {
	StopRecoveryFunc func()
	CleanupFunc      func(context.Context) error
}

func (TerminalConnectivityFuncs) Cleanup

func (functions TerminalConnectivityFuncs) Cleanup(ctx context.Context) error

func (TerminalConnectivityFuncs) StopRecovery

func (functions TerminalConnectivityFuncs) StopRecovery()

Jump to

Keyboard shortcuts

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