scheduler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package scheduler provides configuration and initialization for the job scheduler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Redis      RedisConfig      `yaml:"redis"`
	Queue      QueueConfig      `yaml:"queue"`
	Tasks      TasksConfig      `yaml:"tasks"`
	Retry      RetryConfig      `yaml:"retry"`
	Monitoring MonitoringConfig `yaml:"monitoring"`
}

Config holds the complete scheduler configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config with sensible defaults.

func (*Config) ToQueueConfig

func (c *Config) ToQueueConfig() queue.Config

ToQueueConfig converts the scheduler config to a queue.Config.

type MonitoringConfig

type MonitoringConfig struct {
	MetricsEnabled bool   `yaml:"metrics_enabled"`
	MetricsPath    string `yaml:"metrics_path"`
	HealthPath     string `yaml:"health_path"`
}

MonitoringConfig holds monitoring settings.

type QueueConfig

type QueueConfig struct {
	Concurrency     int            `yaml:"concurrency"`
	Queues          map[string]int `yaml:"queues"`
	ShutdownTimeout time.Duration  `yaml:"shutdown_timeout"`
}

QueueConfig holds queue settings.

type RedisConfig

type RedisConfig struct {
	Addr         string        `yaml:"addr"`
	Password     string        `yaml:"password"`
	DB           int           `yaml:"db"`
	PoolSize     int           `yaml:"pool_size"`
	MinIdleConns int           `yaml:"min_idle_conns"`
	MaxRetries   int           `yaml:"max_retries"`
	DialTimeout  time.Duration `yaml:"dial_timeout"`
	ReadTimeout  time.Duration `yaml:"read_timeout"`
	WriteTimeout time.Duration `yaml:"write_timeout"`
}

RedisConfig holds Redis connection settings.

type RetryConfig

type RetryConfig struct {
	InitialDelay time.Duration `yaml:"initial_delay"`
	MaxDelay     time.Duration `yaml:"max_delay"`
	Multiplier   float64       `yaml:"multiplier"`
}

RetryConfig holds retry behavior settings.

type TaskConfig

type TaskConfig struct {
	Timeout    time.Duration `yaml:"timeout"`
	MaxRetries int           `yaml:"max_retries"`
	Queue      string        `yaml:"queue"`
	CronSpec   string        `yaml:"cron_spec,omitempty"`
	Retention  time.Duration `yaml:"retention,omitempty"`
}

TaskConfig holds configuration for a specific task type.

type TasksConfig

type TasksConfig struct {
	AIAgent        TaskConfig `yaml:"ai_agent"`
	TestSuite      TaskConfig `yaml:"test_suite"`
	DataProcessing TaskConfig `yaml:"data_processing"`
	Webhook        TaskConfig `yaml:"webhook"`
	Cleanup        TaskConfig `yaml:"cleanup"`
}

TasksConfig holds task-specific configurations.

Directories

Path Synopsis
Package handlers provides the task handler registry for the scheduler.
Package handlers provides the task handler registry for the scheduler.
Package monitoring provides metrics and monitoring for the scheduler.
Package monitoring provides metrics and monitoring for the scheduler.
Package queue provides a job queue manager using Asynq.
Package queue provides a job queue manager using Asynq.
Package repository provides data access for scheduler jobs.
Package repository provides data access for scheduler jobs.
Package service provides the main scheduler service for job management.
Package service provides the main scheduler service for job management.
Package tasks defines task types and handlers for the scheduler.
Package tasks defines task types and handlers for the scheduler.

Jump to

Keyboard shortcuts

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