Documentation
¶
Index ¶
- Variables
- type CronConfig
- type CronItem
- type CronParser
- type CronQueue
- func (s *CronQueue[T, K]) DisplayAll()
- func (s *CronQueue[T, K]) Find(key K) (value T, nextSched time.Time, err error)
- func (s *CronQueue[T, K]) Insert(sortKey time.Time, key K, value T)
- func (s *CronQueue[T, K]) IsEmpty() bool
- func (s *CronQueue[T, K]) NextSchedule() time.Time
- func (s *CronQueue[T, K]) Pop() (T, error)
- func (s *CronQueue[T, K]) Remove(key K) error
- type Manager
- type Task
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoItem = errors.New("key not found")
View Source
var ErrUnknownFormat = errors.New("unknown format")
Functions ¶
This section is empty.
Types ¶
type CronConfig ¶
type CronItem ¶
type CronItem[T any, K comparable] struct { // contains filtered or unexported fields }
type CronParser ¶
type CronParser struct {
// contains filtered or unexported fields
}
func NewCronParser ¶
func NewCronParser(loc *time.Location) *CronParser
func (CronParser) LocalTime ¶
func (ts CronParser) LocalTime() time.Time
func (CronParser) LocalTimeString ¶
func (ts CronParser) LocalTimeString(t time.Time) string
func (CronParser) Parse ¶
func (ts CronParser) Parse(s string) (CronConfig, error)
type CronQueue ¶
type CronQueue[T any, K comparable] struct { // contains filtered or unexported fields }
func (*CronQueue[T, K]) DisplayAll ¶
func (s *CronQueue[T, K]) DisplayAll()
func (*CronQueue[T, K]) NextSchedule ¶
type Manager ¶
type Manager[K comparable] struct { // contains filtered or unexported fields }
func NewManager ¶
func NewManager[K comparable](loc *time.Location) *Manager[K]
func (*Manager[K]) AddTask ¶
func (s *Manager[K]) AddTask(config CronConfig, id K, job func())
func (*Manager[K]) RemoveTasks ¶
func (s *Manager[K]) RemoveTasks(ids ...K)
type Task ¶
type Task[K comparable] struct { Config CronConfig ID K Run func() // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.