schedule

package
v0.107.36 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package schedule provides types for scheduling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Weekly

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

Weekly is a schedule for one week. Each day of the week has one range with a beginning and an end.

func EmptyWeekly

func EmptyWeekly() (w *Weekly)

EmptyWeekly creates empty weekly schedule with local time zone.

func FullWeekly

func FullWeekly() (w *Weekly)

FullWeekly creates full weekly schedule with local time zone.

TODO(s.chzhen): Consider moving into tests.

func (*Weekly) Clone

func (w *Weekly) Clone() (c *Weekly)

Clone returns a deep copy of a weekly.

func (*Weekly) Contains

func (w *Weekly) Contains(t time.Time) (ok bool)

Contains returns true if t is within the corresponding day range of the schedule in the schedule's time zone.

func (*Weekly) MarshalYAML

func (w *Weekly) MarshalYAML() (v any, err error)

MarshalYAML implements the yaml.Marshaler interface for *Weekly.

func (*Weekly) UnmarshalYAML

func (w *Weekly) UnmarshalYAML(value *yaml.Node) (err error)

UnmarshalYAML implements the yaml.Unmarshaler interface for *Weekly.

Jump to

Keyboard shortcuts

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