Documentation
¶
Overview ¶
Package remotesync imports committed node facts without owning execution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Dependencies ¶
type Dependencies struct {
Repository remoteresults.Repository
Documents DocumentCache
}
type DocumentCache ¶
type DocumentCache interface {
Read(context.Context, jobcontract.ReportReference, func(context.Context, io.ReadWriteSeeker) error) ([]byte, error)
}
type DocumentOutcome ¶
type DocumentOutcome struct {
Imported bool
}
type DocumentRequest ¶
type DocumentRequest struct {
Request Request
Document remoteresults.DocumentReference
}
type Node ¶
type Node struct {
Origin remoteresults.Origin
Revision uint64
}
type NodeStatus ¶
type Outcome ¶
type Outcome struct {
Mirror remoteresults.Mirror
// MoreEvents describes the observed page tail, not execution settlement or
// a final artifact manifest. A later pass may discover newly committed facts.
MoreEvents bool
}
type Remote ¶
type Remote interface {
Probe(context.Context) (jobcontract.RunnerInfo, error)
ReadEvents(context.Context, runnerclient.EventQuery) (jobhost.EventPage, error)
DownloadReport(context.Context, string, jobcontract.ReportReference, io.ReadWriteSeeker) error
DownloadPerformanceArchive(context.Context, string, jobcontract.ReportReference, io.ReadWriteSeeker) error
}
type Synchronizer ¶
type Synchronizer struct {
// contains filtered or unexported fields
}
func New ¶
func New(dependencies Dependencies) (*Synchronizer, error)
func (*Synchronizer) ImportDocument ¶
func (synchronizer *Synchronizer) ImportDocument( ctx context.Context, input DocumentRequest, ) (DocumentOutcome, error)
ImportDocument authenticates one persisted immutable reference before reading bytes. Candidate pages are hints, never authority to download another owner.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶
func NewWatcher(ctx context.Context, dependencies WatcherDependencies) (*Watcher, error)
func (*Watcher) Run ¶
Run owns bounded per-node observers. Admission discovery keeps its tail; a separate history scan revisits earlier jobs for late facts and reports.
func (*Watcher) Snapshot ¶
func (watcher *Watcher) Snapshot() WatcherSnapshot
func (*Watcher) SubscribeChanges ¶
func (watcher *Watcher) SubscribeChanges(observer func()) func()
SubscribeChanges signals committed local mirror/report changes. Notifications carry no remote payload; consumers re-read their bounded local projections. Observers must return promptly and may unsubscribe from their own callback.
type WatcherDependencies ¶
type WatcherDependencies struct {
Synchronizer *Synchronizer
Nodes func(context.Context) ([]Node, error)
Connect func(context.Context, Node) (Connection, error)
FactPriorityJobs func(context.Context, remoteresults.Origin, string, uint32) (remoteresults.PriorityPage, error)
DocumentWork func(context.Context, remoteresults.DocumentQuery) (remoteresults.DocumentPage, error)
}
type WatcherSnapshot ¶
type WatcherSnapshot struct {
Running bool `json:"running"`
ErrorCode string `json:"error_code"`
Nodes []NodeStatus `json:"nodes"`
}
Click to show internal directories.
Click to hide internal directories.