Documentation
¶
Overview ¶
Package serveradapter provides adapter types that bridge the server's activity, alert, and event subsystems to the interfaces consumed by the scanning and manualops packages.
Index ¶
- type ActivityAdapter
- func (a *ActivityAdapter) End(id string)
- func (a *ActivityAdapter) Fail(id string)
- func (a *ActivityAdapter) FinishCancelled(id string)
- func (a *ActivityAdapter) IsCancelled(id string) bool
- func (a *ActivityAdapter) Progress(id string, current, total int, msg string)
- func (a *ActivityAdapter) SetQueued(id string, queued bool)
- func (a *ActivityAdapter) Start(action, detail string, source activity.ActivitySource) string
- func (a *ActivityAdapter) StartScan(action, detail string, source activity.ActivitySource, ...) (id string, existing bool)
- type AlertAdapter
- type ManualEventAdapter
- type ScanEventAdapter
- func (a *ScanEventAdapter) PublishCoverageUpdate(mediaType api.MediaType, mediaID string)
- func (a *ScanEventAdapter) PublishScanDone(action, detail string, source activity.ActivitySource, actID string, ...)
- func (a *ScanEventAdapter) PublishScanStart(action, detail string, source activity.ActivitySource, actID string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityAdapter ¶
ActivityAdapter bridges activity.Log to scanning.ActivityTracker and manualops.ActivityTracker (superset of methods).
func (*ActivityAdapter) End ¶
func (a *ActivityAdapter) End(id string)
End marks the activity with the given ID as successfully completed.
func (*ActivityAdapter) Fail ¶
func (a *ActivityAdapter) Fail(id string)
Fail marks the activity with the given ID as failed.
func (*ActivityAdapter) FinishCancelled ¶ added in v0.1.148
func (a *ActivityAdapter) FinishCancelled(id string)
FinishCancelled marks the activity with the given ID as terminally cancelled (Done + Cancelled + EndedAt).
func (*ActivityAdapter) IsCancelled ¶
func (a *ActivityAdapter) IsCancelled(id string) bool
IsCancelled reports whether the activity with the given ID has been cancelled.
func (*ActivityAdapter) Progress ¶
func (a *ActivityAdapter) Progress(id string, current, total int, msg string)
Progress updates the progress counters and message for an activity.
func (*ActivityAdapter) SetQueued ¶
func (a *ActivityAdapter) SetQueued(id string, queued bool)
SetQueued marks an activity as queued or active.
func (*ActivityAdapter) Start ¶
func (a *ActivityAdapter) Start(action, detail string, source activity.ActivitySource) string
Start begins a new activity entry and returns its ID.
func (*ActivityAdapter) StartScan ¶ added in v0.1.148
func (a *ActivityAdapter) StartScan(action, detail string, source activity.ActivitySource, scope activity.ScanScope, role auth.Role, ) (id string, existing bool)
StartScan begins a new scan activity carrying its structured scope and cancel role; an active same-scope entry is returned instead of creating a duplicate (existing=true).
type AlertAdapter ¶
AlertAdapter bridges activity.AlertLog to scanning.AlertRecorder and activity.WarnRecorder (superset of methods).
func (*AlertAdapter) Record ¶
func (a *AlertAdapter) Record(category, msg string)
Record emits an alert with the given category and message.
func (*AlertAdapter) RecordInfo ¶
func (a *AlertAdapter) RecordInfo(msg string)
RecordInfo emits an informational alert message.
func (*AlertAdapter) RecordStoreWriteError ¶ added in v0.1.54
func (a *AlertAdapter) RecordStoreWriteError(err error)
RecordStoreWriteError checks whether the error indicates a disk-full or unrecoverable I/O condition and raises a persistent alert so operators are notified before the system crash-loops. Non-disk-full write errors are logged at ERROR level with a distinctive message for Loki/Alertmanager matching.
func (*AlertAdapter) RecordWarn ¶
func (a *AlertAdapter) RecordWarn(source, msg string)
RecordWarn emits a warning alert with the given source and message.
type ManualEventAdapter ¶
ManualEventAdapter bridges events.EventBus to manualops.EventPublisher.
func (*ManualEventAdapter) PublishCoverageUpdate ¶
func (a *ManualEventAdapter) PublishCoverageUpdate(mediaType api.MediaType, mediaID, language, source string)
PublishCoverageUpdate publishes a coverage-update SSE event for the manual download/clear-lock case (no path on the wire; see events.CoverageEvent).
func (*ManualEventAdapter) PublishNotify ¶
func (a *ManualEventAdapter) PublishNotify(level events.NotifyLevel, text string)
PublishNotify publishes a user-facing notification SSE event at the given severity level.
type ScanEventAdapter ¶
ScanEventAdapter bridges events.EventBus to scanning.EventPublisher.
func (*ScanEventAdapter) PublishCoverageUpdate ¶
func (a *ScanEventAdapter) PublishCoverageUpdate(mediaType api.MediaType, mediaID string)
PublishCoverageUpdate publishes a coverage-update SSE event for a media item.
func (*ScanEventAdapter) PublishScanDone ¶
func (a *ScanEventAdapter) PublishScanDone(action, detail string, source activity.ActivitySource, actID string, outcome activity.Outcome, )
PublishScanDone publishes a scan-done SSE event with the activity id and the four-valued terminal outcome.
func (*ScanEventAdapter) PublishScanStart ¶
func (a *ScanEventAdapter) PublishScanStart(action, detail string, source activity.ActivitySource, actID string)
PublishScanStart publishes a scan-start SSE event carrying the activity id.