Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WorkerStatus ¶
WorkerStatus returns the worker status (true = enabled, false = disabled) If the worker is not found in settings, returns false (disabled by default)
func WorkerToggle ¶
WorkerToggle sets the worker status
Types ¶
type LoggableWorker ¶
type LoggableWorker interface {
Worker
// GetResultLogs returns accumulated result logs
GetResultLogs() []string
// ClearResultLogs clears accumulated result logs
ClearResultLogs()
}
LoggableWorker - optional interface for workers with result logging
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler manages worker execution
func NewScheduler ¶
NewScheduler creates a new scheduler
func (*Scheduler) GetLogWriter ¶
GetLogWriter returns the writer for worker logs
func (*Scheduler) GetWorkers ¶
func (s *Scheduler) GetWorkers(ctx context.Context) []WorkerInfo
GetWorkers returns information about all workers
type Worker ¶
type Worker interface {
// Name returns a unique worker name (for logs and settings key)
Name() string
// Description returns a worker description for admin panel
Description() string
// Interval returns the execution interval
Interval() time.Duration
// Run executes the task
Run(ctx context.Context) error
}
Worker represents a periodic task
Click to show internal directories.
Click to hide internal directories.