scheduling

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package scheduling provides command scheduling capabilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schedule

type Schedule struct {
	Type     ScheduleType
	Cron     string
	Interval time.Duration
	At       time.Time
}

Schedule represents a schedule

type ScheduleType

type ScheduleType string

ScheduleType represents the type of schedule

const (
	ScheduleOnce     ScheduleType = "once"
	ScheduleInterval ScheduleType = "interval"
	ScheduleDaily    ScheduleType = "daily"
	ScheduleWeekly   ScheduleType = "weekly"
	ScheduleCron     ScheduleType = "cron"
)

type ScheduledCommand

type ScheduledCommand struct {
	ID        string
	Command   string
	Args      []string
	Schedule  Schedule
	Enabled   bool
	LastRun   time.Time
	NextRun   time.Time
	RunCount  int
	CreatedAt time.Time
}

ScheduledCommand represents a scheduled command

type Scheduler

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

Scheduler manages scheduled commands

func NewScheduler

func NewScheduler() *Scheduler

NewScheduler creates a new scheduler

func (*Scheduler) AddCommand

func (s *Scheduler) AddCommand(cmd *ScheduledCommand) error

AddCommand adds a scheduled command

func (*Scheduler) ListCommands

func (s *Scheduler) ListCommands() []*ScheduledCommand

ListCommands returns all scheduled commands

func (*Scheduler) RemoveCommand

func (s *Scheduler) RemoveCommand(id string) error

RemoveCommand removes a scheduled command

func (*Scheduler) Start

func (s *Scheduler) Start()

Start starts the scheduler

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Stop stops the scheduler

Jump to

Keyboard shortcuts

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