package tasks
import "github.com/gohugoio/hugo/common/tasks"
Index ¶
Types ¶
type Func ¶
type Func struct {
// The shortest interval between each run.
IntervalLow time.Duration
// The longest interval between each run.
IntervalHigh time.Duration
// The function to run.
F func(interval time.Duration) (time.Duration, error)
// contains filtered or unexported fields
}
type RunEvery ¶
type RunEvery struct {
// Any error returned from the function will be passed to this function.
HandleError func(string, error)
// If set, the function will be run immediately.
RunImmediately bool
// contains filtered or unexported fields
}
RunEvery runs a function at intervals defined by the function itself. Functions can be added and removed while running.
func (*RunEvery) Add ¶
Add adds a function to the RunEvery.
func (*RunEvery) Close ¶
Close stops the RunEvery from running.
func (*RunEvery) Has ¶
Has returns whether the RunEvery has a function with the given name.
func (*RunEvery) Remove ¶
Remove removes a function from the RunEvery.
func (*RunEvery) Start ¶
Source Files ¶
- Version
- v0.153.4 (latest)
- Published
- Dec 28, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 4 months ago –
Tools for package owners.