backgroundtasks

package
v0.1.65 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 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

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

type OneTimeJob

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

func NewOneTimeJob

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

type OneTimeJobs

type OneTimeJobs []*OneTimeJob

func NewOneTimeJobs

func NewOneTimeJobs(jobs ...*OneTimeJob) OneTimeJobs

type ScheduledJob

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

ScheduledJob cron

func NewScheduledJob

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

type ScheduledJobs

type ScheduledJobs []*ScheduledJob

func NewScheduledJobs

func NewScheduledJobs(jobs ...*ScheduledJob) ScheduledJobs

Jump to

Keyboard shortcuts

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