Documentation
¶
Index ¶
- Constants
- func RegisterSystem(api huma.API, h *SystemHandler)
- type ContainersActionInput
- type ConvertDockerRunInput
- type ConvertDockerRunOutput
- type GetDockerInfoOutput
- type Module
- type SystemBackupRun
- type SystemBackupStatus
- type SystemBackupTrigger
- type SystemHandler
- func (h *SystemHandler) ConvertDockerRun(ctx context.Context, input *ConvertDockerRunInput) (*ConvertDockerRunOutput, error)
- func (h *SystemHandler) GetDockerInfo(ctx context.Context, input *types.EnvironmentInput) (*GetDockerInfoOutput, error)
- func (h *SystemHandler) Health(ctx context.Context, input *types.EnvironmentInput) (*struct{}, error)
- func (h *SystemHandler) RunContainersAction(ctx context.Context, input *ContainersActionInput) (*handlerutil.Out[types.ContainerActionResult], error)
- type SystemService
- func (s *SystemService) GetDockerHostMemory(ctx context.Context) (uint64, uint64, bool)
- func (s *SystemService) GetDockerInfo(ctx context.Context) (types.DockerInfo, error)
- func (s *SystemService) PingDocker(ctx context.Context) error
- func (s *SystemService) PruneLocalBackupRepository(ctx context.Context) error
- func (s *SystemService) PruneScheduled(ctx context.Context, environmentID string, req types.PruneAllRequest) (*types.PruneAllResult, bool, error)
- func (s *SystemService) PruneUpgradeLogs(ctx context.Context, dataDir string, now time.Time) (int, error)
- func (s *SystemService) ReconcileInterruptedBackups(ctx context.Context, protectedIDs ...string) error
- func (s *SystemService) ReconcileScheduledPrune(ctx context.Context, previous types.SchedulerRun) (types.SchedulerOutcome, error)
- func (s *SystemService) RegisterBackupJobOnStartup(ctx context.Context)
- func (s *SystemService) RegisterWorkflows(engine *flow.Engine, environments *environment.EnvironmentService, ...) error
- func (s *SystemService) ResumeUpgradeJobOnStartup(ctx context.Context)
- func (s *SystemService) RunUpgradeStreamProducer(ctx context.Context, events chan<- types.UpgradeJob)
- func (s *SystemService) StartAllContainers(ctx context.Context, environmentID string) (*types.ContainerActionResult, error)
- func (s *SystemService) StartAllStoppedContainers(ctx context.Context, environmentID string) (*types.ContainerActionResult, error)
- func (s *SystemService) StopAllContainers(ctx context.Context, environmentID string) (*types.ContainerActionResult, error)
- func (s *SystemService) TriggerUpgradeViaCLI(ctx context.Context, user types.Actor, target updater.SelfUpdateTarget) (string, error)
- type SystemServiceParams
Constants ¶
View Source
const ( SystemBackupStatusRunning SystemBackupStatus = types.SystemBackupStatusRunning SystemBackupStatusSucceeded SystemBackupStatus = types.SystemBackupStatusSucceeded SystemBackupStatusFailed SystemBackupStatus = types.SystemBackupStatusFailed SystemBackupTriggerManual SystemBackupTrigger = types.SystemBackupTriggerManual SystemBackupTriggerScheduled SystemBackupTrigger = types.SystemBackupTriggerScheduled SystemBackupTriggerSafety SystemBackupTrigger = types.SystemBackupTriggerSafety SystemBackupTriggerManager SystemBackupTrigger = types.SystemBackupTriggerManager )
Variables ¶
This section is empty.
Functions ¶
func RegisterSystem ¶
func RegisterSystem(api huma.API, h *SystemHandler)
Types ¶
type ContainersActionInput ¶
type ConvertDockerRunInput ¶
type ConvertDockerRunInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
Body types.ConvertDockerRunRequest `doc:"Docker run command"`
}
type ConvertDockerRunOutput ¶
type ConvertDockerRunOutput struct {
Body types.ConvertDockerRunResponse
}
type GetDockerInfoOutput ¶
type GetDockerInfoOutput struct {
Body types.DockerInfo
}
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func New ¶
func New( service *SystemService, activityService *activity.ActivityService, cfg *config.Config, ) *Module
func (*Module) RegisterRoutes ¶
func (m *Module) RegisterRoutes(api huma.API, appCtx handlerutil.ActivityAppContext)
func (*Module) Service ¶
func (m *Module) Service() *SystemService
type SystemBackupRun ¶
type SystemBackupRun struct {
database.BaseModel
CreatedAt time.Time `json:"createdAt" gorm:"column:created_at" sortable:"true"`
Status SystemBackupStatus `json:"status" gorm:"column:status;type:text;not null" sortable:"true"`
Trigger SystemBackupTrigger `json:"trigger" gorm:"column:trigger;type:text;not null" sortable:"true"`
Destination types.SystemBackupDestination `json:"destination" gorm:"column:destination;type:text;not null" sortable:"true"`
LocalSnapshotID string `json:"localSnapshotId,omitempty" gorm:"column:local_snapshot_id;type:text"`
RemoteSnapshotID string `json:"remoteSnapshotId,omitempty" gorm:"column:remote_snapshot_id;type:text"`
S3DestinationID string `json:"s3DestinationId,omitempty" gorm:"column:s3_destination_id;type:text;index"`
S3DestinationName string `json:"s3DestinationName,omitempty" gorm:"-"`
PolicyID string `json:"policyId,omitempty" gorm:"column:policy_id;type:text;index"`
Error string `json:"error,omitempty" gorm:"column:error;type:text"`
Size int64 `json:"size" gorm:"column:size" sortable:"true"`
}
func (SystemBackupRun) TableName ¶
func (SystemBackupRun) TableName() string
func (SystemBackupRun) ToDTO ¶
func (b SystemBackupRun) ToDTO() types.SystemBackupRun
type SystemBackupStatus ¶
type SystemBackupStatus string
type SystemBackupTrigger ¶
type SystemBackupTrigger string
type SystemHandler ¶
type SystemHandler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(systemService *SystemService, appCtx context.Context) *SystemHandler
func (*SystemHandler) ConvertDockerRun ¶
func (h *SystemHandler) ConvertDockerRun(ctx context.Context, input *ConvertDockerRunInput) (*ConvertDockerRunOutput, error)
func (*SystemHandler) GetDockerInfo ¶
func (h *SystemHandler) GetDockerInfo(ctx context.Context, input *types.EnvironmentInput) (*GetDockerInfoOutput, error)
func (*SystemHandler) Health ¶
func (h *SystemHandler) Health(ctx context.Context, input *types.EnvironmentInput) (*struct{}, error)
func (*SystemHandler) RunContainersAction ¶
func (h *SystemHandler) RunContainersAction(ctx context.Context, input *ContainersActionInput) (*handlerutil.Out[types.ContainerActionResult], error)
type SystemService ¶
type SystemService struct {
// contains filtered or unexported fields
}
func NewSystemService ¶
func NewSystemService(p SystemServiceParams) *SystemService
func (*SystemService) GetDockerHostMemory ¶
func (*SystemService) GetDockerInfo ¶
func (s *SystemService) GetDockerInfo(ctx context.Context) (types.DockerInfo, error)
func (*SystemService) PingDocker ¶
func (s *SystemService) PingDocker(ctx context.Context) error
func (*SystemService) PruneLocalBackupRepository ¶
func (s *SystemService) PruneLocalBackupRepository(ctx context.Context) error
func (*SystemService) PruneScheduled ¶
func (s *SystemService) PruneScheduled(ctx context.Context, environmentID string, req types.PruneAllRequest) (*types.PruneAllResult, bool, error)
func (*SystemService) PruneUpgradeLogs ¶
func (*SystemService) ReconcileInterruptedBackups ¶
func (s *SystemService) ReconcileInterruptedBackups(ctx context.Context, protectedIDs ...string) error
func (*SystemService) ReconcileScheduledPrune ¶
func (s *SystemService) ReconcileScheduledPrune(ctx context.Context, previous types.SchedulerRun) (types.SchedulerOutcome, error)
func (*SystemService) RegisterBackupJobOnStartup ¶
func (s *SystemService) RegisterBackupJobOnStartup(ctx context.Context)
func (*SystemService) RegisterWorkflows ¶
func (s *SystemService) RegisterWorkflows(engine *flow.Engine, environments *environment.EnvironmentService, roles *role.RoleService) error
func (*SystemService) ResumeUpgradeJobOnStartup ¶
func (s *SystemService) ResumeUpgradeJobOnStartup(ctx context.Context)
func (*SystemService) RunUpgradeStreamProducer ¶
func (s *SystemService) RunUpgradeStreamProducer(ctx context.Context, events chan<- types.UpgradeJob)
func (*SystemService) StartAllContainers ¶
func (s *SystemService) StartAllContainers(ctx context.Context, environmentID string) (*types.ContainerActionResult, error)
func (*SystemService) StartAllStoppedContainers ¶
func (s *SystemService) StartAllStoppedContainers(ctx context.Context, environmentID string) (*types.ContainerActionResult, error)
func (*SystemService) StopAllContainers ¶
func (s *SystemService) StopAllContainers(ctx context.Context, environmentID string) (*types.ContainerActionResult, error)
func (*SystemService) TriggerUpgradeViaCLI ¶
func (s *SystemService) TriggerUpgradeViaCLI(ctx context.Context, user types.Actor, target updater.SelfUpdateTarget) (string, error)
type SystemServiceParams ¶
type SystemServiceParams struct {
fx.In
DB *database.DB
DockerService *dockerInternal.DockerClientService
ContainerService *container.ContainerService
ImageUpdateService *imageupdate.ImageUpdateService
VolumeService *volume.VolumeService
NetworkService *network.NetworkService
SettingsService *settings.SettingsService
ActivityService *activity.ActivityService
VersionService *version.VersionService
EventService *event.EventService
ProjectService *project.ProjectService
RegistryService *registry.ContainerRegistryService
BackupEngine *backup.Engine
BackupRepository *backup.VolumeRepository
S3Destinations *s3.S3DestinationService
RecoveryKeys *backup.RecoveryKeyStore
Policies *backup.Policies
Actors *francis.Runtime
Config *config.Config
SettingsEnv settings.Env
Ctx context.Context
Scheduler types.DynamicScheduler
Admission *runs.Admission
}
Click to show internal directories.
Click to hide internal directories.