Documentation
¶
Index ¶
Constants ¶
const PlanKindCommand = "command"
PlanKindCommand takes a jobs.Command as Params; its runs report PlanRunStarted/PlanRunFinished.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PlanRun ¶ added in v0.7.0
type PlanRun struct {
ID string `json:"id"`
PlanID string `json:"plan_id"`
Source PlanRunSource `json:"source"`
State PlanRunState `json:"state"`
StartedAt time.Time `json:"started_at"`
EndedAt time.Time `json:"ended_at,omitzero"`
ExitCode int `json:"exit_code"` // for a kind with an exit status, like a command
OutputTail string `json:"output_tail,omitempty"`
LogPath string `json:"log_path,omitempty"`
Error string `json:"error,omitempty"`
}
PlanRun: each retry or requeue is a new run; a Trigger dropped before it starts ends canceled, StartedAt at the Trigger and no log.
type PlanRunFinished ¶ added in v0.7.0
type PlanRunFinished struct {
PlanRun
}
func (PlanRunFinished) Kind ¶ added in v0.7.0
func (PlanRunFinished) Kind() string
type PlanRunSource ¶ added in v0.7.0
type PlanRunSource string
PlanRunSource is open: a Trigger caller may define its own values.
const ( PlanRunSchedule PlanRunSource = "schedule" PlanRunManual PlanRunSource = "manual" )
type PlanRunStarted ¶ added in v0.7.0
type PlanRunStarted struct {
PlanRun
}
func (PlanRunStarted) Kind ¶ added in v0.7.0
func (PlanRunStarted) Kind() string
type PlanRunState ¶ added in v0.7.0
type PlanRunState string
const ( PlanRunRunning PlanRunState = "running" PlanRunSucceeded PlanRunState = "succeeded" PlanRunFailed PlanRunState = "failed" PlanRunCanceled PlanRunState = "canceled" )
type PlanStats ¶ added in v0.8.1
type PlanStats struct {
ID string `json:"id"`
Schedule string `json:"schedule"`
State string `json:"state"`
Progress float64 `json:"progress"`
StartedAt time.Time `json:"started_at"`
ExecutionTime time.Duration `json:"execution_time"`
Cooldown time.Duration `json:"cooldown"`
Retries uint `json:"retries"`
Labels labels.Set `json:"labels"`
Error string `json:"error"`
LastRun *PlanRun `json:"last_run,omitempty"` // nil if never run
}
type PlanStatsOptions ¶ added in v0.8.1
type PubsubMessage ¶
type SupervisorInitPolicy ¶ added in v0.6.9
SupervisorInitPolicy: MaxRetries 0 is one pass, -1 retries until ctx ends; Delay doubles up to MaxDelay.
type SupervisorMonitorPolicy ¶ added in v0.6.9
type SupervisorMonitorPolicy struct {
Interval time.Duration
MaxRetries int
RestartDelay time.Duration
}
SupervisorMonitorPolicy: Interval 0 disables monitoring; MaxRetries bounds restarts per service (0 escalates a liveness failure at once, -1 unlimited).
type SupervisorStats ¶ added in v0.4.0
type SupervisorStats struct {
Name string
Initialized bool
InitializedAt time.Time
InitializationErr error
Started bool
StartedAt time.Time
StartErr error
Stopped bool
StoppedAt time.Time
StopErr error
HealthcheckedAt time.Time
HealthcheckErr error
LivenessErr error
Ready bool
ReadinessErr error
Restarts int
RestartedAt time.Time
InitDuration time.Duration
StartDuration time.Duration
StopDuration time.Duration
Source common.Service
}
func (*SupervisorStats) Healthcheck ¶ added in v0.4.0
func (s *SupervisorStats) Healthcheck() error
func (*SupervisorStats) Uptime ¶ added in v0.4.0
func (s *SupervisorStats) Uptime() time.Duration
type SupervisorStopPolicy ¶ added in v0.6.9
SupervisorStopPolicy: Timeout bounds each full stop and each restart's stop, then forces the rest; 0 defers to the caller's ctx.
type Task ¶ added in v0.8.1
type Task struct {
Job job.Job `json:"-"`
Ctx context.Context `json:"-"`
Params any `json:"params"`
Schedule string `json:"schedule"`
// Manual tasks run only via Trigger.
Manual bool `json:"manual,omitempty"`
Priority int `json:"priority"` // lower runs first, then FIFO
// Exclusive takes every slot; leftovers of a forced stop hold none.
Exclusive bool `json:"exclusive"`
Timeout time.Duration `json:"timeout,omitempty"`
RetryAttempts int `json:"retry_attempts,omitempty"`
RetryDelay time.Duration `json:"retry_delay,omitempty"`
// a requeue frees its slot while waiting; a task runs up to
// (RetryAttempts+1) * (RequeueAttempts+1) times
RequeueAttempts int `json:"requeue_attempts,omitempty"`
RequeueCooldown time.Duration `json:"requeue_cooldown,omitempty"`
}
Task is configuration only and copies like any value.