services

package
v4.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MaintenanceScheduler

type MaintenanceScheduler interface {
	// Start begins the maintenance scheduler
	Start() error
	// Stop stops the maintenance scheduler
	Stop()
	// UpdateSchedule updates the maintenance schedule
	UpdateSchedule(schedule string, enabled bool) error
	// RunManual runs maintenance manually (outside of schedule)
	RunManual() error
}

MaintenanceScheduler defines the interface for maintenance scheduling.

type MaintenanceService

type MaintenanceService interface {
	// RunMaintenance executes database maintenance operations
	RunMaintenance(ctx context.Context) error
	// RunKubernetesCleanup executes Kubernetes resource cleanup
	RunKubernetesCleanup(ctx context.Context, dryRun bool) error
	// RunStaleAgentCleanup executes stale agent cleanup
	RunStaleAgentCleanup(ctx context.Context, staleDuration time.Duration) error
	// GetMaintenanceConfig returns the current maintenance configuration
	GetMaintenanceConfig() *model.MaintenanceConfig
	// UpdateMaintenanceConfig updates the maintenance configuration
	UpdateMaintenanceConfig(config *model.MaintenanceConfig) error
	// GetMaintenanceConfigByAction returns config for a specific action type
	GetMaintenanceConfigByAction(actionType string) (*model.MaintenanceConfig, error)
	// UpdateMaintenanceConfigByAction updates config for a specific action type
	UpdateMaintenanceConfigByAction(actionType string, config *model.MaintenanceConfig) error
	// IsKubernetesCleanupAvailable returns whether Kubernetes cleanup is available
	IsKubernetesCleanupAvailable() bool
	// GetMaintenanceStats returns maintenance statistics
	GetMaintenanceStats() (*model.MaintenanceStats, error)
	// SetKubernetesCleanupFunc sets the function to use for Kubernetes cleanup
	SetKubernetesCleanupFunc(f func(ctx context.Context, dryRun bool) error)
	// SetKubernetesCleanupEnabled sets whether Kubernetes cleanup is enabled for execution
	SetKubernetesCleanupEnabled(enabled bool)
	// SetVacuumEnvVarsConfigured sets whether vacuum-specific environment variables are overriding configuration
	SetVacuumEnvVarsConfigured(vacuumEnvVarsSet bool)
	// IsVacuumEnvVarsConfigured returns whether vacuum-specific environment variables are set
	IsVacuumEnvVarsConfigured() bool
	// SetKubernetesEnvVarsConfigured sets whether Kubernetes-specific environment variables are set
	SetKubernetesEnvVarsConfigured(k8sEnvVarsSet bool)
	// IsKubernetesEnvVarsConfigured returns whether Kubernetes-specific environment variables are set
	IsKubernetesEnvVarsConfigured() bool
}

MaintenanceService defines the interface for database maintenance operations.

type Manager

type Manager interface {
	SignaturePublicKey() crypto.PublicKey
	SecretServiceFromRepo(repo *model.Repo) secret.Service
	SecretService() secret.Service
	RegistryServiceFromRepo(repo *model.Repo) registry.Service
	RegistryService() registry.Service
	ConfigServiceFromRepo(repo *model.Repo) config.Service
	EnvironmentService() environment.Service
	ForgeFromRepo(repo *model.Repo) (forge.Forge, error)
	ForgeFromUser(user *model.User) (forge.Forge, error)
	ForgeByID(forgeID int64) (forge.Forge, error)
}

func NewManager

func NewManager(c *cli.Command, store store.Store, setupForge SetupForge) (Manager, error)

type SetupForge

type SetupForge func(forge *model.Forge) (forge.Forge, error)

type Store

type Store interface {
	store.Store
}

Store interface for maintenance service (to avoid circular imports).

Jump to

Keyboard shortcuts

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