cron

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CronLog

type CronLog struct {
	ID                            int               `db:"id" json:"id,omitempty"`
	InstanceName                  string            `db:"instance_name" json:"instanceName"`
	StartedAt                     rfc3339time.Time  `db:"started_at" json:"startedAt"`
	CompletedAt                   *rfc3339time.Time `db:"completed_at" json:"completedAt,omitempty"`
	BackupStatus                  *string           `db:"backup_status" json:"backupStatus,omitempty"`
	BackupFinishedAt              *rfc3339time.Time `db:"backup_finished_at" json:"backupFinishedAt,omitempty"`
	BackupError                   *string           `db:"backup_error" json:"backupError,omitempty"`
	BackupUploadStatus            *string           `db:"backup_upload_status" json:"backupUploadStatus,omitempty"`
	BackupUploadFinishedAt        *rfc3339time.Time `db:"backup_upload_finished_at" json:"backupUploadFinishedAt,omitempty"`
	BackupUploadError             *string           `db:"backup_upload_error" json:"backupUploadError,omitempty"`
	BackupCleanupStatus           *string           `db:"backup_cleanup_status" json:"backupCleanupStatus,omitempty"`
	BackupCleanupFinishedAt       *rfc3339time.Time `db:"backup_cleanup_finished_at" json:"backupCleanupFinishedAt,omitempty"`
	BackupCleanupError            *string           `db:"backup_cleanup_error" json:"backupCleanupError,omitempty"`
	BackupRemoteCleanupStatus     *string           `db:"backup_remote_cleanup_status" json:"backupRemoteCleanupStatus,omitempty"`
	BackupRemoteCleanupFinishedAt *rfc3339time.Time `db:"backup_remote_cleanup_finished_at" json:"backupRemoteCleanupFinishedAt,omitempty"`
	BackupRemoteCleanupError      *string           `db:"backup_remote_cleanup_error" json:"backupRemoteCleanupError,omitempty"`
}

type CronPlan

type CronPlan struct {
	InstanceName      string           `db:"instance_name" json:"instanceName"`
	UTCHour           int              `db:"utc_hour" json:"utcHour"`
	CleanupLocalDays  int              `db:"cleanup_local_days" json:"cleanupLocalDays"`
	CleanupRemoteDays int              `db:"cleanup_remote_days" json:"cleanupRemoteDays"`
	CreatedAt         rfc3339time.Time `db:"created_at" json:"createdAt"`
	UpdatedAt         rfc3339time.Time `db:"updated_at" json:"updatedAt"`
}

type CronStore

type CronStore struct {
	// contains filtered or unexported fields
}

func NewCronStore

func NewCronStore(db *sqlx.DB) *CronStore

func (*CronStore) CheckPlanExists

func (s *CronStore) CheckPlanExists(instanceName string) (bool, error)

func (*CronStore) CompleteLog

func (s *CronStore) CompleteLog(logID int) error

func (*CronStore) CreateLog

func (s *CronStore) CreateLog(instanceName string) (*CronLog, error)

func (*CronStore) CreatePlan

func (s *CronStore) CreatePlan(instanceName string, utcHour, cleanupLocalDays, cleanupRemoteDays int) error

func (*CronStore) DeletePlan

func (s *CronStore) DeletePlan(instanceName string) error

func (*CronStore) GetAllPlans

func (s *CronStore) GetAllPlans() ([]*CronPlan, error)

func (*CronStore) GetLatestLogForInstance

func (s *CronStore) GetLatestLogForInstance(instanceName string) (*CronLog, error)

func (*CronStore) GetPlan

func (s *CronStore) GetPlan(instanceName string) (*CronPlan, error)

func (*CronStore) GetPlansForHour

func (s *CronStore) GetPlansForHour(utcHour int) ([]*CronPlan, error)

func (*CronStore) HasRunInLastHour

func (s *CronStore) HasRunInLastHour(instanceName string) (bool, error)

func (*CronStore) ListLogs

func (s *CronStore) ListLogs(instanceName string, limit int) ([]*CronLog, error)

func (*CronStore) ListPlans

func (s *CronStore) ListPlans() ([]*CronPlan, error)

func (*CronStore) UpdateLog

func (s *CronStore) UpdateLog(logID int, updates map[string]any) error

Jump to

Keyboard shortcuts

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