Skip to content
bradhePublic

About

Modified cron syntax for calculating when to run a job.

Resources

Stars

3 stars

Watchers

2 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

⏰ Cadence

This package is a simple interface in to calculating the next occurence of an event based on cron syntax. It also supports a more human-readable syntax to make, all behind a single interface.

import "github.com/bradhe/cadence"

Example

package main

import (
    "fmt"

    "github.com/bradhe/cadence"
)

func main() {
    // Supports cron syntax with seconds
    t, _ := cadence.Next("*/5 * * * * *", time.Now()))
    fmt.Printf("Next run: %v\n", t)

    // Special cases some human readable syntax, too!
    t, _ = cadence.Next("every hour", time.Now()))
    fmt.Printf("Next run: %v\n", t)
}

About

Modified cron syntax for calculating when to run a job.

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

⌂ 换网址