GetOSInterface helps in returning OS specific object which implements OSTypeInstaller interface.
()
| 126 | |
| 127 | // GetOSInterface helps in returning OS specific object which implements OSTypeInstaller interface. |
| 128 | func GetOSInterface() types.OSTypeInstaller { |
| 129 | switch GetPackageManager() { |
| 130 | case APT: |
| 131 | return &DebOS{} |
| 132 | case YUM: |
| 133 | return &RpmOS{} |
| 134 | case PACMAN: |
| 135 | return &PacmanOS{} |
| 136 | default: |
| 137 | fmt.Println("Failed to detect supported package manager command(apt, yum, pacman), exit") |
| 138 | panic("Failed to detect supported package manager command(apt, yum, pacman), exit") |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // RunningModule identifies cloudcore/edgecore running or not. |
| 143 | func RunningModule() (types.ModuleRunning, error) { |