job

package
v1.0.225 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job added in v1.0.202

type Job struct {
	context.Context
	Name            string
	Schedule        string
	AllowConcurrent bool
	Timeout         time.Duration
	Fn              func(ctx JobRuntime) error
	RunNow          bool
	ID              string
	// contains filtered or unexported fields
}

func NewJob

func NewJob(ctx context.Context, name string, schedule string, fn func(ctx JobRuntime) error) *Job

func (*Job) AddToScheduler added in v1.0.202

func (j *Job) AddToScheduler(cronRunner *cron.Cron) error

func (Job) GetEntry added in v1.0.202

func (j Job) GetEntry(cronRunner *cron.Cron) *cron.Entry

func (Job) RemoveFromScheduler added in v1.0.202

func (j Job) RemoveFromScheduler(cronRunner *cron.Cron)

func (Job) Run added in v1.0.202

func (j Job) Run()

func (*Job) RunOnStart added in v1.0.202

func (j *Job) RunOnStart() *Job

func (*Job) SetID added in v1.0.202

func (j *Job) SetID(id string) *Job

func (*Job) SetTimeout added in v1.0.202

func (j *Job) SetTimeout(t time.Duration) *Job

type JobRuntime

type JobRuntime struct {
	context.Context
	Job     Job
	Started time.Time
	Ended   time.Time
}

Jump to

Keyboard shortcuts

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