Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidType = errors.New("events: invalid type")
Functions ¶
func PurgeOldEvents ¶
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.
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" )
Click to show internal directories.
Click to hide internal directories.