Documentation
¶
Overview ¶
Package alarm defines the alarms based on the time of the day.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Alarm ¶
type Alarm struct { Enabled bool Hour int Minute int Days WeekdayBit Cmd rules.Command // contains filtered or unexported fields }
Alarm represents a single alarm.
func (*Alarm) Next ¶
Next returns when the next trigger should be according to the alarm schedule.
Return 0 if not enabled.
type Config ¶
Config is what should be serialized.
func (*Config) ResetDefault ¶
func (c *Config) ResetDefault()
ResetDefault initializes the default alarms.
type WeekdayBit ¶
type WeekdayBit int
WeekdayBit is a bitmask of each day.
const ( Sunday WeekdayBit = 1 << iota Monday Tuesday Wednesday Thursday Friday Saturday )
Week days.
func (WeekdayBit) IsEnabledFor ¶
func (w WeekdayBit) IsEnabledFor(d time.Weekday) bool
IsEnabledFor returns true if the bitmask is set for this week day.
func (WeekdayBit) String ¶
func (w WeekdayBit) String() string
Click to show internal directories.
Click to hide internal directories.