scheduler

package
v0.2.10-36 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "scheduler"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.2.11

type Config []JobSetting

type JobSetting added in v0.2.11

type JobSetting struct {
	Disabled bool   `yaml:"disabled"`
	Schedule string `yaml:"schedule"`
	Name     string `yaml:"name"`
	Timeout  string `yaml:"timeout"`
}

type Scheduler

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

func New added in v0.2.11

func New(m lifecycle.Lifecycle, log log.Logger, opts []*Config) *Scheduler

func (*Scheduler) Cron

func (s *Scheduler) Cron(name string, expr string, fn func(ctx context.Context, name string) error)

func (*Scheduler) Every

func (s *Scheduler) Every(name string, dur time.Duration, fn func(ctx context.Context, name string) error)

func (*Scheduler) Once

func (s *Scheduler) Once(name string, delay time.Duration, fn func(ctx context.Context, name string) error)

Jump to

Keyboard shortcuts

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