Documentation
¶
Index ¶
- type APIManager
- type CronManager
- func (c *CronManager) AddSchedule(ctx context.Context, namespace, workflowID, cronExpr, input string) (string, error)
- func (c *CronManager) AddScheduleWithOpts(ctx context.Context, namespace, workflowID, cronExpr, input string, ...) (string, error)
- func (c *CronManager) GetSchedule(ctx context.Context, namespace, scheduleID string) (*models.Schedule, error)
- func (c *CronManager) ListSchedules(ctx context.Context, namespace string) ([]*models.Schedule, error)
- func (c *CronManager) ListSchedulesFiltered(ctx context.Context, namespace string, filter ScheduleListFilter) ([]*models.Schedule, error)
- func (c *CronManager) PauseSchedule(ctx context.Context, namespace, scheduleID string) error
- func (c *CronManager) PreviewNextRuns(cronExpr, timezone string, n int) ([]time.Time, error)
- func (c *CronManager) RemoveSchedule(ctx context.Context, namespace, scheduleID string) error
- func (c *CronManager) ResumeSchedule(ctx context.Context, namespace, scheduleID string) error
- func (c *CronManager) SetAuthProvider(provider auth.AuthProvider)
- func (c *CronManager) SetEventBus(bus *engine.EventBus)
- func (c *CronManager) SetHostHooks(h engine.HostHooks)
- func (c *CronManager) SetLogger(l *slog.Logger)
- func (c *CronManager) Start(ctx context.Context) error
- func (c *CronManager) Stop()
- func (c *CronManager) UpdateSchedule(ctx context.Context, namespace, scheduleID string, patch ScheduleUpdateOpts) error
- type ScheduleListFilter
- type ScheduleOpts
- type ScheduleUpdateOpts
- type StartableEngine
- type WebhookManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIManager ¶
type APIManager struct {
// contains filtered or unexported fields
}
APIManager handles management API requests
func NewAPIManager ¶
func NewAPIManager(wm *WebhookManager) *APIManager
func (*APIManager) ServeHTTP ¶
func (m *APIManager) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*APIManager) SetCronManager ¶
func (m *APIManager) SetCronManager(c *CronManager) *APIManager
type CronManager ¶
type CronManager struct {
// contains filtered or unexported fields
}
CronManager manages durable, dynamic, multi-replica-safe cron triggers.
func NewCronManager ¶
func NewCronManager(eng StartableEngine, store storage.Storage, logger *slog.Logger) *CronManager
NewCronManager creates a persistent scheduler bound to storage.
func (*CronManager) AddSchedule ¶
func (*CronManager) AddScheduleWithOpts ¶
func (c *CronManager) AddScheduleWithOpts(ctx context.Context, namespace, workflowID, cronExpr, input string, opts ScheduleOpts) (string, error)
func (*CronManager) GetSchedule ¶
func (*CronManager) ListSchedules ¶
func (*CronManager) ListSchedulesFiltered ¶
func (c *CronManager) ListSchedulesFiltered(ctx context.Context, namespace string, filter ScheduleListFilter) ([]*models.Schedule, error)
func (*CronManager) PauseSchedule ¶
func (c *CronManager) PauseSchedule(ctx context.Context, namespace, scheduleID string) error
PauseSchedule soft-disables a schedule (auth required).
func (*CronManager) PreviewNextRuns ¶
func (*CronManager) RemoveSchedule ¶
func (c *CronManager) RemoveSchedule(ctx context.Context, namespace, scheduleID string) error
func (*CronManager) ResumeSchedule ¶
func (c *CronManager) ResumeSchedule(ctx context.Context, namespace, scheduleID string) error
func (*CronManager) SetAuthProvider ¶
func (c *CronManager) SetAuthProvider(provider auth.AuthProvider)
func (*CronManager) SetEventBus ¶
func (c *CronManager) SetEventBus(bus *engine.EventBus)
func (*CronManager) SetHostHooks ¶
func (c *CronManager) SetHostHooks(h engine.HostHooks)
func (*CronManager) SetLogger ¶
func (c *CronManager) SetLogger(l *slog.Logger)
func (*CronManager) Start ¶
func (c *CronManager) Start(ctx context.Context) error
Start loads active schedules and starts cron runners (idempotent, concurrency-safe).
func (*CronManager) Stop ¶
func (c *CronManager) Stop()
Stop stops runners, clears in-memory state, and resets gauges.
func (*CronManager) UpdateSchedule ¶
func (c *CronManager) UpdateSchedule(ctx context.Context, namespace, scheduleID string, patch ScheduleUpdateOpts) error
UpdateSchedule applies a partial patch (nil fields keep current values).
type ScheduleListFilter ¶
ScheduleListFilter filters ListSchedules results.
type ScheduleOpts ¶
type ScheduleOpts struct {
Name string
CatchUp bool
CatchUpMax int
CatchUpLookback time.Duration
Timezone string
StartsAt *time.Time
EndsAt *time.Time
SkipWorkflowCheck bool
}
ScheduleOpts configures create behavior.
type ScheduleUpdateOpts ¶
type ScheduleUpdateOpts struct {
CronExpression *string
Input *string
Name *string
Timezone *string
CatchUp *bool
CatchUpMax *int
CatchUpLookbackSec *int
StartsAt *time.Time
EndsAt *time.Time
ClearStartsAt bool
ClearEndsAt bool
SkipWorkflowCheck bool
}
ScheduleUpdateOpts is a partial update; nil pointer fields keep existing values.
type StartableEngine ¶
type StartableEngine interface {
StartWorkflow(ctx context.Context, namespace, workflowID string, input string) (string, error)
}
StartableEngine is the minimal engine surface needed to fire schedules.
type WebhookManager ¶
type WebhookManager struct {
// contains filtered or unexported fields
}
func NewWebhookManager ¶
func NewWebhookManager(e *engine.Engine) *WebhookManager
func (*WebhookManager) ServeHTTP ¶
func (m *WebhookManager) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles incoming webhooks: /webhooks/{namespace}/{workflow_id}