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) 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
- type AlertAdapter
- type ManualEventAdapter
- type ScanEventAdapter
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) 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.
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, path string)
PublishCoverageUpdate publishes a coverage-update SSE event carrying the full subtitle file path for the manual download case.
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, ok bool)
PublishScanDone publishes a scan-done SSE event with success or failure status.
func (*ScanEventAdapter) PublishScanStart ¶
func (a *ScanEventAdapter) PublishScanStart(action, detail string, source activity.ActivitySource)
PublishScanStart publishes a scan-start SSE event.