Versions in this module Expand all Collapse all v1 v1.0.0 Feb 3, 2026 Changes in this version + func CheckTorConnection(socksAddr string) bool + func DropPrivileges(userName string) error + func FindAvailableSystemID() (int, error) + func GetServiceGroup(serviceName string) string + func GetServiceStatus() string + func GetServiceUser(serviceName string) string + func IsRunningAsRoot() bool + func UserExists(name string) bool + func VerifyPrivilegesDropped() error + type GracefulDegradation struct + func NewGracefulDegradation() *GracefulDegradation + func (g *GracefulDegradation) Execute(feature string, fn func() (interface{}, error)) (interface{}, error) + func (g *GracefulDegradation) GetDegradedFeatures() []string + func (g *GracefulDegradation) GetFallback(feature string) interface{} + func (g *GracefulDegradation) IsDegraded(feature string) bool + func (g *GracefulDegradation) MarkDegraded(feature string) + func (g *GracefulDegradation) MarkHealthy(feature string) + func (g *GracefulDegradation) RegisterFallback(feature string, fallback func() interface{}) + type HealthStatus struct + Component string + ErrorCount int + Healthy bool + LastCheck time.Time + LastHealthy time.Time + Message string + type MaintenanceMode int + const ModeDegraded + const ModeEmergency + const ModeMaintenance + const ModeNormal + const ModeRecovery + func (m MaintenanceMode) String() string + type MaintenanceService struct + func NewMaintenanceService(cfg *config.Config) *MaintenanceService + func (m *MaintenanceService) BackupDatabase(dbPath, backupDir string) (string, error) + func (m *MaintenanceService) CheckDatabaseIntegrity(db *sql.DB) error + func (m *MaintenanceService) DisableMaintenance() + func (m *MaintenanceService) EnableMaintenance(message string, duration time.Duration) + func (m *MaintenanceService) GetHealthStatus() map[string]*HealthStatus + func (m *MaintenanceService) GetMessage() string + func (m *MaintenanceService) GetMode() MaintenanceMode + func (m *MaintenanceService) GetScheduledEnd() time.Time + func (m *MaintenanceService) GetStatus() map[string]interface{} + func (m *MaintenanceService) IsDegraded() bool + func (m *MaintenanceService) IsInMaintenance() bool + func (m *MaintenanceService) IsNormal() bool + func (m *MaintenanceService) RegisterCallback(cb func(MaintenanceMode)) + func (m *MaintenanceService) RegisterRecoveryFunc(component string, fn func(ctx context.Context) error) + func (m *MaintenanceService) RepairDatabase(dbPath string) error + func (m *MaintenanceService) RestoreDatabase(backupPath, dbPath string) error + func (m *MaintenanceService) SetDatabaseChecks(serverCheck, usersCheck func(ctx context.Context) error) + func (m *MaintenanceService) SetMode(mode MaintenanceMode, message string) + func (m *MaintenanceService) Start() error + func (m *MaintenanceService) Stop() + type PrivilegeEscalator struct + func NewPrivilegeEscalator() *PrivilegeEscalator + func (p *PrivilegeEscalator) EscalateCommand(cmd string, args ...string) *exec.Cmd + func (p *PrivilegeEscalator) IsAvailable() bool + func (p *PrivilegeEscalator) Method() string + type ServiceManager struct + func NewServiceManager(cfg *config.Config) *ServiceManager + func (sm *ServiceManager) Disable() error + func (sm *ServiceManager) Enable() error + func (sm *ServiceManager) Install() error + func (sm *ServiceManager) Reload() error + func (sm *ServiceManager) Restart() error + func (sm *ServiceManager) Start() error + func (sm *ServiceManager) Status() (string, error) + func (sm *ServiceManager) Stop() error + func (sm *ServiceManager) Uninstall() error + type SystemUser struct + GID int + Home string + Name string + Shell string + UID int + func CreateSystemUser(name string) (*SystemUser, error) + type TorService struct + func NewTorService(cfg *config.Config) *TorService + func (t *TorService) ApplyVanityAddress() (string, error) + func (t *TorService) CancelVanity() + func (t *TorService) ExportKeys() ([]byte, error) + func (t *TorService) GenerateVanity(prefix string) error + func (t *TorService) GetHTTPClient(useTor bool) *http.Client + func (t *TorService) GetOnionAddress() string + func (t *TorService) GetTorStatus() map[string]interface{} + func (t *TorService) GetVanityProgress() *VanityProgress + func (t *TorService) ImportKeys(privateKey []byte) (string, error) + func (t *TorService) IsRunning() bool + func (t *TorService) OutboundEnabled() bool + func (t *TorService) RegenerateAddress() (string, error) + func (t *TorService) Restart() error + func (t *TorService) SetEnabled(enabled bool) error + func (t *TorService) Shutdown() + func (t *TorService) Start() error + func (t *TorService) Stop() error + type VanityProgress struct + Address string + Attempts int64 + Error string + Found bool + Prefix string + Running bool + StartTime time.Time