notify
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeCondition¶
Condition is a function that gets executed periodically, and receives thecurrent time as an argument.
- It should return the deadline for the notification, as well as acallback function to execute. If deadline is the zerotime, callback will not be executed.
- Callback is executed once for every time the difference between deadlineand the current time is less than an element of countdown.
- To enforce a minimum interval between consecutive callbacks, truncatethe returned deadline to the minimum interval.
typeNotifier¶
type Notifier struct {// contains filtered or unexported fields}
Notifier triggers callbacks at given intervals until some event happens. Theintervals (e.g. 10 minute warning, 5 minute warning) are given in thecountdown. The Notifier periodically polls the condition to get the time ofthe event (the Condition's deadline) and the callback. The callback iscalled at most once per entry in the countdown, the first time the time tothe deadline is shorter than the duration.