Documentation
¶
Overview ¶
Package commands provides cache management CLI commands
Index ¶
- Constants
- Variables
- func AddContextualHelp(cmd *cobra.Command, context help.HelpContext, specific string)
- func BuildSecureDockerCommand(containerName, image, portMapping, envVar string) (string, error)
- func DetectRequiredPlugins(plat platform.DetectionResult) []string
- func ExecuteSecureShellChange(ctx context.Context, shellPath, username string) error
- func GetAppVersionForTesting(ctx context.Context, app *types.AppConfig) string
- func GetCommandHelp(command string) string
- func GetPluginBootstrap() *bootstrap.PluginBootstrap
- func LoadCommands(repo types.Repository, settings config.CrossPlatformSettings) []*cobra.Command
- func NewAddCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewCacheCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewCompletionCmd() *cobra.Command
- func NewConfigCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewDetectCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewHelpCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewInitCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewInstallCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewListCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewRecoveryCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewRemoveCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewRollbackCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewRootCmd(version string, repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewSetupCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewShellCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewStatusCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewSystemCmd(settings config.CrossPlatformSettings) *cobra.Command
- func NewTemplateCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewTemplateCustomCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewUndoCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func NewUninstallCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
- func Register(...)
- func ValidateDockerConfig(containerName, image, portMapping, envVar string) error
- func ValidatePath(targetPath, basePath string) error
- func ValidateShellCommand(shellPath, username string) error
- type AddModel
- type AppItem
- type AppItemDelegate
- type ApplicationsConfig
- type AvailableApp
- type BackupEntry
- type BackupInfo
- type BackupManager
- type BoundedErrorCollector
- type CategoryInfo
- type ConfigInfo
- type ConfigSummary
- type ConflictDetector
- func (cd *ConflictDetector) DetectConflicts(apps []types.AppConfig, cascade bool) ([]UninstallConflict, error)
- func (cd *ConflictDetector) ResolveConflicts(conflicts []UninstallConflict, options UninstallOptions) ([]UninstallConflict, error)
- func (cd *ConflictDetector) SummarizeConflicts(conflicts []UninstallConflict) ConflictSummary
- type ConflictSummary
- type ConflictType
- type DependencyManager
- type DesktopConfig
- type EnvironmentConfig
- type GitConfiguration
- type InitConfig
- type InstallCompleteMsg
- type InstallProgressMsg
- type InstallQuitMsg
- type InstallationState
- type InstalledApp
- type ListCommandOptions
- type PlatformConfig
- type PlatformPluginMapping
- type PluginInstallCompleteMsg
- type PluginInstallMsg
- type PluginState
- type PluginStatus
- type PluginStatusUpdateMsg
- type PluginValidationResult
- type PluginValidator
- type PluginValidatorConfig
- type ProfileTemplate
- type RemoveAppItem
- type RemoveItemDelegate
- type RemoveModel
- type SetupModel
- type SystemConfig
- type SystemInfo
- type TableConfig
- type TemplateSelectionModel
- type UISelections
- type UninstallConflict
- type UninstallHistoryEntry
- type UninstallOptions
- type ValidationSummary
Constants ¶
const ( PostgreSQLPort = "5432:5432" MySQLPort = "3306:3306" RedisPort = "6379:6379" )
Port constants for database containers
const ( TableTopLeft = "┌" TableTopRight = "┐" TableBottomLeft = "└" TableBottomRight = "┘" TableCross = "┼" TableTeeDown = "┬" TableTeeUp = "┴" TableTeeRight = "├" TableTeeLeft = "┤" TableVertical = "│" TableHorizontal = "─" )
Table drawing constants
const ( DefaultNameWidth = 20 DefaultDescriptionWidth = 40 DefaultCategoryWidth = 15 DefaultMethodWidth = 12 DefaultStatusWidth = 10 DefaultPlatformWidth = 15 MaxNameWidth = 50 MaxDescriptionWidth = 80 MaxCategoryWidth = 25 MaxMethodWidth = 20 MaxStatusWidth = 15 MaxPlatformWidth = 30 )
Default column widths
const ( StepSystemOverview = iota StepPluginInstall // Install required plugins first StepDesktopApps // Only if desktop detected & non-default apps available StepLanguages StepDatabases StepShell // Only for compatible systems (Linux/macOS) StepTheme // Theme selection after shell StepGitConfig // Full name & email for git configuration StepConfirmation StepInstalling StepComplete )
setupSteps defines the guided setup process
const ( // UI Constants WaitActivityInterval = 100 // milliseconds // Default selections for automated setup DefaultNodeJSIndex = 0 // Node.js DefaultPythonIndex = 1 // Python DefaultPostgreSQLIndex = 0 // PostgreSQL // File permissions DirectoryPermissions = 0755 ExecutablePermissions = 0755 RegularFilePermissions = 0644 )
Constants for setup configuration
const ( // Plugin operation timeouts PluginInstallTimeout = 5 * time.Minute // Plugin installation timeout - controls how long we wait for plugin installation to complete PluginVerifyTimeout = 30 * time.Second // Per-plugin verification timeout for security validation (checksum/signature) PluginDownloadTimeout = 2 * time.Minute // Plugin download timeout for network operations NetworkOperationTimeout = 30 * time.Second // General network operation timeout for API calls and downloads // Default shell index (zsh) - used when no explicit shell selection is made // Corresponds to the index in the shell options array where zsh is the first option DefaultShellIndex = 0 // UI Configuration constants for terminal interface appearance ProgressBarWidth = 50 // Width of progress bars in terminal characters (fits in standard 80-column terminals) MaxErrorMessages = 100 // Maximum number of error messages to collect to prevent unbounded memory growth during installation failures // System resource limits for safe memory management MaxPluginsPerPlatform = 20 // Maximum expected plugins per platform, used for slice pre-allocation to optimize performance )
Setup constants for configuration and timeouts
Variables ¶
var FallbackThemes = []string{
"Tokyo Night",
"Synthwave 84",
}
FallbackThemes provides default themes when configuration loading fails These are the themes available for the 1.0 release and are used when: - Configuration files cannot be loaded - Network issues prevent theme discovery - User is in offline mode during setup
Functions ¶
func AddContextualHelp ¶
func AddContextualHelp(cmd *cobra.Command, context help.HelpContext, specific string)
AddContextualHelp adds contextual help flags to any command
func BuildSecureDockerCommand ¶
BuildSecureDockerCommand constructs a Docker command with proper validation and escaping
func DetectRequiredPlugins ¶
func DetectRequiredPlugins(plat platform.DetectionResult) []string
DetectRequiredPlugins detects which DevEx plugins are needed for the current system
func ExecuteSecureShellChange ¶
ExecuteSecureShellChange executes chsh command with proper validation and argument separation
func GetAppVersionForTesting ¶
GetAppVersionForTesting is exported for testing purposes only
func GetCommandHelp ¶
GetCommandHelp returns quick help text for a command
func GetPluginBootstrap ¶
func GetPluginBootstrap() *bootstrap.PluginBootstrap
GetPluginBootstrap returns the plugin bootstrap instance
func LoadCommands ¶
func LoadCommands(repo types.Repository, settings config.CrossPlatformSettings) []*cobra.Command
LoadCommands initializes and returns all registered commands.
func NewAddCmd ¶
func NewAddCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewAddCmd creates a new add command
func NewCacheCmd ¶
func NewCacheCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewCacheCmd creates the cache management command
func NewCompletionCmd ¶
func NewConfigCmd ¶
func NewConfigCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewConfigCmd creates a new config command
func NewDetectCmd ¶
func NewDetectCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewDetectCmd creates a new detect command for technology stack detection
func NewHelpCmd ¶
func NewHelpCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewHelpCmd creates a new help command
func NewInitCmd ¶
func NewInitCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewInitCmd creates a new init command
func NewInstallCmd ¶
func NewInstallCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
func NewListCmd ¶
func NewListCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewListCmd creates the list command with comprehensive subcommand support
func NewRecoveryCmd ¶
func NewRecoveryCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewRecoveryCmd creates a new recovery command for error recovery assistance
func NewRemoveCmd ¶
func NewRemoveCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewRemoveCmd creates a new remove command
func NewRollbackCmd ¶
func NewRollbackCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
func NewRootCmd ¶
func NewRootCmd(version string, repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
func NewSetupCmd ¶
func NewSetupCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
func NewShellCmd ¶
func NewShellCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewShellCmd creates the shell command
func NewStatusCmd ¶
func NewStatusCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewStatusCmd creates a new status command
func NewSystemCmd ¶
func NewSystemCmd(settings config.CrossPlatformSettings) *cobra.Command
NewSystemCmd creates the system command with plugin redirect
func NewTemplateCmd ¶
func NewTemplateCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewTemplateCmd creates a new template command with versioning support
func NewTemplateCustomCmd ¶
func NewTemplateCustomCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewTemplateCustomCmd creates the template custom command group
func NewUndoCmd ¶
func NewUndoCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
NewUndoCmd creates a new undo command
func NewUninstallCmd ¶
func NewUninstallCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command
func Register ¶
func Register(cmdFunc func(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command)
Register adds a new command to the registry.
func ValidateDockerConfig ¶
ValidateDockerConfig validates Docker configuration parameters for security
func ValidatePath ¶
ValidatePath validates that targetPath is within basePath to prevent directory traversal
func ValidateShellCommand ¶
ValidateShellCommand validates parameters for shell command execution
Types ¶
type AddModel ¶
type AddModel struct {
// contains filtered or unexported fields
}
AddModel represents the TUI state for the add command
func NewAddModel ¶
func NewAddModel(settings config.CrossPlatformSettings) *AddModel
NewAddModel creates a new add command TUI model
type AppItem ¶
type AppItem struct {
// contains filtered or unexported fields
}
AppItem represents an application item for the list component
func (AppItem) Description ¶
func (AppItem) FilterValue ¶
type AppItemDelegate ¶
type AppItemDelegate struct{}
AppItemDelegate renders list items
func (AppItemDelegate) Height ¶
func (d AppItemDelegate) Height() int
func (AppItemDelegate) Spacing ¶
func (d AppItemDelegate) Spacing() int
type ApplicationsConfig ¶
type ApplicationsConfig struct { Categories []string `yaml:"categories"` Defaults bool `yaml:"install_defaults"` Custom []string `yaml:"custom_apps,omitempty"` }
ApplicationsConfig represents application preferences
type AvailableApp ¶
type AvailableApp struct { Name string Description string Category string Platform string Method string Recommended bool }
AvailableApp represents an application available for installation
type BackupEntry ¶
type BackupEntry struct { AppName string `json:"app_name"` BackupPath string `json:"backup_path"` CreatedAt time.Time `json:"created_at"` PackageInfo string `json:"package_info"` ConfigFiles []string `json:"config_files"` DataFiles []string `json:"data_files"` Dependencies []string `json:"dependencies"` Services []string `json:"services"` }
BackupEntry represents a backup entry
type BackupInfo ¶
type BackupInfo struct { Timestamp time.Time `yaml:"timestamp"` Apps []string `yaml:"apps"` FilePath string `yaml:"file_path"` }
BackupInfo contains information about a configuration backup
type BackupManager ¶
type BackupManager struct {
// contains filtered or unexported fields
}
BackupManager handles backup and restore operations for uninstall operations
func NewBackupManager ¶
func NewBackupManager(repo types.Repository) *BackupManager
NewBackupManager creates a new backup manager instance
func (*BackupManager) CleanupOldBackups ¶
func (bm *BackupManager) CleanupOldBackups(maxAge time.Duration) error
CleanupOldBackups removes backups older than the specified duration
func (*BackupManager) CreateBackup ¶
func (bm *BackupManager) CreateBackup(app *types.AppConfig) (*BackupEntry, error)
CreateBackup creates a backup of an application before uninstalling
func (*BackupManager) ListBackups ¶
func (bm *BackupManager) ListBackups() ([]BackupEntry, error)
ListBackups lists all available backups
func (*BackupManager) RestoreBackup ¶
func (bm *BackupManager) RestoreBackup(backupPath string) error
RestoreBackup restores an application from backup
type BoundedErrorCollector ¶
type BoundedErrorCollector struct {
// contains filtered or unexported fields
}
BoundedErrorCollector manages error collection with memory bounds This prevents unbounded memory growth during error collection while preserving important error information
func NewBoundedErrorCollector ¶
func NewBoundedErrorCollector(maxErrors int) *BoundedErrorCollector
NewBoundedErrorCollector creates a new error collector with specified bounds
func (*BoundedErrorCollector) AddError ¶
func (c *BoundedErrorCollector) AddError(err error)
AddError safely adds an error to the collector
func (*BoundedErrorCollector) GetErrors ¶
func (c *BoundedErrorCollector) GetErrors() []error
GetErrors returns a copy of collected errors
func (*BoundedErrorCollector) IsTruncated ¶
func (c *BoundedErrorCollector) IsTruncated() bool
IsTruncated returns whether error collection was truncated
type CategoryInfo ¶
CategoryInfo represents information about a category and its applications
type ConfigInfo ¶
type ConfigInfo struct { Path string `yaml:"path"` Size int64 `yaml:"size"` ModTime time.Time `yaml:"modified"` Exists bool `yaml:"exists"` Valid bool `yaml:"valid"` ErrorMessage string `yaml:"error,omitempty"` }
ConfigInfo represents configuration file information
type ConfigSummary ¶
type ConfigSummary struct { ConfigDir string `yaml:"config_dir"` Applications ConfigInfo `yaml:"applications"` Environment ConfigInfo `yaml:"environment"` System ConfigInfo `yaml:"system"` Desktop ConfigInfo `yaml:"desktop"` InitMetadata ConfigInfo `yaml:"init_metadata"` Backups []string `yaml:"backups"` TotalSize int64 `yaml:"total_size"` LastModified time.Time `yaml:"last_modified"` ValidationErrors []string `yaml:"validation_errors,omitempty"` }
ConfigSummary represents a summary of all configuration files
type ConflictDetector ¶
type ConflictDetector struct {
// contains filtered or unexported fields
}
ConflictDetector handles detection of uninstall conflicts
func NewConflictDetector ¶
func NewConflictDetector(repo types.Repository) *ConflictDetector
NewConflictDetector creates a new conflict detector
func (*ConflictDetector) DetectConflicts ¶
func (cd *ConflictDetector) DetectConflicts(apps []types.AppConfig, cascade bool) ([]UninstallConflict, error)
DetectConflicts detects all conflicts for uninstalling the given applications
func (*ConflictDetector) ResolveConflicts ¶
func (cd *ConflictDetector) ResolveConflicts(conflicts []UninstallConflict, options UninstallOptions) ([]UninstallConflict, error)
ResolveConflicts provides automatic resolution for some conflicts
func (*ConflictDetector) SummarizeConflicts ¶
func (cd *ConflictDetector) SummarizeConflicts(conflicts []UninstallConflict) ConflictSummary
SummarizeConflicts creates a summary of detected conflicts
type ConflictSummary ¶
type ConflictSummary struct { TotalConflicts int CriticalCount int WarningCount int InfoCount int CanProceed bool }
ConflictSummary provides a summary of conflicts
type ConflictType ¶
type ConflictType string
ConflictType represents the type of conflict detected
const ( ConflictTypeDependency ConflictType = "dependency" ConflictTypeFileConflict ConflictType = "file_conflict" ConflictTypeServiceConflict ConflictType = "service_conflict" ConflictTypeSystemPackage ConflictType = "system_package" ConflictTypeActiveService ConflictType = "active_service" )
type DependencyManager ¶
type DependencyManager struct {
// contains filtered or unexported fields
}
DependencyManager handles dependency analysis and management for uninstall operations
func NewDependencyManager ¶
func NewDependencyManager(repo types.Repository) *DependencyManager
NewDependencyManager creates a new dependency manager instance
func (*DependencyManager) FindOrphans ¶
func (dm *DependencyManager) FindOrphans() ([]string, error)
FindOrphans finds orphaned packages in the system
func (*DependencyManager) GetDependents ¶
func (dm *DependencyManager) GetDependents(packageName string) ([]string, error)
GetDependents returns packages that depend on the given package
func (*DependencyManager) IsSystemPackage ¶
func (dm *DependencyManager) IsSystemPackage(packageName string) bool
IsSystemPackage checks if a package is a critical system package
func (*DependencyManager) RemoveOrphans ¶
func (dm *DependencyManager) RemoveOrphans() error
RemoveOrphans removes all orphaned packages
type DesktopConfig ¶
type DesktopConfig struct { Environment string `yaml:"environment"` Themes []string `yaml:"themes,omitempty"` Extensions []string `yaml:"extensions,omitempty"` }
DesktopConfig represents desktop environment preferences
type EnvironmentConfig ¶
type EnvironmentConfig struct { Languages []string `yaml:"languages"` Shell string `yaml:"shell"` Editor string `yaml:"editor"` }
EnvironmentConfig represents environment preferences
type GitConfiguration ¶
type GitConfiguration struct {
// contains filtered or unexported fields
}
GitConfiguration holds Git-specific configuration state
type InitConfig ¶
type InitConfig struct { Profile string `yaml:"profile"` Platform PlatformConfig `yaml:"platform"` Applications ApplicationsConfig `yaml:"applications"` Environment EnvironmentConfig `yaml:"environment"` System SystemConfig `yaml:"system"` Desktop DesktopConfig `yaml:"desktop,omitempty"` }
InitConfig represents the configuration created by init command
type InstallCompleteMsg ¶
type InstallCompleteMsg struct{}
type InstallProgressMsg ¶
InstallProgressMsg Installation process and progress tracking
type InstallQuitMsg ¶
type InstallQuitMsg struct{}
InstallQuitMsg signals that the setup should exit after installation
type InstallationState ¶
type InstallationState struct {
// contains filtered or unexported fields
}
InstallationState tracks the current installation progress and errors
type InstalledApp ¶
type InstalledApp struct { Name string Description string Category string Method string Status string }
InstalledApp represents an application that has been installed on the system
type ListCommandOptions ¶
type ListCommandOptions struct { Format string Category string Search string Method string Recommended bool Interactive bool Verbose bool }
ListCommandOptions holds all the configuration options for list commands
type PlatformConfig ¶
type PlatformConfig struct { OS string `yaml:"os"` Distribution string `yaml:"distribution,omitempty"` Version string `yaml:"version,omitempty"` Architecture string `yaml:"architecture"` Desktop string `yaml:"desktop_environment,omitempty"` }
PlatformConfig represents platform detection results
type PlatformPluginMapping ¶
type PlatformPluginMapping struct { OS string Distribution string DesktopEnv string RequiredPlugins []string }
PlatformPluginMapping defines the mapping between platform characteristics and required plugins
type PluginInstallCompleteMsg ¶
type PluginInstallCompleteMsg struct { Errors []error SuccessCount int TotalCount int SuccessfulPlugins []string }
PluginInstallCompleteMsg indicates plugin installation is complete
type PluginInstallMsg ¶
PluginInstallMsg represents a plugin installation progress update
type PluginState ¶
type PluginState struct {
// contains filtered or unexported fields
}
PluginState manages plugin installation state
type PluginStatus ¶
type PluginStatus struct { Name string Status string // "pending", "downloading", "verifying", "installing", "success", "error" Error string }
PluginStatus represents the status of a single plugin
type PluginStatusUpdateMsg ¶
type PluginStatusUpdateMsg struct { PluginName string Status string // "pending", "downloading", "verifying", "installing", "success", "error" Error string }
PluginStatusUpdateMsg represents a status update for an individual plugin
type PluginValidationResult ¶
type PluginValidationResult struct { PluginName string IsValid bool ChecksumValid bool SignatureValid bool Error error ValidationTime time.Duration }
PluginValidationResult represents the comprehensive result of validating a single plugin. It contains validation status, security verification results, timing metrics, and any errors encountered. This type is used to provide detailed feedback about plugin integrity and security compliance.
type PluginValidator ¶
type PluginValidator struct {
// contains filtered or unexported fields
}
PluginValidator provides enterprise-grade plugin validation with advanced security verification and performance optimizations. It supports parallel processing, early termination strategies, checksum verification, GPG signature validation, and configurable critical plugin handling.
Key features:
- Parallel processing with configurable worker pools
- Early termination on critical plugin failures
- Comprehensive security validation (checksums, signatures)
- Performance monitoring and timeout handling
- Configurable critical plugin classification
Validation timeout rationale: 30-second default provides adequate time for network operations (downloading signatures, key verification) while preventing indefinite hangs in CI/CD environments.
func NewPluginValidator ¶
func NewPluginValidator(pluginBootstrap *bootstrap.PluginBootstrap, config PluginValidatorConfig) *PluginValidator
NewPluginValidator creates a new enhanced plugin validator with the specified configuration. It implements intelligent defaults for production use while allowing full customization.
Default behaviors:
- Concurrency: Limited to min(NumCPU(), 4) for optimal resource utilization
- Timeout: 30 seconds per plugin (adequate for network operations)
- Critical plugins: Loaded from config hierarchy or defaults to essential system plugins
The validator automatically optimizes for the target environment, scaling concurrency based on available CPU cores while maintaining reasonable resource limits.
Critical plugin classification: Critical plugins are validated first with potential early termination to provide immediate feedback on essential system components.
func (*PluginValidator) ValidatePlugins ¶
func (v *PluginValidator) ValidatePlugins(ctx context.Context, requiredPlugins []string) *ValidationSummary
ValidatePlugins performs comprehensive plugin validation using a two-phase approach optimized for both security and performance in enterprise environments.
Validation algorithm:
Phase 1: Critical Plugin Validation (Sequential) - Validates essential system plugins first for immediate feedback - Supports early termination on critical failures (if FailOnCritical=true) - Reduces time-to-feedback for core system dependencies Phase 2: Parallel Validation (Concurrent) - Validates remaining plugins using configurable worker pools - Optimizes resource utilization while maintaining system stability - Provides comprehensive coverage with timeout protection
Security features:
- Checksum verification for plugin integrity
- GPG signature validation for authenticity (when configured)
- Registry trust validation
- Timeout-based protection against hanging operations
Performance optimizations:
- O(1) plugin lookup using hash sets
- Parallel processing with bounded concurrency
- Early termination strategies
- Pre-allocated result collections
Context cancellation is respected throughout the validation process, enabling graceful shutdown in CI/CD environments or user-initiated cancellations.
type PluginValidatorConfig ¶
type PluginValidatorConfig struct { VerifyChecksums bool VerifySignatures bool Concurrency int FailOnCritical bool CriticalPlugins []string VerificationTimeout time.Duration AllowInsecurePlugins bool }
PluginValidatorConfig provides comprehensive configuration options for plugin validation behavior. It controls security settings, performance parameters, and operational policies.
Configuration hierarchy (highest to lowest precedence):
- Explicit config values passed to NewPluginValidator
- Environment variables (DEVEX_CRITICAL_PLUGINS)
- Viper configuration files (plugin.critical)
- Sensible defaults
Security considerations:
- VerifyChecksums: Essential for integrity validation
- VerifySignatures: Provides authenticity verification (requires GPG infrastructure)
- FailOnCritical: Enables fail-fast behavior for production environments
type ProfileTemplate ¶
type ProfileTemplate struct { Name string Description string Categories []string Languages []string Tools []string }
ProfileTemplate represents a pre-configured profile
type RemoveAppItem ¶
type RemoveAppItem struct {
// contains filtered or unexported fields
}
RemoveAppItem represents an application item for removal
func (RemoveAppItem) Description ¶
func (i RemoveAppItem) Description() string
func (RemoveAppItem) FilterValue ¶
func (i RemoveAppItem) FilterValue() string
func (RemoveAppItem) Title ¶
func (i RemoveAppItem) Title() string
type RemoveItemDelegate ¶
type RemoveItemDelegate struct{}
RemoveItemDelegate renders list items for removal
func (RemoveItemDelegate) Height ¶
func (d RemoveItemDelegate) Height() int
func (RemoveItemDelegate) Spacing ¶
func (d RemoveItemDelegate) Spacing() int
type RemoveModel ¶
type RemoveModel struct {
// contains filtered or unexported fields
}
RemoveModel represents the TUI state for the remove command
func NewRemoveModel ¶
func NewRemoveModel(settings config.CrossPlatformSettings) *RemoveModel
NewRemoveModel creates a new remove command TUI model
func (RemoveModel) Init ¶
func (m RemoveModel) Init() tea.Cmd
func (RemoveModel) View ¶
func (m RemoveModel) View() string
type SetupModel ¶
type SetupModel struct {
// contains filtered or unexported fields
}
SetupModel represents the state of our guided setup UI This model is organized into focused sub-structures for better maintainability
func (*SetupModel) Init ¶
func (m *SetupModel) Init() tea.Cmd
Init satisfies the tea.Model interface
type SystemConfig ¶
type SystemConfig struct { GitConfig bool `yaml:"configure_git"` SSHConfig bool `yaml:"configure_ssh"` GlobalTheme string `yaml:"global_theme,omitempty"` }
SystemConfig represents system preferences
type SystemInfo ¶
type SystemInfo struct {
// contains filtered or unexported fields
}
SystemInfo contains detected system information and available options
type TableConfig ¶
type TableConfig struct { NameWidth int DescriptionWidth int CategoryWidth int MethodWidth int StatusWidth int }
TableConfig contains configuration for table rendering with dynamic width calculation
func NewAvailableAppTableConfig ¶
func NewAvailableAppTableConfig(apps []AvailableApp) *TableConfig
NewAvailableAppTableConfig creates optimal table configuration for available apps
func NewInstalledAppTableConfig ¶
func NewInstalledAppTableConfig(apps []InstalledApp) *TableConfig
NewInstalledAppTableConfig creates optimal table configuration for installed apps
type TemplateSelectionModel ¶
type TemplateSelectionModel struct {
// contains filtered or unexported fields
}
TemplateSelectionModel represents the TUI state for template selection
func NewTemplateSelectionModel ¶
func NewTemplateSelectionModel(templatesManager *templates.TemplateManager) (*TemplateSelectionModel, error)
NewTemplateSelectionModel creates a new template selection model
func (TemplateSelectionModel) Init ¶
func (m TemplateSelectionModel) Init() tea.Cmd
func (TemplateSelectionModel) View ¶
func (m TemplateSelectionModel) View() string
type UISelections ¶
type UISelections struct {
// contains filtered or unexported fields
}
UISelections groups all user selection states for the setup interface
type UninstallConflict ¶
type UninstallConflict struct { Type ConflictType `json:"type"` AppName string `json:"app_name"` ConflictApp string `json:"conflict_app,omitempty"` Description string `json:"description"` Severity string `json:"severity"` // "critical", "warning", "info" Resolution string `json:"resolution"` }
UninstallConflict represents a conflict that prevents uninstallation
type UninstallHistoryEntry ¶
type UninstallHistoryEntry struct { ID int `json:"id"` AppName string `json:"app_name"` AppVersion string `json:"app_version"` InstallMethod string `json:"install_method"` UninstallDate time.Time `json:"uninstall_date"` BackupLocation string `json:"backup_location"` CanRestore bool `json:"can_restore"` UninstallMethod string `json:"uninstall_method"` UninstallFlags string `json:"uninstall_flags"` DependenciesRemoved string `json:"dependencies_removed"` ConfigFilesRemoved string `json:"config_files_removed"` DataFilesRemoved string `json:"data_files_removed"` ServicesStopped string `json:"services_stopped"` PackageInfo string `json:"package_info"` RollbackScript string `json:"rollback_script"` Notes string `json:"notes"` }
UninstallHistoryEntry represents an entry in the uninstall history
type UninstallOptions ¶
type UninstallOptions struct { Force bool KeepConfig bool KeepData bool RemoveOrphans bool Cascade bool Backup bool StopServices bool CleanupSystem bool }
UninstallOptions represents the options for uninstall operation
type ValidationSummary ¶
type ValidationSummary struct { TotalPlugins int ValidPlugins int InvalidPlugins int CriticalFailures int Errors []error ValidationTime time.Duration Results []PluginValidationResult }
ValidationSummary provides an aggregated view of plugin validation results across multiple plugins. It includes overall statistics, performance metrics, and collected errors for comprehensive reporting. This summary is essential for understanding the health and security posture of the entire plugin ecosystem.
Source Files
¶
- add.go
- backup_manager.go
- cache_cmd.go
- completion.go
- config.go
- conflict_detector.go
- dependency_manager.go
- detect.go
- docker_apps.go
- help_cmd.go
- init.go
- init_templates.go
- install.go
- list.go
- list_filters.go
- list_formatters.go
- list_models.go
- platform_config.go
- plugin_validator.go
- recovery_cmd.go
- registry.go
- remove.go
- rollback.go
- root.go
- setup.go
- setup_constants.go
- shell.go
- shell_config.go
- status.go
- system.go
- template_cmd.go
- template_custom_cmd.go
- theme_manager.go
- undo_cmd.go
- uninstall.go
- validation.go