schedule

package
v0.0.0-...-6623458 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2016 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Frequency

type Frequency struct {
	Unit  TimeUnit
	Count uint
}

func (Frequency) String

func (f Frequency) String() string

type MultiSchedule

type MultiSchedule []Schedule

func ParseMultiSchedule

func ParseMultiSchedule(s string) (mc MultiSchedule, err error)

func (MultiSchedule) NextAfter

func (mc MultiSchedule) NextAfter(t time.Time) time.Time

func (MultiSchedule) String

func (mc MultiSchedule) String() (s string)

type Schedule

type Schedule struct {
	Start, End time.Time
	Freq       Frequency
}

Schedule describes a time schedule. It has a start and optional end point and an optional frequency.

func ParseSchedule

func ParseSchedule(s string) (c Schedule, err error)

func (Schedule) NextAfter

func (c Schedule) NextAfter(t time.Time) time.Time

NextAfter calculates the next time in the schedule after t. If no such time exists, nil is returned (test with Time.IsZero()).

func (Schedule) String

func (c Schedule) String() string

type TimeUnit

type TimeUnit int
const (
	Minute TimeUnit = iota
	Hour
	Day
	Week
	Month
	Year
)

func (TimeUnit) String

func (tu TimeUnit) String() string

Jump to

Keyboard shortcuts

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