serveradapter

package
v0.1.147 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: GPL-2.0, GPL-3.0 Imports: 7 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityAdapter

type ActivityAdapter struct{ A *activity.Log }

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

type AlertAdapter struct{ A *activity.AlertLog }

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

type ManualEventAdapter struct{ E *events.EventBus }

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

type ScanEventAdapter struct{ E *events.EventBus }

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL