schedule

package
v0.107.48 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: GPL-3.0 Imports: 7 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) MarshalJSON added in v0.107.37

func (w *Weekly) MarshalJSON() (data []byte, err error)

MarshalJSON implements the json.Marshaler interface for *Weekly.

func (*Weekly) MarshalYAML

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

MarshalYAML implements the yaml.Marshaler interface for *Weekly.

func (*Weekly) UnmarshalJSON added in v0.107.37

func (w *Weekly) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements the json.Unmarshaler 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