liveshare

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 34 Imported by: ? modules, 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 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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogStorageCause

type CatalogStorageCause uint8
const (
	CatalogStorageCauseNone CatalogStorageCause = iota
	CatalogStorageCauseCanceled
	CatalogStorageCauseDeadlineExceeded
	CatalogStorageCauseBudgetExceeded
	CatalogStorageCauseUnexpected
)

func (CatalogStorageCause) DiagnosticName

func (value CatalogStorageCause) DiagnosticName() string

DiagnosticName belongs to the source vocabulary; recorders accept new values.

func (CatalogStorageCause) String

func (cause CatalogStorageCause) String() string

type CatalogStorageFactory

type CatalogStorageFactory interface {
	Create(context.Context, catalog.ShareInstance) (catalog.CatalogBackend, error)
}

type CatalogStorageFactoryFunc

type CatalogStorageFactoryFunc func(context.Context, catalog.ShareInstance) (catalog.CatalogBackend, error)

func (CatalogStorageFactoryFunc) Create

type CatalogStorageOperation

type CatalogStorageOperation uint8
const (
	CatalogStorageCreating CatalogStorageOperation = iota + 1
	CatalogStorageCreated
	CatalogStorageRecovering
	CatalogStorageRecovered
	CatalogStorageBudgetRejected
	CatalogStorageCleaning
	CatalogStorageCleaned
)

func (CatalogStorageOperation) DiagnosticName

func (value CatalogStorageOperation) DiagnosticName() string

DiagnosticName belongs to the source vocabulary; recorders accept new values.

func (CatalogStorageOperation) String

func (operation CatalogStorageOperation) String() string

type CatalogStorageTrace

type CatalogStorageTrace struct {
	Operation          CatalogStorageOperation
	ShareInstance      catalog.ShareInstance
	RecoveredUsage     catalog.ResourceUsage
	LegacyRootsRemoved uint64
	Cause              CatalogStorageCause
}

CatalogStorageTrace contains only closed facts. In particular it never retains provider errors, whose text may contain filesystem paths or relay credentials owned by an embedding application.

func (CatalogStorageTrace) DiagnosticRecord

func (v CatalogStorageTrace) DiagnosticRecord() diag.Record

type CatalogStorageTraceFunc

type CatalogStorageTraceFunc func(CatalogStorageTrace)

func (CatalogStorageTraceFunc) TraceCatalogStorage

func (function CatalogStorageTraceFunc) TraceCatalogStorage(event CatalogStorageTrace)

type CatalogStorageTracer

type CatalogStorageTracer interface {
	TraceCatalogStorage(CatalogStorageTrace)
}

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.

A source with handle-only stability must also implement content.RevisionContinuitySource; omitting it asserts catalog continuity.

type FileSourceContext

type FileSourceContext struct {
	ShareInstance catalog.ShareInstance
	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 (*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 {
	ShareID          []byte
	ShareInstance    []byte
	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
	ShareInstance catalog.ShareInstance
	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
	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 (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
	CatalogStorage     CatalogStorageFactory
	CatalogTracer      CatalogStorageTracer
	RootPrefetchTracer RootPrefetchTracer
	RevisionTracer     content.RevisionTracer
	CapacityTracer     revisioncapacity.Tracer
	RevisionCapacity   *revisioncapacity.Coordinator
	CatalogBudget      *catalog.BudgetAccount
	CacheBudget        *contentflow.ProcessCacheBudget
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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