scheduler

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultClient

type DefaultClient struct {
	CronSchedule string
	Client       Scheduler
}

DefaultClient implements the scheduler client

func NewClient

func NewClient(cronSchedule string, opts ...LoadOption) (DefaultClient, error)

NewClient returns a new scheduler client

func (*DefaultClient) GetScheduler

func (c *DefaultClient) GetScheduler() Scheduler

GetScheduler returns a pointer to the underlying scheduler

type LoadOption

type LoadOption func(client *DefaultClient) error

LoadOption allows for modifying the client after it's created

type Scheduler

type Scheduler interface {
	// Do specifies the jobFunc that should be called every time the Job runs
	Do(jobFun interface{}, params ...interface{}) (*gocron.Job, error)

	// StartBlocking starts all jobs and blocks the current thread
	StartBlocking()
}

Scheduler wraps the underlying gocron scheduler

Jump to

Keyboard shortcuts

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