eventlog

package
v0.2.9-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventEmitter

type EventEmitter interface {
	// EmitScraperEvent records a scraper-related event.
	// source identifies the scraper (e.g., "r18dev", "dmm").
	// message is a human-readable description.
	// severity is one of SeverityDebug/Info/Warn/Error.
	// context is optional structured detail (movie_id, url, error detail, etc).
	EmitScraperEvent(source, message, severity string, context map[string]interface{}) error

	// EmitOrganizeEvent records an organize-related event.
	// source identifies the operation stage (e.g., "file_move", "nfo_gen", "image_download").
	EmitOrganizeEvent(source, message, severity string, context map[string]interface{}) error

	// EmitSystemEvent records a system lifecycle event.
	// source identifies the subsystem (e.g., "server", "config", "database").
	EmitSystemEvent(source, message, severity string, context map[string]interface{}) error
}

EventEmitter allows any code path to emit typed structured events that are persisted to the events table. Per D-09, v1 delivers the interface only — concrete event emission in scrapers/organizer/system is v2.

Events are fire-and-forget: a failure to emit an event must NOT block the calling operation. The Emit methods return error for logging purposes, but callers should not treat it as fatal. Log the error and continue.

func NewEmitter

NewEmitter creates a new EventEmitter that persists events through the given repository. Per D-09: v1 only delivers the interface + concrete implementation. No integration with actual scraper/organizer/system code yet.

Jump to

Keyboard shortcuts

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