Documentation
¶
Overview ¶
Package cron stores recurring task definitions and run history.
Index ¶
- func IsDue(entry Entry, now time.Time) bool
- type Entry
- type Store
- func (s Store) Create(schedule string, prompt string, description string) (Entry, error)
- func (s Store) Delete(id string) (Entry, error)
- func (s Store) Due(now time.Time) ([]Entry, error)
- func (s Store) Get(id string) (Entry, error)
- func (s Store) List() ([]Entry, error)
- func (s Store) MarkRun(id string, now time.Time) (Entry, error)
- func (s Store) SetEnabled(id string, enabled bool) (Entry, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
ID string `json:"cron_id"`
Schedule string `json:"schedule"`
Prompt string `json:"prompt"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
LastRunAt *time.Time `json:"last_run_at,omitempty"`
RunCount int `json:"run_count"`
}
Click to show internal directories.
Click to hide internal directories.