cron

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cron

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

Cron is a wrapper around the gocron.Scheduler with the specific configuration for the project.

func New

func New() (*Cron, error)

New creates a new instance of the Cron struct.

func (*Cron) RemoveJob

func (c *Cron) RemoveJob(id uuid.UUID) error

RemoveJob removes a job from the scheduler only if it exists.

func (*Cron) Shutdown

func (c *Cron) Shutdown() error

Shutdown stops the scheduler.

func (*Cron) Start

func (c *Cron) Start()

Start starts the scheduler.

func (*Cron) UpsertJob

func (c *Cron) UpsertJob(
	id uuid.UUID, timeZone string, cronExpression string,
	function any, parameters ...any,
) error

UpsertJob adds a new job to the scheduler and it deletes the job first if it already exists.

Jump to

Keyboard shortcuts

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