schedule

package
v0.0.0-...-f435a84 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schedule

type Schedule interface {
	// AddTask adds a task to the schedule
	AddTask(task Task) error
	// RemoveTask removes a task from the schedule
	RemoveTask(task Task) error
	// GetTasks returns all tasks in the schedule
	GetTasks() []Task
	// Start starts the schedule
	Start() error
}

type Task

type Task struct {
	// Name is the name of the task
	Name string
	// Priority is the priority of the task
	Priority int
	// Func is the function to be executed
	Func func() error
	// CreateAt is the time when the task is created
	CreateAt int64
	// UpdateAt is the time when the task is updated
	UpdateAt int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL