crontab

package
v0.10.69 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Config

type Config struct {
	Jobs map[string]JobConfig `validate:"gt=0,dive,keys,required,endkeys,required"`
}

type Job

type Job func(context.Context) error

type JobConfig

type JobConfig struct {
	Schedule string        `validate:"cron"`
	Timeout  time.Duration `validate:"min=200ms"`
	Enabled  bool
}

type Scheduler

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

func (Scheduler) Run

func (s Scheduler) Run(context.Context) error

func (Scheduler) Shutdown added in v0.10.21

func (s Scheduler) Shutdown() error

func (Scheduler) Validate

func (obj Scheduler) Validate() error

func (Scheduler) WaitForShutdown deprecated

func (s Scheduler) WaitForShutdown(ctx context.Context) error

Deprecated: use closer.AddErrorCloser(scheduler.Shutdown) instead

type SchedulerOption

type SchedulerOption c.OptionWithContext[Scheduler]

func WithGocronOptions added in v0.8.7

func WithGocronOptions(opts ...gocron.SchedulerOption) SchedulerOption

func WithJob

func WithJob(jobName string, cfg JobConfig) SchedulerOption

func WithJobRegistry

func WithJobRegistry(jobs map[string]Job) SchedulerOption

func WithLogger

func WithLogger(logger *zap.Logger) SchedulerOption

func WithShutdownTimeout

func WithShutdownTimeout(t time.Duration) SchedulerOption

Jump to

Keyboard shortcuts

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