Documentation
¶
Overview ¶
Package cronjob loads and runs workspace cronjob prompts.
Index ¶
- func OnDemandCronTarget(text string, prefixes ...string) (string, bool)
- type Manager
- func (m *Manager) LoadOneOffCronjob(target string) (OneOffCronjob, error)
- func (m *Manager) RunOneOffCronjob(ctx context.Context, job OneOffCronjob, progress *harnessbridge.RawRunProgress, ...)
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) Stop(ctx context.Context) error
- func (m *Manager) StopAccepting()
- type OneOffCronjob
- type RunFunc
- type RunResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager struct {
SendTextChannel func(context.Context, string, string, string, string, string, []events.OutboundAttachment) error
// contains filtered or unexported fields
}
Manager loads cron definitions once at startup and schedules them.
func (*Manager) LoadOneOffCronjob ¶
func (m *Manager) LoadOneOffCronjob(target string) (OneOffCronjob, error)
LoadOneOffCronjob resolves and loads one live cronjob for a managed Slack thread run.
func (*Manager) RunOneOffCronjob ¶
func (m *Manager) RunOneOffCronjob(ctx context.Context, job OneOffCronjob, progress *harnessbridge.RawRunProgress, finish func(context.Context, RunResult, error))
RunOneOffCronjob executes a loaded cronjob once with optional progress delivery.
func (*Manager) StopAccepting ¶ added in v0.0.12
func (m *Manager) StopAccepting()
StopAccepting prevents queued cron triggers from starting new jobs.
type OneOffCronjob ¶
type OneOffCronjob struct {
Agent, Prompt, RelativePath, TextChannel string
}
OneOffCronjob captures a live one-off cronjob prompt loaded from disk.
type RunFunc ¶
type RunFunc func(context.Context, string, string, *slog.Logger, *harnessbridge.RawRunProgress) (RunResult, error)
RunFunc executes one cronjob prompt and returns the cronjob result.
type RunResult ¶
type RunResult struct {
Text, VerbatimMessage string
Attachments []events.OutboundAttachment
}
RunResult captures the observable result of one cronjob run.
Click to show internal directories.
Click to hide internal directories.