Documentation
¶
Index ¶
- func GetNextRun(schedule string) (*time.Time, error)
- func ValidateSchedule(schedule string) error
- type ExecutionLog
- type Job
- type Manager
- func (m *Manager) Add(job *Job) error
- func (m *Manager) ClearLogs(jobID string) error
- func (m *Manager) Get(name string) *Job
- func (m *Manager) GetByID(id string) *Job
- func (m *Manager) GetDueJobs() []*Job
- func (m *Manager) GetLogs(jobID string, limit int) []ExecutionLog
- func (m *Manager) List() []*Job
- func (m *Manager) Remove(id string) error
- func (m *Manager) RunJob(ctx context.Context, job *Job) error
- func (m *Manager) SetAgentDeps(prov provider.Provider, reg *tool.Registry)
- func (m *Manager) Start()
- func (m *Manager) Stop()
- func (m *Manager) Update(job *Job) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNextRun ¶ added in v0.4.8
GetNextRun calculates the next run time for a schedule expression
func ValidateSchedule ¶ added in v0.4.8
ValidateSchedule checks if a cron expression is valid
Types ¶
type ExecutionLog ¶ added in v0.4.8
type ExecutionLog struct {
ID string `json:"id"`
JobID string `json:"job_id"`
JobName string `json:"job_name"`
StartedAt time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
Status string `json:"status"` // success, failed, timeout
Output string `json:"output,omitempty"`
Error string `json:"error,omitempty"`
Duration string `json:"duration,omitempty"`
}
ExecutionLog records the result of a job execution
type Job ¶
type Job struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Schedule string `json:"schedule"`
Prompt string `json:"prompt"`
Skills []string `json:"skills,omitempty"`
Platform string `json:"platform,omitempty"`
Enabled bool `json:"enabled"`
NoAgent bool `json:"no_agent"` // Skip agent, run script directly
Script string `json:"script"` // Script/command for no_agent mode
NextRun *time.Time `json:"next_run,omitempty"`
LastRun *time.Time `json:"last_run,omitempty"`
LastStatus string `json:"last_status,omitempty"` // success, failed, running
LastError string `json:"last_error,omitempty"`
RunCount int `json:"run_count,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
Job represents a scheduled cron job
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages cron jobs with real scheduling
func (*Manager) GetDueJobs ¶
func (*Manager) GetLogs ¶ added in v0.4.8
func (m *Manager) GetLogs(jobID string, limit int) []ExecutionLog
func (*Manager) SetAgentDeps ¶ added in v0.4.8
SetAgentDeps sets the agent dependencies (provider, tool registry)
func (*Manager) Start ¶ added in v0.4.8
func (m *Manager) Start()
Start begins the cron scheduler loop and loads all enabled jobs
Click to show internal directories.
Click to hide internal directories.