model

package
v0.0.0-...-a573e5d Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderInAsc  = "asc"
	OrderInDesc = "desc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Schedule Schedule  `json:"schedule"`
	At       time.Time `json:"at"`
}

type Schedule

type Schedule struct {
	ID    string    `json:"id"`
	Cron  string    `json:"cron"`
	Until time.Time `json:"until"`
}

func (Schedule) HashValue

func (s Schedule) HashValue() string

func (Schedule) TimesInPeriod

func (s Schedule) TimesInPeriod(from time.Time, until time.Time) ([]time.Time, error)

type TimeTable

type TimeTable struct {
	Events    []Event
	SortOrder string
}

func NewTimeTable

func NewTimeTable(order string) *TimeTable

func (*TimeTable) AddSchedule

func (t *TimeTable) AddSchedule(schedule Schedule, times []time.Time)

func (*TimeTable) Iterator

func (t *TimeTable) Iterator() <-chan Event

func (*TimeTable) Len

func (t *TimeTable) Len() int

func (*TimeTable) Less

func (t *TimeTable) Less(i int, j int) bool

func (*TimeTable) Swap

func (t *TimeTable) Swap(i int, j int)

Jump to

Keyboard shortcuts

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