scheduler

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: PostgreSQL Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFrequency

func ParseFrequency(raw string) (time.Duration, error)

func RunJobs

func RunJobs(ctx context.Context, jobs []Job) error

func RunSingleJob

func RunSingleJob(ctx context.Context, job Job) error

Types

type Job

type Job struct {
	Name       string
	Frequency  time.Duration
	Cron       string
	RunOnStart bool
	Task       func(context.Context) error
}

func BuildJobsFromConfig

func BuildJobsFromConfig(cfg *config.Config) ([]Job, error)

type Manager

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

func NewManager

func NewManager() (*Manager, error)

func (*Manager) AddJob

func (m *Manager) AddJob(job Job)

func (*Manager) Run

func (m *Manager) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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