scheduler

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func Assign

func Assign(schedule interface{}, job Job)

func Bind

func Bind(conf ...Conf)

func Every

func Every(duration time.Duration) cron.Schedule

func Stop

func Stop()

Types

type Conf

type Conf func(*CronTab)

func Custom

func Custom(custom interface{}) Conf

func Mongo

func Mongo(mg *mongo.MgoClient) Conf

func Redis

func Redis(rd *redis.RdClient) Conf

func Repo

func Repo(rp *repo.Repository) Conf

type Configuration

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

func (*Configuration) Custom

func (c *Configuration) Custom() interface{}

func (*Configuration) Mongo

func (c *Configuration) Mongo() *mongo.MgoClient

func (*Configuration) Redis

func (c *Configuration) Redis() *redis.RdClient

func (*Configuration) Repo

func (c *Configuration) Repo() *repo.Repository

type CronTab

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

type Job

type Job func(*Configuration)

Jump to

Keyboard shortcuts

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