schedule

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTaskAdded = errors.New("task already added")
)

Functions

This section is empty.

Types

type ScheduleService

type ScheduleService struct {
	// contains filtered or unexported fields
}

func NewSchedulerService

func NewSchedulerService() *ScheduleService

func (*ScheduleService) AddTask

func (s *ScheduleService) AddTask(task *Task)

func (*ScheduleService) GetTask

func (s *ScheduleService) GetTask(id string) *Task

func (*ScheduleService) Name

func (s *ScheduleService) Name() string

func (*ScheduleService) Start

func (s *ScheduleService) Start() error

func (*ScheduleService) Stop

func (s *ScheduleService) Stop(_ context.Context) error

type Scheduler

type Scheduler interface {
	AddTask(task *Task)
	GetTask(name string) *Task
}

type Task

type Task struct {
	Name         string
	InitialDelay time.Duration
	Interval     time.Duration
	Do           func()
}

Jump to

Keyboard shortcuts

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