watcher

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProcessorInterface added in v0.0.6

type ProcessorInterface interface {
	IsPathBeingProcessed(path string) bool
}

ProcessorInterface defines the interface for checking running jobs

type Watcher

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

func New

func New(
	cfg config.WatcherConfig,
	q queue.QueueInterface,
	processor ProcessorInterface,
	watchFolder string,
) *Watcher

func (*Watcher) ClearQueue added in v0.0.6

func (w *Watcher) ClearQueue() error

ClearQueue removes all completed and failed items from the queue via queue

func (*Watcher) Close

func (w *Watcher) Close() error

Close does nothing for the simple watcher (queue is managed separately)

func (*Watcher) GetNextRunTime added in v0.0.24

func (w *Watcher) GetNextRunTime() time.Time

GetNextRunTime returns the next scheduled run time

func (*Watcher) GetQueueItems added in v0.0.6

func (w *Watcher) GetQueueItems(params queue.PaginationParams) (*queue.PaginatedResult, error)

GetQueueItems returns queue items via the queue

func (*Watcher) GetQueueStats added in v0.0.6

func (w *Watcher) GetQueueStats() (map[string]interface{}, error)

GetQueueStats returns statistics about the queue via queue

func (*Watcher) GetWatcherStatus added in v0.0.24

func (w *Watcher) GetWatcherStatus() WatcherStatusInfo

GetWatcherStatus returns comprehensive watcher status information

func (*Watcher) RemoveFromQueue added in v0.0.6

func (w *Watcher) RemoveFromQueue(id string) error

RemoveFromQueue removes an item from the queue via queue

func (*Watcher) Start

func (w *Watcher) Start(ctx context.Context) error

func (*Watcher) TriggerScan added in v0.0.6

func (w *Watcher) TriggerScan(ctx context.Context)

TriggerScan triggers an immediate directory scan

type WatcherScheduleInfo added in v0.0.24

type WatcherScheduleInfo struct {
	StartTime string `json:"start_time"`
	EndTime   string `json:"end_time"`
}

WatcherScheduleInfo represents the schedule configuration

type WatcherStatusInfo added in v0.0.24

type WatcherStatusInfo struct {
	Enabled          bool                 `json:"enabled"`
	Initialized      bool                 `json:"initialized"`
	WatchDirectory   string               `json:"watch_directory"`
	CheckInterval    string               `json:"check_interval"`
	NextRun          string               `json:"next_run,omitempty"`
	IsWithinSchedule bool                 `json:"is_within_schedule"`
	Schedule         *WatcherScheduleInfo `json:"schedule,omitempty"`
	Error            string               `json:"error,omitempty"`
}

WatcherStatusInfo represents the watcher status information

Jump to

Keyboard shortcuts

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