Help us shape the future of Go! Take the 2026 Go Developer Survey

cronfrontend

package
v0.2.24 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package cronfrontend schedules cron producers and their conversation Sync.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stem added in v0.2.20

func Stem(path string) string

Stem is the name the cron job at path is listed and loaded by: a cron file's stem, or "<agent> · <schedule>" for the routine at agents/<agent>.md#<schedule>.

func ValidateRuntimeDefinitions

func ValidateRuntimeDefinitions(cfg *config.LockedConfig, runtimeDir string) error

ValidateRuntimeDefinitions loads cron definitions and routines from runtimeDir without mutating scheduler state.

Types

type Job

type Job struct {
	RelativePath, Agent, Body, Space string
	Schedules                        []string
	Upcoming                         []time.Time
}

Job is the read-only presentation of a loaded definition and its next triggers.

type Manager

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

Manager loads and runs workspace cron definitions.

func New

func New(cfg *config.LockedConfig, runtimeDir string, store cronScheduleStore, run Runner, logger *slog.Logger) *Manager

New constructs a cronjob manager using runtimeDir for effective runtime cron definitions and agents' routines.

func (*Manager) Jobs

func (m *Manager) Jobs() ([]Job, error)

Jobs returns loaded definitions and their next triggers in the next day. It neither refreshes scheduler state nor claims any work.

func (*Manager) LoadOneOffCronjob

func (m *Manager) LoadOneOffCronjob(target string) (protocol.OneOffCronjob, error)

LoadOneOffCronjob resolves and loads one live cronjob, a cron file or a routine, for a run from Web.

func (*Manager) Refresh added in v0.2.21

func (m *Manager) Refresh() error

Refresh loads the cron definitions anew; a reload calls it once it has validated and installed them. It syncs the schedules table before the scheduler uses them, and a load or sync error leaves both unchanged.

func (*Manager) RunOneOffCronjob

func (m *Manager) RunOneOffCronjob(ctx context.Context, job *protocol.OneOffCronjob) (protocol.CronRunResult, error)

RunOneOffCronjob waits for a loaded producer and its required Sync.

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

Start loads cron definitions and starts scheduling them.

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context) error

Stop shuts the cron manager down.

type Runner

Runner executes a producer through terminal delivery.

Jump to

Keyboard shortcuts

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