Documentation
¶
Overview ¶
Package share owns native sender application orchestration.
Index ¶
- Variables
- func Run(ctx context.Context, request Request, dependencies Dependencies) task.Completion[Result]
- type Controller
- 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 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 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) Availability ¶
func (c *Controller) Availability() (relayset.SenderAvailability, bool)
Availability reads the relay owner, not its lossy observation stream.
type Dependencies ¶
type Dependencies struct {
TURN turnpath.Accounts
Control task.Control
Controller *Controller
RevisionCapacity *revisioncapacity.Coordinator
CatalogBudget *catalog.BudgetAccount
CacheBudget *contentflow.ProcessCacheBudget
Connectivity *nativeconnectivity.Capacity
ICEPool func() icepolicy.ICEEndpointPool
Prepare func(context.Context, liveshare.SenderConfig) (Prepared, error)
Relays func(context.Context, []string, relayset.SenderFactory) (Relays, error)
Relay func(senderrelay.Config) (Relay, error)
Peers func(nativeconnectivity.SenderConfig) (Peers, error)
PollNetwork func(context.Context, func())
Attempts func(string) senderrelay.AttemptControl
ObserveAttempt func(string, senderrelay.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 senderrelay.Attempt
}
type Request ¶
type Request struct {
Source liveshare.FileSourceFactory
Relays []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 SourceOmissionsObserved ¶
type SourceOmissionsObserved struct{ Summary catalog.SourceOmissions }
func (SourceOmissionsObserved) EngineEvent ¶
func (SourceOmissionsObserved) EngineEvent()