events

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: GPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PurgeOldEvents

func PurgeOldEvents(ctx context.Context, retention time.Duration) (int, error)

PurgeOldEvents deletes MovieEvent rows whose create_time is older than (now - retention). Returns the number of rows deleted.

func Record

func Record(
	ctx context.Context,
	client *ent.Client,
	t Type,
	movieID uint32,
	payload map[string]any,
) error

Record writes a MovieEvent row. When client is nil the package default (set by Register at db-client construction) is used. Pass the bound client from a mutation (m.Client()) or transaction (tx.Client()) to participate in an existing tx — ent routes the write through the tx automatically.

func Register

func Register(client *ent.Client)

Register installs runtime mutation hooks on the supplied client and captures it as the package default for tx-less Record calls.

Types

type Type

type Type string
const (
	TypeGrabbed           Type = "grabbed"
	TypeDownloadCompleted Type = "download_completed"
	TypeDownloadFailed    Type = "download_failed"
	TypeImported          Type = "imported"
	TypeImportFailed      Type = "import_failed"
	TypeDriftDetected     Type = "drift_detected"
	TypeDriftConfirmed    Type = "drift_confirmed"
	TypeSearched          Type = "searched"
)

func (Type) Valid

func (t Type) Valid() bool

Jump to

Keyboard shortcuts

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