Documentation
¶
Overview ¶
Package engine is WindShare's native application boundary. An Engine owns aggregate resource limits while each task owns its connections, selected source or output, cancellation, and final settlement.
ResolveReceiveLink accepts a URL and optional separate key before task admission. Clients handle ErrReceiveKeyRequired with their own input UI; link validation and key-conflict decisions are shared by native and RPC callers.
StartShare and StartReceive return tasks whose bounded observation streams never control execution. Wait returns the durable final result only after the workflow has stopped producers and released resources. Cancel stops one task; ShareTask.StopShare explicitly stops a share; Close stops all tasks and closes the instance's capacity owner.
TaskResult retains the authoritative Settlement and diagnostic causes. DescribeFailure projects errors into privacy-safe domain Failure codes for UI and CLI presentation. Value contains workflow details; errors.As can recover a structured ReceiveFailure from Err even without a low-level cause. A nil Wait error means the result was retrieved, not that the operation succeeded. StopReason records intent independently of the outcome.
Observations expose direct engine workflow events (which also implement core/diagnostics.Source). Optional request Diagnostics sinks carry source-owned records separately, with engine, task and workflow scope. Hosts drain and close their bounded diagnostic stream after tasks stop; overflow or a closed sink never changes task settlement. Clients own formatting and exit codes; injected ports keep native objects out of the application API.
ShareTask.Ready retains first service readiness: at least one relay registered and local session admission started. Clients own capability presentation and stop the share if presentation fails. Directory prefetch follows readiness in the background; relay availability and active sessions evolve independently.
Output and recovery ports are platform-neutral; hosts assemble osfs through adapters/filesystem. Provider-owned diagnostic events retain native detail.
InspectRecovery returns listed operation identities after releasing destination leases. RecoveryInventory.Discard reacquires output authority and rechecks those identities before changing owned state, so a prompt holds no destination lease.
Index ¶
- Constants
- Variables
- func ResolveReceiveLink(input ReceiveLinkInput) (link.Link, error)
- type Clock
- type Config
- type ConnectivityPolicy
- type ContentPath
- type ContentPathSelected
- type Engine
- func (engine *Engine) Accounts() *account.Service
- func (engine *Engine) CancelRelaySetup(ctx context.Context, address string) error
- func (engine *Engine) Close(ctx context.Context) error
- func (application *Engine) InspectRecovery(ctx context.Context, authority RecoveryAuthority) (*RecoveryInventory, error)
- func (engine *Engine) NetworkUnavailability() *NetworkUnavailableError
- func (engine *Engine) StartReceive(ctx context.Context, request ReceiveRequest) (*ReceiveTask, error)
- func (engine *Engine) StartRelaySetup(ctx context.Context, request RelaySetupRequest) (*Task[RelaySetupResult], error)
- func (engine *Engine) StartShare(ctx context.Context, request ShareRequest) (*ShareTask, error)
- type Event
- type Failure
- type FailureClass
- type FailureCode
- type Fallback
- type LaneAdopted
- type LifecycleObservation
- type NameAdjustment
- type NameAdjustmentSummary
- type NetworkBlockingReason
- type NetworkUnavailableError
- type Observation
- type Outcome
- type OutputAuthority
- type OutputConfig
- type OutputFactory
- type OutputFactoryFunc
- type OutputLookup
- type OutputLookupKind
- type OutputOperation
- type OutputReservation
- type PreparedShare
- type ReceiveAdmissionObserved
- type ReceiveAdmissionTerminalOwner
- type ReceiveAdmissionTrigger
- type ReceiveClock
- type ReceiveConnection
- type ReceiveContentPath
- type ReceiveDependencies
- type ReceiveDialRequest
- type ReceiveFailure
- type ReceiveFailureCode
- type ReceiveGenerationChanged
- type ReceiveLinkInput
- type ReceiveLocalFailure
- type ReceiveLocalStopReason
- type ReceiveOutputAdmission
- type ReceivePause
- type ReceivePeerAttempt
- type ReceivePeerDisposition
- type ReceivePeerOutcome
- type ReceivePeerStarter
- type ReceiveProgressRetention
- type ReceiveRecoveryAction
- type ReceiveRecoveryOutcome
- type ReceiveRecoveryReason
- type ReceiveRecoverySettings
- type ReceiveRequest
- type ReceiveResult
- type ReceiveSettlementInput
- type ReceiveShareStopSource
- type ReceiveTask
- type ReceiveTicker
- type RecoveryAttentionReason
- type RecoveryAuthority
- type RecoveryBlockedItem
- type RecoveryBlockedReason
- type RecoveryClock
- type RecoveryDiscardReport
- type RecoveryDiscardResult
- type RecoveryDiscardStatus
- type RecoveryFailure
- type RecoveryFailureDetail
- type RecoveryFailureKind
- type RecoveryInventory
- func (inventory *RecoveryInventory) CheckDiscard(id receivecontract.OperationID) *RecoveryFailure
- func (inventory *RecoveryInventory) Discard(ctx context.Context, id receivecontract.OperationID) RecoveryDiscardResult
- func (inventory *RecoveryInventory) DiscardRestriction() *RecoveryFailure
- func (inventory *RecoveryInventory) Observations() <-chan Observation
- func (inventory *RecoveryInventory) Snapshot() (RecoverySnapshot, error)
- type RecoveryObservation
- type RecoveryOperation
- type RecoveryOperationState
- type RecoveryPhase
- type RecoverySnapshot
- type RelayAvailability
- type RelayConnected
- type RelayOrigin
- type RelayRecovery
- type RelayRecoveryState
- type RelaySetupProgress
- type RelaySetupRequest
- type RelaySetupResult
- type RelayWaitReason
- type SelectionCollision
- type ShareAuthorization
- type ShareAuthorizationKind
- type ShareDependencies
- type SharePeers
- type ShareReady
- type ShareRelayCandidate
- type ShareRelays
- type ShareRequest
- type ShareResult
- type ShareSessionFactory
- type ShareSnapshot
- type ShareSourceOmissions
- type ShareStartupState
- type ShareTask
- type SleepInhibitor
- type SourceOmissions
- type StopReason
- type Task
- func (current *Task[T]) Cancel()
- func (current *Task[T]) Changes() <-chan struct{}
- func (current *Task[T]) Done() <-chan struct{}
- func (current *Task[T]) ID() TaskID
- func (current *Task[T]) Observations() <-chan Observation
- func (current *Task[T]) State() TaskState
- func (current *Task[T]) Wait(ctx context.Context) (TaskResult[T], error)
- type TaskCompletion
- type TaskID
- type TaskLifecycle
- type TaskResult
- type TaskSettlement
- type TaskState
- type TransferProgress
- type Transport
- type UnreleasedResourcesError
- type Warning
Constants ¶
const ( DefaultCleanupTimeout = 20 * time.Second DefaultObservationCapacity observationstream.Capacity = 256 )
const ( NetworkUnprovisioned = networkdirectory.Unprovisioned NetworkInvalidConfiguration = networkdirectory.InvalidConfiguration NetworkTrustStateUnreadable = networkdirectory.TrustStateUnreadable NetworkTrustStateInvalid = networkdirectory.TrustStateInvalid NetworkTrustStateUnwritable = networkdirectory.TrustStateUnwritable NetworkNoRelayCandidates = networkruntime.NoRelayCandidates )
const ( ReceiveRecoveryExit = receive.RecoveryExit ReceiveRecoveryRetry = receive.RecoveryRetry ReceiveRecoveryDiscard = receive.RecoveryDiscard ReceiveRecoveryTransferFailure = receive.RecoveryTransferFailure ReceiveRecoveryCollision = receive.RecoveryCollision ReceiveRecoveryOwnershipUnknown = receive.RecoveryOwnershipUnknown ReceiveRecoveryRevisionChanged = receive.RecoveryRevisionChanged ReceiveRecoverySelectionMissing = receive.RecoverySelectionMissing ReceiveRecoverySourceOmitted = receive.RecoverySourceOmitted ReceiveRecoveryInvalidRequest = receive.RecoveryInvalidRequest ReceiveRecoveryNeedsInspection = receive.RecoveryNeedsInspection ReceiveRetentionNone = receive.RetentionNone ReceiveRetentionCheckpoints = receive.RetentionCheckpoints ReceiveRetentionDiscarded = receive.RetentionDiscarded )
const ( ReceiveCreateOrResume = receive.OutputCreateOrResume ReceiveResumeExisting = receive.OutputResumeExisting ReceiveRedownload = receive.OutputRedownload )
const ( ConnectivityAuto = receive.ConnectivityAuto ConnectivityRelayOnly = receive.ConnectivityRelayOnly ConnectivityP2POnly = receive.ConnectivityP2POnly ReceivePeerFallbackAllowed = receive.PeerFallbackAllowed ReceivePeerSessionUnsafe = receive.PeerSessionUnsafe ReceivePeerLocalStop = receive.PeerLocalStop OutputLookupCreateReady = receive.OutputLookupCreateReady OutputLookupNotFound = receive.OutputLookupNotFound OutputLookupReopened = receive.OutputLookupReopened OutputLookupAlreadyRunning = receive.OutputLookupAlreadyRunning OutputLookupNeedsAttention = receive.OutputLookupNeedsAttention OutputLookupAmbiguous = receive.OutputLookupAmbiguous ReceiveLocalFailureNone = receive.LocalFailureNone ReceiveLocalSelectionMissing = receive.LocalSelectionMissing ReceiveLocalRevisionConflict = receive.LocalRevisionConflict ReceiveLocalCheckpointInvalid = receive.LocalCheckpointInvalid ReceiveLocalOwnedObjectUnknown = receive.LocalOwnedObjectUnknown ReceiveLocalDestinationCollision = receive.LocalDestinationCollision ReceiveLocalSourceOmitted = receive.LocalSourceOmitted )
const ( ReceiveFailureInvalidInput = receive.FailureInvalidInput ReceiveFailureOutputContract = receive.FailureOutputContract ReceiveFailureOutputOperationAlreadyRunning = receive.FailureOutputOperationAlreadyRunning ReceiveFailureOutputNeedsAttention = receive.FailureOutputNeedsAttention ReceiveFailureOutputOwnership = receive.FailureOutputOwnership ReceiveFailureRetainedOutputMissing = receive.FailureRetainedOutputMissing ReceiveFailurePeerConfiguration = receive.FailurePeerConfiguration ReceiveFailurePeerNegotiation = receive.FailurePeerNegotiation ReceiveFailurePeerProtocol = receive.FailurePeerProtocol ReceiveFailurePeerSignaling = receive.FailurePeerSignaling ReceiveFailurePeerStopped = receive.FailurePeerStopped ReceiveLocalStopNone = receive.ReceiverLocalStopNone ReceiveLocalStopCaller = receive.ReceiverLocalStopCaller ReceiveLocalStopOutputAdmission = receive.ReceiverLocalStopOutputAdmission ReceiveLocalStopRuntimeSessionFailure = receive.ReceiverLocalStopRuntimeSessionFailure ReceiveLocalStopNormalCompletion = receive.ReceiverLocalStopNormalCompletion ReceiveContentPathRelay = receive.ContentPathRelay ReceiveContentPathDirect = receive.ContentPathDirect ReceiveContentPathDirectAndRelay = receive.ContentPathDirectAndRelay ReceiveObservationRelay = receive.ObservationRelay ReceiveObservationWebRTC = receive.ObservationWebRTC ReceiveObservationLane = receive.ObservationLane ReceiveObservationNative = receive.ObservationNative ReceiveObservationProtocol = receive.ObservationProtocol ReceiveObservationPeerTermination = receive.ObservationPeerTermination ReceiveObservationPeerDiagnostic = receive.ObservationPeerDiagnostic )
const ( RecoveryInspectStarted = recovery.InspectStarted RecoveryInspectCompleted = recovery.InspectCompleted RecoveryDiscardStarted = recovery.DiscardStarted RecoveryDiscardCompleted = recovery.DiscardCompleted RecoveryIncomplete = recovery.OperationIncomplete RecoveryResumable = recovery.OperationResumable RecoveryCleanupPending = recovery.OperationCleanupPending RecoveryNeedsAttention = recovery.OperationNeedsAttention RecoveryBlockedPublicationUnknown = recovery.BlockedPublicationUnknown RecoveryBlockedCheckpointInvalid = recovery.BlockedCheckpointInvalid RecoveryBlockedOwnedObjectUnknown = recovery.BlockedOwnedObjectUnknown RecoveryBlockedRevisionConflict = recovery.BlockedRevisionConflict RecoveryAttentionNone = recovery.AttentionNone RecoveryAttentionDestination = recovery.AttentionDestination RecoveryAttentionRegistry = recovery.AttentionRegistry RecoveryAttentionLease = recovery.AttentionLease RecoveryAttentionOperation = recovery.AttentionOperation RecoveryAttentionCleanup = recovery.AttentionCleanup RecoveryDiscarded = recovery.Discarded RecoveryDiscardCleanupPending = recovery.DiscardCleanupPending RecoveryDiscardNeedsAttention = recovery.DiscardNeedsAttention RecoveryFailureNeedsAttention = recovery.FailureNeedsAttention RecoveryFailureBusy = recovery.FailureBusy RecoveryFailureChanged = recovery.FailureChanged RecoveryFailureCancelled = recovery.FailureCancelled )
const ( TaskRunning = task.Running TaskStopping = task.Stopping TaskFinished = task.Finished NoStop = task.NoStop Cancelled = task.Cancelled ApplicationClosed = task.ApplicationClosed OutcomeSuccess = task.OutcomeSuccess OutcomePartial = task.OutcomePartial OutcomePaused = task.OutcomePaused OutcomeCancelled = task.OutcomeCancelled OutcomeStopped = task.OutcomeStopped OutcomeFailed = task.OutcomeFailed FailureNone = task.FailureNone FailureLocal = task.FailureLocal FailureNetwork = task.FailureNetwork FailureUsage = task.FailureUsage FailureSourceDrift = task.FailureSourceDrift )
const MaxNameAdjustmentSamples = receive.MaxNameAdjustmentSamples
Variables ¶
var ( ErrInvalidReceiveLink = errors.New("invalid receive link") ErrReceiveKeyRequired = errors.New("receive link requires a key") ErrReceiveKeyConflict = errors.New("receive link keys conflict") ErrUnsupportedReceiveSuite = errors.New("unsupported receive link suite") )
var ErrClosed = errors.New("engine is closed")
var ErrInvalidConnectivityPolicy = receive.ErrInvalidConnectivityPolicy
var ErrInvalidReceiveResult = receive.ErrInvalidResult
var ErrInvalidTaskSettlement = task.ErrInvalidSettlement
var ErrRecoveryBusy = recovery.ErrBusy
var ErrRecoveryContract = recovery.ErrContract
Functions ¶
func ResolveReceiveLink ¶
func ResolveReceiveLink(input ReceiveLinkInput) (link.Link, error)
ResolveReceiveLink performs no I/O: clients can ask for a missing key before creating a task or acquiring output authority. Protocol causes remain available through errors.Is for diagnostics.
Types ¶
type Clock ¶ added in v0.1.5
type Clock interface {
Now() time.Time
// Wait ends when the delay elapses, wake signals a change, or ctx is canceled.
Wait(ctx context.Context, delay time.Duration, wake <-chan struct{}) error
}
Clock keeps task timestamps, sender registrations, and node admissions in the same time domain.
type Config ¶
type Config struct {
Network *networkconfig.Config
// Diagnostics receives engine-scoped infrastructure events (such as
// directory refreshes and frontend health checks) bound with Scope.EngineID.
Diagnostics diagnostics.Sink
RelaySetup relaysetup.Dependencies
Clock Clock
SleepInhibitor SleepInhibitor
Random io.Reader
CleanupTimeout time.Duration
ObservationCapacity observationstream.Capacity
RevisionCapacity content.HandlePoolConfig
CatalogLimits catalog.BudgetLimits
CacheBytes uint64
ReceiveCapacity liveshare.ReceiveCapacityLimits
Receive ReceiveDependencies
}
type ConnectivityPolicy ¶
type ConnectivityPolicy = receive.ConnectivityPolicy
func ParseConnectivityPolicy ¶
func ParseConnectivityPolicy(value string) (ConnectivityPolicy, error)
type ContentPath ¶ added in v0.1.6
type ContentPath string
const ( ContentPathRelay ContentPath = "relay" ContentPathDirect ContentPath = "direct" ContentPathDirectAndRelay ContentPath = "direct_and_relay" )
type ContentPathSelected ¶ added in v0.1.6
type ContentPathSelected struct {
Path ContentPath
}
func (ContentPathSelected) DiagnosticRecord ¶ added in v0.1.6
func (e ContentPathSelected) DiagnosticRecord() diagnostics.Record
func (ContentPathSelected) EngineEvent ¶ added in v0.1.6
func (ContentPathSelected) EngineEvent()
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine owns aggregate capacity across its native operations, independently of other Engines in the process. Once Close begins, task admission stays closed even if a caller stops waiting for shutdown.
func (*Engine) Accounts ¶
Accounts is shared by all official-node registrations owned by this engine. Existing relay registrations keep their original attribution after login.
func (*Engine) CancelRelaySetup ¶
func (*Engine) InspectRecovery ¶
func (application *Engine) InspectRecovery(ctx context.Context, authority RecoveryAuthority) (*RecoveryInventory, error)
func (*Engine) NetworkUnavailability ¶
func (engine *Engine) NetworkUnavailability() *NetworkUnavailableError
NetworkUnavailability reports the default network's current blocking reason and permitted retry time. It neither starts maintenance nor judges explicit relays, which remain independent of the built-in network.
func (*Engine) StartReceive ¶
func (engine *Engine) StartReceive(ctx context.Context, request ReceiveRequest) (*ReceiveTask, error)
func (*Engine) StartRelaySetup ¶
func (engine *Engine) StartRelaySetup(ctx context.Context, request RelaySetupRequest) (*Task[RelaySetupResult], error)
func (*Engine) StartShare ¶
type Failure ¶ added in v0.1.6
type Failure struct {
Code FailureCode
SourcePath string
RelayBaseHint networkendpoint.RelayBaseHint
SelectionCollision *SelectionCollision
Fault transferfault.Fault
RetryAfter time.Duration
}
Failure is the privacy-safe domain failure classification derived from an engine error. It never retains raw provider error text or secret material.
func DescribeFailure ¶
DescribeFailure classifies an engine or adapter error into a stable, privacy-safe Failure value. Returns (zero, false) only when cause is nil.
func FailureFromFault ¶ added in v0.1.6
func FailureFromFault(fault transferfault.Fault) (Failure, bool)
FailureFromFault converts a normalized core transfer fault into an engine Failure.
func (Failure) DiagnosticValue ¶ added in v0.1.6
func (f Failure) DiagnosticValue() diagnostics.Value
type FailureClass ¶
type FailureClass = task.FailureClass
type FailureCode ¶ added in v0.1.6
type FailureCode string
FailureCode is the closed domain error vocabulary exposed by Engine to native hosts and CLI presenters without leaking raw provider error strings.
const ( FailureUnexpected FailureCode = "unexpected" FailureCanceled FailureCode = "canceled" FailureDeadline FailureCode = "deadline" FailureInvalidInput FailureCode = "invalid_input" FailureCapabilityInvalid FailureCode = "capability_invalid" FailureSelectionMissing FailureCode = "selection_missing" FailureSelectionCollision FailureCode = "selection_collision" FailurePublication FailureCode = "capability_publication" FailureAccountStorageError FailureCode = "account_storage_error" FailureRelayRejected FailureCode = "relay_rejected" FailureRelayNotFound FailureCode = "relay_not_found" FailureRelayStopped FailureCode = "relay_stopped" FailureRelayAccessDenied FailureCode = "relay_access_denied" FailureRelayRouteNotFound FailureCode = "relay_route_not_found" FailureDirectAdmission FailureCode = "direct_admission" FailureDirectPolicy FailureCode = "direct_policy" FailureDirectBusy FailureCode = "direct_busy" FailureSourceChanged FailureCode = "source_changed" FailureSourceMissing FailureCode = "source_missing" FailureSourceAccessDenied FailureCode = "source_access_denied" FailureSourceUnsupported FailureCode = "source_unsupported" FailureSourceCloudPlaceholder FailureCode = "source_cloud_placeholder" FailureSourceOmitted FailureCode = "source_omitted" FailureSessionFailed FailureCode = "session_failed" FailureOutputFailed FailureCode = "output_failed" FailureOutputBusy FailureCode = "output_busy" FailureOutputOperationAlreadyRunning FailureCode = "output_operation_already_running" FailureOutputNeedsAttention FailureCode = "output_needs_attention" FailureRetainedOutputMissing FailureCode = "retained_output_missing" FailureDestinationCollision FailureCode = "destination_collision" FailureCheckpointFailed FailureCode = "checkpoint_failed" FailureCheckpointRevisionConflict FailureCode = "checkpoint_revision_conflict" FailureCheckpointInvalid FailureCode = "checkpoint_invalid" FailureOwnedObjectUnknown FailureCode = "owned_object_unknown" )
type Fallback ¶ added in v0.1.6
func (Fallback) DiagnosticRecord ¶ added in v0.1.6
func (e Fallback) DiagnosticRecord() diagnostics.Record
func (Fallback) EngineEvent ¶ added in v0.1.6
func (Fallback) EngineEvent()
type LaneAdopted ¶ added in v0.1.6
type LaneAdopted struct {
Session protocolsession.ProtocolSessionID
Lane session.LaneIdentity
Transport Transport
}
func (LaneAdopted) DiagnosticRecord ¶ added in v0.1.6
func (e LaneAdopted) DiagnosticRecord() diagnostics.Record
func (LaneAdopted) EngineEvent ¶ added in v0.1.6
func (LaneAdopted) EngineEvent()
type LifecycleObservation ¶
LifecycleObservation is retained for management tasks without a transfer workflow.
type NameAdjustment ¶ added in v0.1.6
type NameAdjustment = receive.NameAdjustment
type NameAdjustmentSummary ¶ added in v0.1.6
type NameAdjustmentSummary = receive.NameAdjustmentSummary
type NetworkBlockingReason ¶
type NetworkBlockingReason = networkdirectory.BlockingReason
type NetworkUnavailableError ¶
type NetworkUnavailableError = networkdirectory.UnavailableError
type Observation ¶
type Observation = task.Observation
type OutputAuthority ¶
type OutputAuthority = receive.OutputAuthority
type OutputConfig ¶
type OutputConfig = receive.OutputConfig
type OutputFactory ¶
type OutputFactory = receive.OutputFactory
type OutputFactoryFunc ¶
type OutputFactoryFunc = receive.OutputFactoryFunc
type OutputLookup ¶
type OutputLookup = receive.OutputLookup
type OutputLookupKind ¶
type OutputLookupKind = receive.OutputLookupKind
type OutputOperation ¶
type OutputOperation = receive.OutputOperation
type OutputReservation ¶
type OutputReservation = receive.OutputReservation
type PreparedShare ¶
type ReceiveAdmissionObserved ¶
type ReceiveAdmissionObserved = receive.AdmissionObserved
type ReceiveAdmissionTerminalOwner ¶
type ReceiveAdmissionTerminalOwner = receive.AdmissionTerminalOwner
type ReceiveAdmissionTrigger ¶
type ReceiveAdmissionTrigger = receive.AdmissionTrigger
type ReceiveClock ¶
type ReceiveConnection ¶
type ReceiveConnection interface {
Descriptor() []byte
Channel() protocolsession.FrameChannel
Done() <-chan struct{}
Err() error
Close() error
}
ReceiveConnection transfers one authenticated relay connection's ownership to the task.
type ReceiveContentPath ¶
type ReceiveContentPath = receive.ContentPath
type ReceiveDependencies ¶
type ReceiveDependencies struct {
Clock ReceiveClock
ReceiverDial func(context.Context, ReceiveDialRequest) (ReceiveConnection, error)
Recovery ReceiveRecoverySettings
PeerFactory func() (ReceivePeerStarter, error)
}
type ReceiveDialRequest ¶
type ReceiveFailure ¶
type ReceiveFailureCode ¶
type ReceiveFailureCode = receive.FailureCode
type ReceiveGenerationChanged ¶
type ReceiveGenerationChanged = receive.GenerationChanged
type ReceiveLinkInput ¶
ReceiveLinkInput keeps the separate key explicit so it cannot silently override a different key embedded in the URL.
type ReceiveLocalFailure ¶
type ReceiveLocalFailure = receive.LocalFailure
type ReceiveLocalStopReason ¶
type ReceiveLocalStopReason = receive.ReceiverLocalStopReason
type ReceiveOutputAdmission ¶
type ReceiveOutputAdmission = receive.OutputAdmission
type ReceivePause ¶
type ReceivePeerAttempt ¶
type ReceivePeerAttempt = receive.PeerAttempt
type ReceivePeerDisposition ¶
type ReceivePeerDisposition = receive.PeerDisposition
type ReceivePeerOutcome ¶
type ReceivePeerOutcome = receive.PeerOutcome
func NewReceivePeerOutcome ¶
func NewReceivePeerOutcome(disposition ReceivePeerDisposition, cause error) ReceivePeerOutcome
type ReceivePeerStarter ¶
type ReceivePeerStarter = receive.PeerStarter
type ReceiveProgressRetention ¶
type ReceiveProgressRetention = receive.ProgressRetention
type ReceiveRecoveryAction ¶
type ReceiveRecoveryAction = receive.RecoveryAction
type ReceiveRecoveryOutcome ¶
type ReceiveRecoveryOutcome = receive.RecoveryOutcome
type ReceiveRecoveryReason ¶
type ReceiveRecoveryReason = receive.RecoveryReason
type ReceiveRecoverySettings ¶
type ReceiveRequest ¶
type ReceiveResult ¶
type ReceiveSettlementInput ¶
type ReceiveSettlementInput = receive.SettlementInput
type ReceiveShareStopSource ¶ added in v0.1.5
type ReceiveShareStopSource = receive.ShareStopSource
type ReceiveTask ¶
type ReceiveTask struct{ *Task[ReceiveResult] }
type ReceiveTicker ¶
type RecoveryAttentionReason ¶
type RecoveryAttentionReason = recovery.AttentionReason
type RecoveryAuthority ¶
type RecoveryBlockedItem ¶
type RecoveryBlockedItem = recovery.BlockedItem
type RecoveryBlockedReason ¶
type RecoveryBlockedReason = recovery.BlockedReason
type RecoveryClock ¶
type RecoveryDiscardReport ¶
type RecoveryDiscardReport = recovery.DiscardReport
type RecoveryDiscardResult ¶
type RecoveryDiscardResult = recovery.DiscardResult
type RecoveryDiscardStatus ¶
type RecoveryDiscardStatus = recovery.DiscardStatus
type RecoveryFailure ¶
func RecoveryDestinationFailure ¶
func RecoveryDestinationFailure(err error) *RecoveryFailure
type RecoveryFailureDetail ¶
type RecoveryFailureDetail = recovery.FailureDetail
type RecoveryFailureKind ¶
type RecoveryFailureKind = recovery.FailureKind
type RecoveryInventory ¶
type RecoveryInventory struct {
// contains filtered or unexported fields
}
RecoveryInventory retains only listed identity evidence. The destination is reacquired for each discard, so a prompt never holds a filesystem lease.
func (*RecoveryInventory) CheckDiscard ¶
func (inventory *RecoveryInventory) CheckDiscard(id receivecontract.OperationID) *RecoveryFailure
func (*RecoveryInventory) Discard ¶
func (inventory *RecoveryInventory) Discard(ctx context.Context, id receivecontract.OperationID) RecoveryDiscardResult
func (*RecoveryInventory) DiscardRestriction ¶
func (inventory *RecoveryInventory) DiscardRestriction() *RecoveryFailure
func (*RecoveryInventory) Observations ¶
func (inventory *RecoveryInventory) Observations() <-chan Observation
Observations is complete when InspectRecovery returns. Draining or ignoring this bounded history has no effect on subsequent identity-bound discard.
func (*RecoveryInventory) Snapshot ¶
func (inventory *RecoveryInventory) Snapshot() (RecoverySnapshot, error)
type RecoveryObservation ¶
type RecoveryObservation = recovery.Observation
type RecoveryOperation ¶
type RecoveryOperationState ¶
type RecoveryOperationState = recovery.OperationState
type RecoveryPhase ¶
type RecoverySnapshot ¶
func NewRecoverySnapshot ¶
func NewRecoverySnapshot(operations []RecoveryOperation, registryUnknown bool) (RecoverySnapshot, error)
type RelayAvailability ¶ added in v0.1.6
type RelayAvailability struct {
Available uint32 `json:"available"`
Total uint32 `json:"total"`
EverReady bool `json:"ever_ready"`
Terminal uint32 `json:"terminal"`
}
RelayAvailability reports current relay admission counts for a live share.
func (RelayAvailability) DiagnosticRecord ¶ added in v0.1.6
func (a RelayAvailability) DiagnosticRecord() diagnostics.Record
func (RelayAvailability) EngineEvent ¶ added in v0.1.6
func (RelayAvailability) EngineEvent()
type RelayConnected ¶ added in v0.1.6
type RelayConnected struct {
Origin RelayOrigin
}
func (RelayConnected) DiagnosticRecord ¶ added in v0.1.6
func (e RelayConnected) DiagnosticRecord() diagnostics.Record
func (RelayConnected) EngineEvent ¶ added in v0.1.6
func (RelayConnected) EngineEvent()
type RelayOrigin ¶ added in v0.1.6
type RelayOrigin struct {
Scheme string `json:"scheme"`
Host string `json:"host"`
Port uint16 `json:"port"`
}
RelayOrigin retains only scheme/host/port so logs and UI never see relay paths, query parameters, or embedded credentials.
func NormalizeRelayOrigin ¶
func NormalizeRelayOrigin(raw string) (RelayOrigin, error)
func (RelayOrigin) HostPort ¶ added in v0.1.6
func (o RelayOrigin) HostPort() string
func (RelayOrigin) Valid ¶ added in v0.1.6
func (o RelayOrigin) Valid() bool
type RelayRecovery ¶ added in v0.1.6
type RelayRecovery struct {
Origin RelayOrigin
Attempt uint32
State RelayRecoveryState
Failure *Failure
WaitReason RelayWaitReason
Authorization serviceauthority.AdmissionState
Generation uint64
Slow bool
Resume bool
Terminal bool
NextDelay time.Duration
ProtocolSessionID [16]byte
}
func (RelayRecovery) DiagnosticRecord ¶ added in v0.1.6
func (e RelayRecovery) DiagnosticRecord() diagnostics.Record
func (RelayRecovery) EngineEvent ¶ added in v0.1.6
func (RelayRecovery) EngineEvent()
type RelayRecoveryState ¶ added in v0.1.6
type RelayRecoveryState string
const ( RelayRecoveryStarted RelayRecoveryState = "started" RelayRecoverySucceeded RelayRecoveryState = "succeeded" RelayRecoveryFailed RelayRecoveryState = "failed" RelayRecoveryWaiting RelayRecoveryState = "waiting" )
type RelaySetupProgress ¶
type RelaySetupProgress = relaysetup.Progress
type RelaySetupRequest ¶
type RelaySetupRequest = relaysetup.Request
type RelaySetupResult ¶
type RelaySetupResult = relaysetup.Result
type RelayWaitReason ¶ added in v0.1.6
type RelayWaitReason string
const ( RelayWaitConnection RelayWaitReason = "" RelayWaitBandwidth RelayWaitReason = "bandwidth" )
type SelectionCollision ¶ added in v0.1.6
type ShareAuthorization ¶
type ShareAuthorization struct {
}
type ShareDependencies ¶
type ShareDependencies struct {
}
Dependencies expose construction seams; task control and aggregate budgets are assigned by the Engine so an injected constructor cannot replace another task's ownership.
type SharePeers ¶
type ShareReady ¶
type ShareReady struct {
// AlternateFrontend is set only when the share uses a built-in network
// frontend and another distinct built-in entry exists for the same share.
}
type ShareRelayCandidate ¶
type ShareRelayCandidate = relayprofile.Registration
type ShareRelays ¶
type ShareRequest ¶
type ShareRequest struct {
}
type ShareResult ¶
type ShareSessionFactory ¶
type ShareSessionFactory = share.SessionFactory
type ShareSnapshot ¶
type ShareSnapshot struct {
Result *TaskResult[ShareResult]
}
ShareSnapshot separates retained startup from lifecycle and current relay admission. Existing P2P transfers do not depend on relay availability.
type ShareSourceOmissions ¶ added in v0.1.6
type ShareSourceOmissions struct {
}
ShareSourceOmissions retains the cumulative count and bounded examples of entries skipped across directories discovered so far during a share.
type ShareTask ¶
type ShareTask struct {
*Task[ShareResult]
// contains filtered or unexported fields
}
func (*ShareTask) CancelBeforeReady ¶ added in v0.1.4
CancelBeforeReady reserves cancellation of an unpublished attempt. Once a link is ready, only the ordinary share stop operation can withdraw it.
func (*ShareTask) Ready ¶
func (current *ShareTask) Ready(ctx context.Context) (ShareReady, error)
Ready waits for the first relay registration and local session admission to start. No receiver, P2P connection, or directory scan is required. The retained result is a startup milestone, not a live availability check; canceling this wait does not stop the share. Call StopShare and Wait to stop and join its work.
func (*ShareTask) Snapshot ¶
func (current *ShareTask) Snapshot() ShareSnapshot
type SleepInhibitor ¶ added in v0.1.6
SleepInhibitor prevents idle OS system sleep while active transfers run (display sleep and screen lock remain allowed). Hosts inject platform-native implementations so engine packages remain OS-agnostic.
type SourceOmissions ¶ added in v0.1.6
type SourceOmissions struct {
Summary catalog.SourceOmissions
}
func (SourceOmissions) DiagnosticRecord ¶ added in v0.1.6
func (e SourceOmissions) DiagnosticRecord() diagnostics.Record
func (SourceOmissions) EngineEvent ¶ added in v0.1.6
func (SourceOmissions) EngineEvent()
type StopReason ¶
type StopReason = task.StopReason
type Task ¶
type Task[T any] struct { // contains filtered or unexported fields }
func (*Task[T]) Observations ¶
func (current *Task[T]) Observations() <-chan Observation
type TaskCompletion ¶
type TaskCompletion[T any] = task.Completion[T]
func SettleReceive ¶
func SettleReceive(input ReceiveSettlementInput) (TaskCompletion[ReceiveResult], error)
type TaskLifecycle ¶ added in v0.1.6
type TaskLifecycle struct {
TaskID TaskID
Workflow string
At time.Time
Stage string
StopReason string
Outcome string
FailureClass string
Failure *Failure
CleanupFailure *Failure
}
func (TaskLifecycle) DiagnosticRecord ¶ added in v0.1.6
func (e TaskLifecycle) DiagnosticRecord() diagnostics.Record
func (TaskLifecycle) EngineEvent ¶ added in v0.1.6
func (TaskLifecycle) EngineEvent()
type TaskResult ¶
type TaskSettlement ¶
type TaskSettlement = task.Settlement
type TransferProgress ¶ added in v0.1.6
type TransferProgress struct {
Operation receivecontract.OperationID
Job transfer.TransferJobID
Snapshot transfer.ReceiveProgressSnapshot
CapacityWaitVisible bool
}
func (TransferProgress) DiagnosticRecord ¶ added in v0.1.6
func (e TransferProgress) DiagnosticRecord() diagnostics.Record
func (TransferProgress) EngineEvent ¶ added in v0.1.6
func (TransferProgress) EngineEvent()
type UnreleasedResourcesError ¶
type UnreleasedResourcesError struct {
CatalogUsage catalog.ResourceUsage
CacheBytes uint64
// contains filtered or unexported fields
}
UnreleasedResourcesError identifies authority still charged after all tasks have settled. It prevents an ownership defect from becoming a clean shutdown.
func (*UnreleasedResourcesError) Error ¶
func (failure *UnreleasedResourcesError) Error() string
func (*UnreleasedResourcesError) Unwrap ¶
func (failure *UnreleasedResourcesError) Unwrap() error
type Warning ¶ added in v0.1.6
type Warning struct {
Failure Failure
}
func (Warning) DiagnosticRecord ¶ added in v0.1.6
func (e Warning) DiagnosticRecord() diagnostics.Record
func (Warning) EngineEvent ¶ added in v0.1.6
func (Warning) EngineEvent()
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package account coordinates official-service credentials outside relay handshakes.
|
Package account coordinates official-service credentials outside relay handshakes. |
|
Package builtinnetwork is application wiring, never an engine default.
|
Package builtinnetwork is application wiring, never an engine default. |
|
internal
|
|
|
configjson
Package configjson decodes configuration objects whose member names are case-insensitive, including provider-owned JSON nested in a document.
|
Package configjson decodes configuration objects whose member names are case-insensitive, including provider-owned JSON nested in a document. |
|
nativeconnectivity
Package nativeconnectivity assembles the native peer transport used by application workflows.
|
Package nativeconnectivity assembles the native peer transport used by application workflows. |
|
networkruntime
Package networkruntime assembles directory trust, recent connection facts and frontend health without giving library callers implicit infrastructure.
|
Package networkruntime assembles directory trust, recent connection facts and frontend health without giving library callers implicit infrastructure. |
|
receive
Package receive owns one receive operation across connection generations.
|
Package receive owns one receive operation across connection generations. |
|
share
Package share owns native sender application orchestration.
|
Package share owns native sender application orchestration. |
|
statefile
Package statefile owns private atomic files and recoverable local commits.
|
Package statefile owns private atomic files and recoverable local commits. |
|
task
Package task owns one native operation's cancellation and durable completion.
|
Package task owns one native operation's cancellation and durable completion. |
|
Package networkconfig describes application-injected network and frontend trust.
|
Package networkconfig describes application-injected network and frontend trust. |
|
Package networkdirectory owns signed network snapshots, bounded refresh and durable rollback protection.
|
Package networkdirectory owns signed network snapshots, bounded refresh and durable rollback protection. |
|
Package output owns destination acquisition and receive output contracts.
|
Package output owns destination acquisition and receive output contracts. |
|
Package relayconfig owns saved profiles, active relay selection and frontend choice.
|
Package relayconfig owns saved profiles, active relay selection and frontend choice. |
|
Package relayprofile describes application relay selection and saved service credentials.
|
Package relayprofile describes application relay selection and saved service credentials. |
|
Package relaysetup implements discover, approve and install for native applications.
|
Package relaysetup implements discover, approve and install for native applications. |
|
Package turnissuer resolves the immutable TURN configuration selected by a share.
|
Package turnissuer resolves the immutable TURN configuration selected by a share. |