Files
Redflag/aggregator-agent/internal/installer/installer.go
Fimeg 2ade509b63 Update README with current features and screenshots
- Cross-platform support (Windows/Linux) with Windows Updates and Winget
- Added dependency confirmation workflow and refresh token authentication
- New screenshots: History, Live Operations, Windows Agent Details
- Local CLI features with terminal output and cache system
- Updated known limitations - Proxmox integration is broken
- Organized docs to docs/ folder and updated .gitignore
- Probably introduced a dozen bugs with Windows agents - stay tuned
2025-10-17 15:28:22 -04:00

31 lines
910 B
Go

package installer
import "fmt"
// Installer interface for different package types
type Installer interface {
IsAvailable() bool
Install(packageName string) (*InstallResult, error)
InstallMultiple(packageNames []string) (*InstallResult, error)
Upgrade() (*InstallResult, error)
GetPackageType() string
DryRun(packageName string) (*InstallResult, error) // New: Perform dry run to check dependencies
}
// InstallerFactory creates appropriate installer based on package type
func InstallerFactory(packageType string) (Installer, error) {
switch packageType {
case "apt":
return NewAPTInstaller(), nil
case "dnf":
return NewDNFInstaller(), nil
case "docker_image":
return NewDockerInstaller()
case "windows_update":
return NewWindowsUpdateInstaller(), nil
case "winget":
return NewWingetInstaller(), nil
default:
return nil, fmt.Errorf("unsupported package type: %s", packageType)
}
}