trigger

package
v0.0.0-...-bea47b1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 (c *CronManager) AddSchedule(ctx context.Context, namespace, workflowID, cronExpr, input string) (string, error)

func (*CronManager) AddScheduleWithOpts

func (c *CronManager) AddScheduleWithOpts(ctx context.Context, namespace, workflowID, cronExpr, input string, opts ScheduleOpts) (string, error)

func (*CronManager) GetSchedule

func (c *CronManager) GetSchedule(ctx context.Context, namespace, scheduleID string) (*models.Schedule, error)

func (*CronManager) ListSchedules

func (c *CronManager) ListSchedules(ctx context.Context, namespace string) ([]*models.Schedule, error)

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 (c *CronManager) PreviewNextRuns(cronExpr, timezone string, n int) ([]time.Time, error)

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

type ScheduleListFilter struct {
	ActiveOnly bool
	Limit      int
	Offset     int
}

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}

Jump to

Keyboard shortcuts

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