Documentation
¶
Index ¶
- Constants
- type AnalyticsJob
- type AutoHealJob
- func (j *AutoHealJob) CanRestartExported(containerID string, maxRestarts int, window time.Duration) bool
- func (j *AutoHealJob) Name() string
- func (j *AutoHealJob) RecordRestartAtExported(containerID string, t time.Time)
- func (j *AutoHealJob) RecordRestartExported(containerID string)
- func (j *AutoHealJob) Reschedule(ctx context.Context) error
- func (j *AutoHealJob) ResetRestartTracking()
- func (j *AutoHealJob) Run(ctx context.Context)
- func (j *AutoHealJob) Schedule(ctx context.Context) string
- func (j *AutoHealJob) ShouldSchedule(ctx context.Context) bool
- type AutoUpdateJob
- type DockerClientRefreshJob
- type EventCleanupJob
- type ExpiredSessionsCleanupJob
- type FilesystemWatcherJob
- type ImagePollingJob
- type JobScheduler
- func (js *JobScheduler) AddJob(ctx context.Context, job schedulertypes.Job) error
- func (js *JobScheduler) GetJob(jobID string) (schedulertypes.Job, bool)
- func (js *JobScheduler) GetLocation() *time.Location
- func (js *JobScheduler) HasJob(jobID string) bool
- func (js *JobScheduler) RegisterJob(job schedulertypes.Job)
- func (js *JobScheduler) RemoveJob(ctx context.Context, jobName string)
- func (js *JobScheduler) RescheduleJob(ctx context.Context, job schedulertypes.Job) error
- func (js *JobScheduler) Run(ctx context.Context) error
- func (js *JobScheduler) StartScheduler()
- type PruningVolumeHelperJob
- type ScheduledPruneJob
- type VulnerabilityScanJob
Constants ¶
const (
AnalyticsJobName = "analytics-heartbeat"
)
const AutoHealJobName = "auto-heal"
const DockerClientRefreshJobName = "docker-client-refresh"
const EventCleanupJobName = "event-cleanup"
const ExpiredSessionsCleanupJobName = "expired-sessions-cleanup"
const (
PruningVolumeHelperJobName = "pruning-volume-helper"
)
const ScheduledPruneJobName = "scheduled-prune"
const VulnerabilityScanJobName = "vulnerability-scan"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyticsJob ¶
type AnalyticsJob struct {
// contains filtered or unexported fields
}
func NewAnalyticsJob ¶
func NewAnalyticsJob( settingsService *services.SettingsService, kvService *services.KVService, httpClient *http.Client, cfg *config.Config, ) *AnalyticsJob
func (*AnalyticsJob) Name ¶
func (j *AnalyticsJob) Name() string
func (*AnalyticsJob) Reschedule ¶
func (j *AnalyticsJob) Reschedule(ctx context.Context) error
func (*AnalyticsJob) Run ¶
func (j *AnalyticsJob) Run(ctx context.Context)
type AutoHealJob ¶
type AutoHealJob struct {
// contains filtered or unexported fields
}
func NewAutoHealJob ¶
func NewAutoHealJob( dockerClientService *services.DockerClientService, settingsService *services.SettingsService, eventService *services.EventService, notificationService *services.NotificationService, ) *AutoHealJob
func (*AutoHealJob) CanRestartExported ¶
func (j *AutoHealJob) CanRestartExported(containerID string, maxRestarts int, window time.Duration) bool
CanRestartExported exposes canRestart for testing.
func (*AutoHealJob) Name ¶
func (j *AutoHealJob) Name() string
func (*AutoHealJob) RecordRestartAtExported ¶
func (j *AutoHealJob) RecordRestartAtExported(containerID string, t time.Time)
RecordRestartAtExported records a restart at a specific time for testing.
func (*AutoHealJob) RecordRestartExported ¶
func (j *AutoHealJob) RecordRestartExported(containerID string)
RecordRestartExported exposes recordRestart for testing.
func (*AutoHealJob) Reschedule ¶
func (j *AutoHealJob) Reschedule(ctx context.Context) error
func (*AutoHealJob) ResetRestartTracking ¶
func (j *AutoHealJob) ResetRestartTracking()
ResetRestartTracking clears all restart records (exported for testing).
func (*AutoHealJob) Run ¶
func (j *AutoHealJob) Run(ctx context.Context)
func (*AutoHealJob) ShouldSchedule ¶
func (j *AutoHealJob) ShouldSchedule(ctx context.Context) bool
type AutoUpdateJob ¶
type AutoUpdateJob struct {
// contains filtered or unexported fields
}
func NewAutoUpdateJob ¶
func NewAutoUpdateJob(updaterService *services.UpdaterService, settingsService *services.SettingsService) *AutoUpdateJob
func (*AutoUpdateJob) Name ¶
func (j *AutoUpdateJob) Name() string
func (*AutoUpdateJob) Reschedule ¶
func (j *AutoUpdateJob) Reschedule(ctx context.Context) error
func (*AutoUpdateJob) Run ¶
func (j *AutoUpdateJob) Run(ctx context.Context)
func (*AutoUpdateJob) ShouldSchedule ¶
func (j *AutoUpdateJob) ShouldSchedule(ctx context.Context) bool
type DockerClientRefreshJob ¶
type DockerClientRefreshJob struct {
// contains filtered or unexported fields
}
DockerClientRefreshJob keeps the cached Docker client aligned with the daemon API version after daemon restarts or upgrades.
func NewDockerClientRefreshJob ¶
func NewDockerClientRefreshJob(dockerClientService *services.DockerClientService, settingsService *services.SettingsService) *DockerClientRefreshJob
NewDockerClientRefreshJob creates the scheduled Docker client refresh job.
func (*DockerClientRefreshJob) Name ¶
func (j *DockerClientRefreshJob) Name() string
func (*DockerClientRefreshJob) Run ¶
func (j *DockerClientRefreshJob) Run(ctx context.Context)
type EventCleanupJob ¶
type EventCleanupJob struct {
// contains filtered or unexported fields
}
func NewEventCleanupJob ¶
func NewEventCleanupJob(eventService *services.EventService, activityService *services.ActivityService, settingsService *services.SettingsService) *EventCleanupJob
func (*EventCleanupJob) Name ¶
func (j *EventCleanupJob) Name() string
func (*EventCleanupJob) Reschedule ¶
func (j *EventCleanupJob) Reschedule(ctx context.Context) error
func (*EventCleanupJob) Run ¶
func (j *EventCleanupJob) Run(ctx context.Context)
type ExpiredSessionsCleanupJob ¶
type ExpiredSessionsCleanupJob struct {
// contains filtered or unexported fields
}
func NewExpiredSessionsCleanupJob ¶
func NewExpiredSessionsCleanupJob(sessionService *services.SessionService, settingsService *services.SettingsService) *ExpiredSessionsCleanupJob
func (*ExpiredSessionsCleanupJob) Name ¶
func (j *ExpiredSessionsCleanupJob) Name() string
func (*ExpiredSessionsCleanupJob) Reschedule ¶
func (j *ExpiredSessionsCleanupJob) Reschedule(ctx context.Context) error
func (*ExpiredSessionsCleanupJob) Run ¶
func (j *ExpiredSessionsCleanupJob) Run(ctx context.Context)
type FilesystemWatcherJob ¶
type FilesystemWatcherJob struct {
// contains filtered or unexported fields
}
func NewFilesystemWatcherJob ¶
func NewFilesystemWatcherJob( projectService *services.ProjectService, templateService *services.TemplateService, settingsService *services.SettingsService, projectScanDepth int, ) *FilesystemWatcherJob
func RegisterFilesystemWatcherJob ¶
func RegisterFilesystemWatcherJob(ctx context.Context, projectService *services.ProjectService, templateService *services.TemplateService, settingsService *services.SettingsService, projectScanDepth int) (*FilesystemWatcherJob, error)
func (*FilesystemWatcherJob) RestartProjectsWatcher ¶
func (j *FilesystemWatcherJob) RestartProjectsWatcher(ctx context.Context) error
func (*FilesystemWatcherJob) RestartTemplatesWatcher ¶
func (j *FilesystemWatcherJob) RestartTemplatesWatcher(ctx context.Context) error
func (*FilesystemWatcherJob) Start ¶
func (j *FilesystemWatcherJob) Start(ctx context.Context) error
func (*FilesystemWatcherJob) Stop ¶
func (j *FilesystemWatcherJob) Stop() error
type ImagePollingJob ¶
type ImagePollingJob struct {
// contains filtered or unexported fields
}
func NewImagePollingJob ¶
func NewImagePollingJob(imageUpdateService *services.ImageUpdateService, settingsService *services.SettingsService, environmentService *services.EnvironmentService) *ImagePollingJob
func (*ImagePollingJob) Name ¶
func (j *ImagePollingJob) Name() string
func (*ImagePollingJob) Reschedule ¶
func (j *ImagePollingJob) Reschedule(ctx context.Context) error
func (*ImagePollingJob) Run ¶
func (j *ImagePollingJob) Run(ctx context.Context)
func (*ImagePollingJob) ShouldSchedule ¶
func (j *ImagePollingJob) ShouldSchedule(ctx context.Context) bool
type JobScheduler ¶
type JobScheduler struct {
// contains filtered or unexported fields
}
func NewJobScheduler ¶
func NewJobScheduler(ctx context.Context, location *time.Location) *JobScheduler
NewJobScheduler creates a new job scheduler with the specified timezone location. The location is used for interpreting cron expressions. If location is nil, UTC is used.
func (*JobScheduler) AddJob ¶
func (js *JobScheduler) AddJob(ctx context.Context, job schedulertypes.Job) error
AddJob registers and schedules a job at runtime. It is an idempotent upsert: if a job with the same name is already scheduled, its existing cron entry is removed first (preventing a leaked, forever-firing entry when the schedule changes). Safe to call before or after StartScheduler.
func (*JobScheduler) GetJob ¶
func (js *JobScheduler) GetJob(jobID string) (schedulertypes.Job, bool)
func (*JobScheduler) GetLocation ¶
func (js *JobScheduler) GetLocation() *time.Location
GetLocation returns the timezone location used by the scheduler for cron expressions.
func (*JobScheduler) HasJob ¶
func (js *JobScheduler) HasJob(jobID string) bool
HasJob reports whether a job with the given name is currently registered.
func (*JobScheduler) RegisterJob ¶
func (js *JobScheduler) RegisterJob(job schedulertypes.Job)
RegisterJob records a static job to be scheduled when StartScheduler runs. Use AddJob for jobs added dynamically at runtime.
func (*JobScheduler) RemoveJob ¶
func (js *JobScheduler) RemoveJob(ctx context.Context, jobName string)
RemoveJob unschedules and forgets a job by name. It is a no-op (not an error) when no job with that name is registered.
func (*JobScheduler) RescheduleJob ¶
func (js *JobScheduler) RescheduleJob(ctx context.Context, job schedulertypes.Job) error
func (*JobScheduler) StartScheduler ¶
func (js *JobScheduler) StartScheduler()
type PruningVolumeHelperJob ¶
type PruningVolumeHelperJob struct {
// contains filtered or unexported fields
}
PruningVolumeHelperJob periodically removes idle volume-browser helper containers. The run frequency is fixed (every 5 minutes); how stale a helper must be to be pruned is driven by the volumeBrowserHelperIdleTimeout setting.
func NewPruningVolumeHelperJob ¶
func NewPruningVolumeHelperJob(volumeService *services.VolumeService, settingsService *services.SettingsService) *PruningVolumeHelperJob
func (*PruningVolumeHelperJob) Name ¶
func (j *PruningVolumeHelperJob) Name() string
func (*PruningVolumeHelperJob) Reschedule ¶
func (j *PruningVolumeHelperJob) Reschedule(ctx context.Context) error
func (*PruningVolumeHelperJob) Run ¶
func (j *PruningVolumeHelperJob) Run(ctx context.Context)
type ScheduledPruneJob ¶
type ScheduledPruneJob struct {
// contains filtered or unexported fields
}
func NewScheduledPruneJob ¶
func NewScheduledPruneJob(systemService *services.SystemService, settingsService *services.SettingsService, notificationService *services.NotificationService) *ScheduledPruneJob
func (*ScheduledPruneJob) Name ¶
func (j *ScheduledPruneJob) Name() string
func (*ScheduledPruneJob) Reschedule ¶
func (j *ScheduledPruneJob) Reschedule(ctx context.Context) error
func (*ScheduledPruneJob) Run ¶
func (j *ScheduledPruneJob) Run(ctx context.Context)
func (*ScheduledPruneJob) Schedule ¶
func (j *ScheduledPruneJob) Schedule(ctx context.Context) string
func (*ScheduledPruneJob) ShouldSchedule ¶
func (j *ScheduledPruneJob) ShouldSchedule(ctx context.Context) bool
type VulnerabilityScanJob ¶
type VulnerabilityScanJob struct {
// contains filtered or unexported fields
}
VulnerabilityScanJob periodically scans all Docker images for vulnerabilities using Trivy. It is opt-in via the "vulnerabilityScanEnabled" setting.
func NewVulnerabilityScanJob ¶
func NewVulnerabilityScanJob(vulnerabilityService *services.VulnerabilityService, settingsService *services.SettingsService) *VulnerabilityScanJob
NewVulnerabilityScanJob creates a new VulnerabilityScanJob.
func (*VulnerabilityScanJob) Name ¶
func (j *VulnerabilityScanJob) Name() string
func (*VulnerabilityScanJob) Run ¶
func (j *VulnerabilityScanJob) Run(ctx context.Context)
func (*VulnerabilityScanJob) Schedule ¶
func (j *VulnerabilityScanJob) Schedule(ctx context.Context) string
Schedule returns the cron expression for the job. Defaults to daily at midnight.
func (*VulnerabilityScanJob) ShouldSchedule ¶
func (j *VulnerabilityScanJob) ShouldSchedule(ctx context.Context) bool