Documentation
¶
Overview ¶
Package liveshare composes network-free suite-02 catalog, content, and session runtimes. Native application orchestration belongs to the engine package.
Sender preparation consumes a FileSourceFactory and acquires only the selected roots' metadata. Source references remain private to the adapter; descendants and content are read on demand. The sender joins catalog and content users before closing its source so platform handles and share-use grants remain valid for the full lifetime of every dependent operation.
Callers supply aggregate catalog, content-cache, and revision capacity budgets so simultaneous shares account against one application owner's limits.
Index ¶
- type DirectoryScanAdmission
- type DirectoryScanAdmissionFunc
- type FileSource
- type FileSourceContext
- type FileSourceFactory
- type FileSourceFactoryFunc
- type PreparedReceiver
- func (receiver *PreparedReceiver) BeginClose()
- func (receiver *PreparedReceiver) Close()
- func (receiver *PreparedReceiver) Connect(ctx context.Context, channel framechannel.Channel, route transferlanes.Route) (*receiversession.Runtime, error)
- func (receiver *PreparedReceiver) Descriptor() catalog.ShareDescriptor
- func (receiver *PreparedReceiver) WaitClosed()
- type PreparedSender
- func (sender *PreparedSender) AuthorizeRegistration() error
- func (sender *PreparedSender) Capability() link.Link
- func (sender *PreparedSender) Close() error
- func (sender *PreparedSender) NewRuntimeFactory(config RuntimeFactoryConfig) (*sendersession.Factory, error)
- func (sender *PreparedSender) Registration() RegistrationMaterial
- func (sender *PreparedSender) SelectedRootSummary() SelectedRootSummary
- func (sender *PreparedSender) StartRootPrefetch()
- func (sender *PreparedSender) Stop() error
- type ReceiveCapacity
- type ReceiveCapacityLimits
- type ReceiverConfig
- type RegistrationMaterial
- type RootPrefetchDecision
- type RootPrefetchTrace
- type RootPrefetchTraceFunc
- type RootPrefetchTracer
- type RuntimeFactoryConfig
- type SelectedRootDisplay
- type SelectedRootKind
- type SelectedRootSummary
- type SenderConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirectoryScanAdmission ¶
type DirectoryScanAdmission interface {
AdmitDirectoryScan(context.Context, catalog.ScanRequest) error
}
DirectoryScanAdmission lets the sender assembly impose request-scoped admission before filesystem enumeration. It intentionally receives the immutable catalog request but no filesystem source authority.
type DirectoryScanAdmissionFunc ¶
type DirectoryScanAdmissionFunc func(context.Context, catalog.ScanRequest) error
func (DirectoryScanAdmissionFunc) AdmitDirectoryScan ¶
func (admit DirectoryScanAdmissionFunc) AdmitDirectoryScan( ctx context.Context, request catalog.ScanRequest, ) error
type FileSource ¶
type FileSource interface {
catalog.DirectoryScanner
content.RevisionSource
SelectedRoots() []catalog.NodeRecord
Close() error
}
FileSource owns the selected scope's handles and grant-use leases. Selected roots require publishable metadata; unknown sizes and unsupported stable range reads fail explicitly rather than publishing guessed metadata. Descendants and content are accessed only on demand. StableFile handles own their own Close.
type FileSourceContext ¶
type FileSourceContext struct {
SyntheticRoot catalog.DirectoryID
NewIdentity func() ([catalog.IdentityBytes]byte, error)
Diagnostics diagnostics.Sink
Omissions catalog.SourceOmissionObserver
}
type FileSourceFactory ¶
type FileSourceFactory interface {
OpenFileSource(context.Context, FileSourceContext) (FileSource, error)
}
FileSourceFactory binds a selection to one share. PrepareSender owns every non-nil returned source, including one returned alongside an error. A factory must release partially acquired resources when it cannot return an owner.
type FileSourceFactoryFunc ¶
type FileSourceFactoryFunc func(context.Context, FileSourceContext) (FileSource, error)
func (FileSourceFactoryFunc) OpenFileSource ¶
func (factory FileSourceFactoryFunc) OpenFileSource(ctx context.Context, sourceContext FileSourceContext) (FileSource, error)
type PreparedReceiver ¶
type PreparedReceiver struct {
// contains filtered or unexported fields
}
func PrepareReceiver ¶
func PrepareReceiver(config ReceiverConfig) (*PreparedReceiver, error)
func (*PreparedReceiver) BeginClose ¶
func (receiver *PreparedReceiver) BeginClose()
BeginClose freezes both facade and handshake admission before returning, then delegates blocking joins to a worker so dependency callbacks can reenter it.
func (*PreparedReceiver) Close ¶
func (receiver *PreparedReceiver) Close()
Close is the owner-side join. Dependency callbacks must call BeginClose so they do not wait for the admission whose cleanup invoked them.
func (*PreparedReceiver) Connect ¶
func (receiver *PreparedReceiver) Connect(ctx context.Context, channel framechannel.Channel, route transferlanes.Route) (*receiversession.Runtime, error)
func (*PreparedReceiver) Descriptor ¶
func (receiver *PreparedReceiver) Descriptor() catalog.ShareDescriptor
func (*PreparedReceiver) WaitClosed ¶
func (receiver *PreparedReceiver) WaitClosed()
type PreparedSender ¶
type PreparedSender struct {
// contains filtered or unexported fields
}
func PrepareSender ¶
func PrepareSender(ctx context.Context, config SenderConfig) (*PreparedSender, error)
func (*PreparedSender) AuthorizeRegistration ¶
func (sender *PreparedSender) AuthorizeRegistration() error
func (*PreparedSender) Capability ¶
func (sender *PreparedSender) Capability() link.Link
func (*PreparedSender) Close ¶
func (sender *PreparedSender) Close() error
Close is the external ownership boundary. Dependency callbacks call Stop; synchronously joining the teardown worker from inside it cannot make progress.
func (*PreparedSender) NewRuntimeFactory ¶
func (sender *PreparedSender) NewRuntimeFactory(config RuntimeFactoryConfig) (*sendersession.Factory, error)
func (*PreparedSender) Registration ¶
func (sender *PreparedSender) Registration() RegistrationMaterial
func (*PreparedSender) SelectedRootSummary ¶
func (sender *PreparedSender) SelectedRootSummary() SelectedRootSummary
SelectedRootSummary returns the display-only selection fact frozen from the root records opened during preparation. It remains valid after Close because reading it neither reopens caller paths nor depends on retained filesystem authority.
func (*PreparedSender) StartRootPrefetch ¶
func (sender *PreparedSender) StartRootPrefetch()
StartRootPrefetch is intentionally separate from preparation and registration authorization. The share owner schedules it after publishing service readiness, so descendant scans cannot become a prerequisite for delivering the capability.
func (*PreparedSender) Stop ¶
func (sender *PreparedSender) Stop() error
Stop synchronously freezes admission, then transfers teardown to one worker.
type ReceiveCapacity ¶
type ReceiveCapacity struct {
// contains filtered or unexported fields
}
ReceiveCapacity belongs to the application owner. Receivers borrow it across connection generations and retire only their own reservations and caches.
func NewReceiveCapacity ¶
func NewReceiveCapacity(limits ReceiveCapacityLimits) (*ReceiveCapacity, error)
func (*ReceiveCapacity) Close ¶
func (capacity *ReceiveCapacity) Close() error
type ReceiveCapacityLimits ¶
type ReceiveCapacityLimits struct {
Reassembly contentflow.ReassemblyLimits
PlaintextBytes uint64
}
type ReceiverConfig ¶
type ReceiverConfig struct {
Capacity *ReceiveCapacity
ContentRoutePolicy transferlanes.ContentRoutePolicy
Capability link.Link
DescriptorObject []byte
Random io.Reader
CatalogProgress receiversession.CatalogScanProgressObserver
PeerControls receiversession.PeerSemantics
ProtocolObservations observationstream.Producer[sessionobs.ProtocolObservation]
LaneSettlementObservationCapacity transferlanes.SettlementObservationCapacity
}
type RegistrationMaterial ¶
type RegistrationMaterial struct {
PKHash []byte
Descriptor []byte
SenderPrivateKey ed25519.PrivateKey
}
type RootPrefetchDecision ¶
type RootPrefetchDecision uint8
const ( RootPrefetchAttemptStarted RootPrefetchDecision = iota + 1 RootPrefetchYieldedToDemand RootPrefetchRetryScheduled RootPrefetchCommitted RootPrefetchBudgetFailed RootPrefetchScanFailed RootPrefetchStopped )
func (RootPrefetchDecision) DiagnosticName ¶
func (value RootPrefetchDecision) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
func (RootPrefetchDecision) String ¶
func (decision RootPrefetchDecision) String() string
type RootPrefetchTrace ¶
type RootPrefetchTrace struct {
Decision RootPrefetchDecision
DirectoryID catalog.DirectoryID
Generation catalog.DirectoryGeneration
Attempt uint64
EntryCount uint64
OmittedCount uint64
}
RootPrefetchTrace intentionally excludes paths and entry names. Stable catalog identities and bounded counters are sufficient to reconstruct why an optional warm-up yielded, failed, or committed.
func (RootPrefetchTrace) DiagnosticRecord ¶
func (v RootPrefetchTrace) DiagnosticRecord() diag.Record
type RootPrefetchTraceFunc ¶
type RootPrefetchTraceFunc func(RootPrefetchTrace)
func (RootPrefetchTraceFunc) TraceRootPrefetch ¶
func (function RootPrefetchTraceFunc) TraceRootPrefetch(event RootPrefetchTrace)
type RootPrefetchTracer ¶
type RootPrefetchTracer interface {
TraceRootPrefetch(RootPrefetchTrace)
}
type RuntimeFactoryConfig ¶
type RuntimeFactoryConfig struct {
TerminalConnectivity sendersession.TerminalConnectivity
PeerHandlers sendersession.PeerHandlerFactory
TransferActivity contentflow.TransferActivity
TerminalSendObserver sessionobs.SenderTerminalSendObserver
SessionTerminalObserver sessionobs.SenderSessionTerminalObserver
ProtocolObservations observationstream.Producer[sessionobs.ProtocolObservation]
}
type SelectedRootDisplay ¶
type SelectedRootDisplay struct {
// contains filtered or unexported fields
}
SelectedRootDisplay is a display-only value. Its name is intentionally available to human output and must not be copied into diagnostic traces.
func (SelectedRootDisplay) FileSize ¶
func (root SelectedRootDisplay) FileSize() (uint64, bool)
FileSize distinguishes a zero-byte file from a directory. Directory sizes would imply descendant discovery, which sender preparation never performs.
func (SelectedRootDisplay) Kind ¶
func (root SelectedRootDisplay) Kind() SelectedRootKind
func (SelectedRootDisplay) Name ¶
func (root SelectedRootDisplay) Name() string
type SelectedRootKind ¶
type SelectedRootKind uint8
SelectedRootKind is deliberately narrower than catalog.NodeKind: a prepared sender can expose only a file or directory as a user-selected root.
const ( SelectedRootKindUnknown SelectedRootKind = iota SelectedRootKindDirectory SelectedRootKindFile )
type SelectedRootSummary ¶
type SelectedRootSummary struct {
// contains filtered or unexported fields
}
SelectedRootSummary is an immutable projection of the root records already opened by osfs. Multiple selections expose only their count so constructing the summary cannot accidentally turn into per-root or descendant work.
func (SelectedRootSummary) SelectedCount ¶
func (summary SelectedRootSummary) SelectedCount() uint64
func (SelectedRootSummary) SingleRoot ¶
func (summary SelectedRootSummary) SingleRoot() (SelectedRootDisplay, bool)
type SenderConfig ¶
type SenderConfig struct {
Source FileSourceFactory
Relays []string
ChunkSize uint32
Random io.Reader
Now func() time.Time
ScanAdmission DirectoryScanAdmission
RootPrefetchTracer RootPrefetchTracer
RevisionTracer content.RevisionTracer
CapacityTracer content.CapacityTracer
RevisionCapacity *content.HandlePool
CatalogBudget *catalog.BudgetAccount
CacheBudget *contentflow.ProcessCacheBudget
// contains filtered or unexported fields
}