Documentation
¶
Overview ¶
Package share owns native sender application orchestration.
Index ¶
- Variables
- func PlannedRelays(plan relayplan.Plan, observeFallback func(relayset.Fallback)) func(context.Context, []string, relayset.SenderFactory) (Relays, error)
- func Run(ctx context.Context, request Request, dependencies Dependencies) task.Completion[Result]
- type Controller
- func (c *Controller) CancelBeforeReady(cancel func()) bool
- func (c *Controller) Ready(ctx context.Context) (Ready, error)
- func (c *Controller) RecordSourceOmissions(summary catalog.SourceOmissions) bool
- func (c *Controller) RelayStatus() (relayset.SenderStatus, bool)
- func (c *Controller) SourceOmissions() (SourceOmissionSummary, bool)
- func (c *Controller) Startup() (Ready, error, bool)
- type Dependencies
- type Milestone
- type Observation
- type ObservationLoss
- type ObservationSource
- type Peers
- type Prepared
- type Ready
- type Relay
- type RelayRecovery
- type Relays
- type Request
- type Result
- type SessionFactory
- type SleepInhibitor
- type SourceOmissionSummary
- type SourceOmissionsObserved
Constants ¶
This section is empty.
Variables ¶
var ErrConfiguration = errors.New("invalid share workflow configuration")
var ErrInvalidChunkSize = errors.New("invalid share block size")
Functions ¶
func PlannedRelays ¶ added in v0.1.6
func Run ¶
func Run(ctx context.Context, request Request, dependencies Dependencies) task.Completion[Result]
Run returns only after every borrower has released source and key authority.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller retains the first service-ready result independently of diagnostic delivery and caller presentation. Closing readyDone publishes immutable state.
func NewController ¶
func NewController() *Controller
func (*Controller) CancelBeforeReady ¶ added in v0.1.4
func (c *Controller) CancelBeforeReady(cancel func()) bool
CancelBeforeReady arbitrates a replacement against the first publication. The old task can still be joined normally after its startup is withdrawn.
func (*Controller) RecordSourceOmissions ¶ added in v0.1.6
func (c *Controller) RecordSourceOmissions(summary catalog.SourceOmissions) bool
RecordSourceOmissions records one committed directory's omissions at most once per non-zero DirectoryID, keeping samples bounded for UI summaries.
func (*Controller) RelayStatus ¶ added in v0.1.4
func (c *Controller) RelayStatus() (relayset.SenderStatus, bool)
RelayStatus reads the relay owner independently of observation delivery.
func (*Controller) SourceOmissions ¶ added in v0.1.6
func (c *Controller) SourceOmissions() (SourceOmissionSummary, bool)
SourceOmissions returns the authoritative omission summary when any item has been skipped across discovered directories.
type Dependencies ¶
type Dependencies struct {
TURNProvider turnsession.Provider
Clock relayset.Clock
Control task.Control
Controller *Controller
RevisionCapacity *content.HandlePool
CatalogBudget *catalog.BudgetAccount
CacheBudget *contentflow.ProcessCacheBudget
Connectivity *nativeconnectivity.Capacity
ICEPool func() icepolicy.ICEEndpointPool
SleepInhibitor SleepInhibitor
Prepare func(context.Context, liveshare.SenderConfig) (Prepared, error)
Relays func(context.Context, []string, relayset.SenderFactory) (Relays, error)
Relay func(relayset.SenderLifecycleConfig) (Relay, error)
Peers func(nativeconnectivity.SenderConfig) (Peers, error)
PollNetwork func(context.Context, func())
Attempts func(string) relayset.AttemptControl
ObserveAttempt func(string, relayset.Attempt)
}
type Observation ¶
type Observation struct {
Milestone Milestone
Session protocolsession.ProtocolSessionID
Failure error
RelayRecovery *RelayRecovery
RelayAvailability *relayset.SenderAvailability
}
func (Observation) DiagnosticRecord ¶
func (value Observation) DiagnosticRecord() diagnostics.Record
func (Observation) EngineEvent ¶
func (Observation) EngineEvent()
type ObservationLoss ¶
type ObservationLoss struct {
Source ObservationSource
Dropped uint64
}
type ObservationSource ¶
type ObservationSource string
const ( ProtocolObservations ObservationSource = "protocol" NativeObservations ObservationSource = "native" RelayObservations ObservationSource = "relay" WebRTCObservations ObservationSource = "webrtc" SenderAttempts ObservationSource = "peer_attempt" PeerDiagnostics ObservationSource = "peer_diagnostic" )
type Peers ¶
type Peers interface {
sendersession.PeerHandlerFactory
Close(context.Context) error
}
type Prepared ¶
type Prepared interface {
AuthorizeRegistration() error
Registration() liveshare.RegistrationMaterial
Capability() link.Link
SelectedRootSummary() liveshare.SelectedRootSummary
NewRuntimeFactory(liveshare.RuntimeFactoryConfig) (SessionFactory, error)
// StartRootPrefetch schedules optional work without waiting for a scan.
StartRootPrefetch()
Close() error
}
Prepared makes preparation and shutdown independently testable while the production adapter keeps the sender's unique runtime-factory authority.
type Ready ¶
type Ready struct {
Capability link.Link
SelectedRootSummary liveshare.SelectedRootSummary
RelayEndpoint v2.RelayEndpoint
Registrations relayset.SenderRegistrations
}
type Relay ¶
type Relay interface {
relayset.SenderEndpoint
CompleteObservations() relayv2.LifecycleObservationCompletion
}
type RelayRecovery ¶
type RelayRecovery struct {
Endpoint v2.RelayEndpoint
Attempt relayset.Attempt
}
type Request ¶
type Request struct {
Source liveshare.FileSourceFactory
Relays []relayprofile.Registration
Standby []relayprofile.Registration
ChunkSize uint32
Diagnostics diagnostics.Sink
}
type SessionFactory ¶
type SessionFactory interface {
AdmitChannel(context.Context, protocolsession.FrameChannel) (sendersession.ChannelAdmission, error)
// Stop freezes admission before returning and joins terminal work on success.
// An expired wait must remain joinable through a subsequent Stop call.
Stop(context.Context, string) error
}
type SleepInhibitor ¶ added in v0.1.6
SleepInhibitor keeps the host awake while sender content transfers are active.
type SourceOmissionSummary ¶ added in v0.1.6
type SourceOmissionSummary struct {
Count uint64
Samples []catalog.SourceOmission
}
SourceOmissionSummary aggregates skipped source items across committed directories discovered so far for authoritative snapshot projection.
type SourceOmissionsObserved ¶
type SourceOmissionsObserved struct{ Summary catalog.SourceOmissions }
func (SourceOmissionsObserved) EngineEvent ¶
func (SourceOmissionsObserved) EngineEvent()