scheduler

package
v0.0.0-...-b60358c Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

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

func NewScheduler

func NewScheduler(options *ScheulderOptions) *Scheduler

func (*Scheduler) Schedule

func (scheduler *Scheduler) Schedule(taskName, cronExpression string, handler TaskHandler) (err error)

func (*Scheduler) Start

func (scheduler *Scheduler) Start(ctx context.Context) (err error)

type ScheulderOptions

type ScheulderOptions struct {
	// default: false
	WithSeconds bool
	// default: false
	Verbose bool
	Logger  *slog.Logger
}

type TaskHandler

type TaskHandler = func(ctx context.Context)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳