Documentation
¶
Overview ¶
Package report stores the Report of one package or of Global.
Index ¶
- type Reporter
- func (r *Reporter) SetActivated(version string)
- func (r *Reporter) SetCandidate(ur model.CandidateReport)
- func (r *Reporter) SetNotified(notified model.Notified)
- func (r *Reporter) SetRemoveError(msg string)
- func (r *Reporter) SetRemoved()
- func (r *Reporter) Snapshot() model.Report
- func (r *Reporter) UpdateCurrent(f func(*model.CurrentReport))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter stores one Report and calls notify after every change, outside the lock. Each section has one writer: Current or Global writes the Current section (UpdateCurrent), the package Reconciler the rest. The writers reach it through their own narrow interfaces, so the compiler keeps them out of each other's sections. The reader is Engine.Report (Snapshot). Safe for concurrent use.
func New ¶
func New(notify func()) *Reporter
New returns an empty Reporter; notify nil notifies nobody.
func (*Reporter) SetActivated ¶
SetActivated records the activated version and clears the Candidate section and the notification in one write, so no reader sees the activated version as a pending candidate or still announced.
func (*Reporter) SetCandidate ¶
func (r *Reporter) SetCandidate(ur model.CandidateReport)
SetCandidate replaces the Candidate section; a repeated blocker or failure changes nothing.
func (*Reporter) SetNotified ¶
SetNotified records the notification sent for the pending update.
func (*Reporter) SetRemoveError ¶
SetRemoveError replaces RemoveError; "" clears it.
func (*Reporter) UpdateCurrent ¶
func (r *Reporter) UpdateCurrent(f func(*model.CurrentReport))
UpdateCurrent applies f to the Current section under the lock, so a loop and its worker (the ApplyingManifests mark) never lose each other's write.