scheduler

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Second has 1 * 1e9 nanoseconds
	Second time.Duration = xtime.Second
	//Minute has 60 seconds
	Minute time.Duration = xtime.Minute
	//Hour has 60 minutes
	Hour time.Duration = xtime.Hour
	//Day has 24 hours
	Day time.Duration = xtime.Day
	//Week has 7 days
	Week time.Duration = xtime.Week
)

Variables

This section is empty.

Functions

func Assign

func Assign(schedule gron.Schedule, job Job)

func Bind

func Bind(ops ...Option)

func Every

func Every(duration time.Duration) gron.AtSchedule

Types

type Job

type Job func(*Options)

type Option

type Option func(*Scheduler)

func Mongo

func Mongo(mg *mongo.MgoClient) Option

func Redis

func Redis(rd *redis.RdClient) Option

func Repo

func Repo(rp *repo.Repository) Option

type Options

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

func (*Options) Mongo

func (o *Options) Mongo() *mongo.MgoClient

func (*Options) Redis

func (o *Options) Redis() *redis.RdClient

func (*Options) Repo

func (o *Options) Repo() *repo.Repository

type Scheduler

type Scheduler struct {
	*Options
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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