cron

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cron handles anything related to time.

Package cron handles anything related to time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescribeLocation

func DescribeLocation(loc *time.Location) string

DescribeLocation gives a description of loc that combines loc.String() and time offset.

func DescribeSchedule added in v1.9.0

func DescribeSchedule(s Schedule) string

DescribeSchedule gives back the original cron string.

func Next added in v1.9.0

func Next(s Schedule) time.Time

Next gets the next scheduled time. It returns the zero value for nil.

func PrintCountdown added in v1.8.1

func PrintCountdown(ppfmt pp.PP, activity string, interval time.Duration)

Types

type Schedule

type Schedule = interface {
	Next() time.Time
	Describe() string
}

Schedule tells the next time a scheduled event should happen.

func MustNew

func MustNew(spec string) Schedule

MustNew creates a new Schedule, and panics if it fails to parse the input.

func New

func New(spec string) (Schedule, error)

New creates a new Schedule.

Jump to

Keyboard shortcuts

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