Documentation
¶
Index ¶
- Constants
- type Config
- type CronJob
- type Job
- type JobConfig
- type JobExecutor
- type JobFunc
- type JobManager
- type JobMetadata
- type JobRegister
- type JobRegistry
- type JobSpec
- type JobsConfigLoader
- type OnceJob
- type Params
- type ResponseParams
- type Scheduler
- func (s *Scheduler) CreateJob(spec JobSpec) (r result.Error)
- func (s *Scheduler) Cron(name, expr string, fn JobFunc) result.Error
- func (s *Scheduler) DeleteJob(name string) (r result.Error)
- func (s *Scheduler) Every(name string, dur time.Duration, fn JobFunc) result.Error
- func (s *Scheduler) GetJob(name string) (r result.Result[*Job])
- func (s *Scheduler) ListJobs() []*Job
- func (s *Scheduler) Once(name string, delay time.Duration, fn JobFunc) result.Error
- func (s *Scheduler) PatchJob(name string, config *JobConfig) (r result.Error)
- func (s *Scheduler) PauseJob(name string) (r result.Error)
- func (s *Scheduler) ReloadJob(name string) (r result.Error)
- func (s *Scheduler) ResumeJob(name string) (r result.Error)
- func (s *Scheduler) Serve(ctx context.Context) error
- func (s *Scheduler) String() string
- type Status
- type TickerJob
Constants ¶
View Source
const Name = "scheduler"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobConfig ¶
type JobConfig struct {
Disabled *bool `yaml:"disabled"`
Name string `yaml:"name"`
Timeout *time.Duration `yaml:"timeout"`
// MaxRetries is the maximum number of retries before aborting the
// current job execution.
// Default: 0.
MaxRetries *int `yaml:"max_retries"`
// RetryInterval is the fixed time interval between retry attempts.
// Default: 1 second.
RetryInterval *time.Duration `yaml:"retry_interval"`
// Replace indicates whether the job should replace an existing job
// with the same key.
// Default: false.
Replace *bool `yaml:"replace"`
Location *string `yaml:"location"`
// contains filtered or unexported fields
}
func (JobConfig) ToJobDetailOptions ¶
func (c JobConfig) ToJobDetailOptions() *quartz.JobDetailOptions
type JobExecutor ¶
type JobManager ¶
type JobManager interface {
CreateJob(spec JobSpec) result.Error
PatchJob(name string, config *JobConfig) result.Error
PauseJob(name string) result.Error
ResumeJob(name string) result.Error
DeleteJob(name string) result.Error
ReloadJob(name string) result.Error
ListJobs() []*Job
GetJob(name string) result.Result[*Job]
}
type JobMetadata ¶
type JobRegister ¶
type JobRegister interface {
RegisterSchedulerJob(reg JobRegistry)
}
type JobRegistry ¶
type JobsConfigLoader ¶
type JobsConfigLoader struct {
Scheduler *Config `yaml:"scheduler"`
}
type Params ¶
type Params struct {
M lifecycle.Lifecycle
Log log.Logger
Configs []*Config
Routers []JobRegister
Metric metrics.Metric
Executors []JobExecutor
}
type ResponseParams ¶
type ResponseParams struct {
Service supervisor.Service
Manager JobManager
}
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.