watcher

package
v0.0.0-...-689375e Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 19 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 AddWatchFolder

func AddWatchFolder(ctx context.Context, pool *pgxpool.Pool, path, action string, config json.RawMessage) (int64, error)

AddWatchFolder adds a new directory to the watch_folders table.

func DeleteWatchFolder

func DeleteWatchFolder(ctx context.Context, pool *pgxpool.Pool, id int64) error

DeleteWatchFolder removes a directory from watch_folders.

func GetPollInterval

func GetPollInterval() time.Duration

GetPollInterval returns the fallback polling interval in seconds.

Types

type Daemon

type Daemon struct {
	// contains filtered or unexported fields
}

Daemon coordinates filesystem event monitoring for active watch folders.

func StartDaemon

func StartDaemon(ctx context.Context, pool *pgxpool.Pool) (*Daemon, error)

StartDaemon initializes and starts the watch folder background daemon.

type WatchFolder

type WatchFolder struct {
	ID        int64           `json:"id"`
	Path      string          `json:"path"`
	Action    string          `json:"action"` // "organize" | "convert"
	Config    json.RawMessage `json:"config"`
	Enabled   bool            `json:"enabled"`
	LastScan  *time.Time      `json:"last_scan,omitempty"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
}

WatchFolder represents a configured directory watcher in PostgreSQL.

func ListWatchFolders

func ListWatchFolders(ctx context.Context, pool *pgxpool.Pool) ([]WatchFolder, error)

ListWatchFolders queries all configured watch folders from PostgreSQL.

Jump to

Keyboard shortcuts

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