-
Notifications
You must be signed in to change notification settings - Fork 4
/
ollamanager.go
37 lines (33 loc) · 962 Bytes
/
ollamanager.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"github.com/gaurav-gosain/ollamanager/manager"
"github.com/gaurav-gosain/ollamanager/tabs"
ollamanagerUtils "github.com/gaurav-gosain/ollamanager/utils"
)
// Branches to the ollamanager process and exits
// Add tabs (and actions) based on the flags
func (cfg *gollamaConfig) ollamanager() {
var selectedTabs []tabs.Tab
var approvedActions []tabs.ManageAction
if cfg.Install {
selectedTabs = append(selectedTabs, tabs.INSTALL)
}
if cfg.Manage {
selectedTabs = append(selectedTabs, tabs.MANAGE)
// Approved actions for the Manage tab
approvedActions = []tabs.ManageAction{
tabs.UPDATE,
tabs.DELETE,
}
}
if cfg.Monitor {
selectedTabs = append(selectedTabs, tabs.MONITOR)
}
// Runs ollamanager with the selected tabs and approved actions
result, err := manager.Run(selectedTabs, approvedActions)
// Pretty prints the result and error (if any)
err = ollamanagerUtils.PrintActionResult(
result,
err,
)
}