backgroundtasks

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeIBackgroundTasks = di.GetInterfaceReflectType((*IBackgroundTasks)(nil))
	TypeIJobsProvider    = di.GetInterfaceReflectType((*IJobsProvider)(nil))
)

Functions

func AddBackgroundTasks

func AddBackgroundTasks(builder *di.Builder)

AddBackgroundTasks adds service to the DI container

Types

type IBackgroundTasks

type IBackgroundTasks interface {
}

func GetBackgroundTasksFromContainer

func GetBackgroundTasksFromContainer(ctn di.Container) IBackgroundTasks

type IJobsProvider added in v0.1.23

type IJobsProvider interface {
	GetScheduledJobs() ScheduledJobs
	GetOneTimeJobs() OneTimeJobs
}

type OneTimeJob added in v0.1.23

type OneTimeJob struct {
	// Job must support Run() func
	Job   cron.Job
	Delay time.Duration
}

func NewOneTimeJob added in v0.1.24

func NewOneTimeJob(job cron.Job, delay time.Duration) *OneTimeJob

type OneTimeJobs added in v0.1.24

type OneTimeJobs []*OneTimeJob

func NewOneTimeJobs added in v0.1.24

func NewOneTimeJobs(jobs ...*OneTimeJob) OneTimeJobs

type ScheduledJob added in v0.1.23

type ScheduledJob struct {
	// Job must support Run() func
	Job cron.Job
	// Schedule "* */5 * * * *","@every 1h30m10s","@midnight"
	Schedule string
}

ScheduledJob cron

func NewScheduledJob added in v0.1.24

func NewScheduledJob(job cron.Job, schedule string) *ScheduledJob

type ScheduledJobs added in v0.1.24

type ScheduledJobs []*ScheduledJob

func NewScheduledJobs added in v0.1.24

func NewScheduledJobs(jobs ...*ScheduledJob) ScheduledJobs

Jump to

Keyboard shortcuts

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