-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapt.go
30 lines (24 loc) · 811 Bytes
/
apt.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
package main
import (
"net/http"
apt "imuslab.com/arozos/mod/apt"
prout "imuslab.com/arozos/mod/prouter"
"imuslab.com/arozos/mod/utils"
)
func PackagManagerInit() {
//Create a package manager
packageManager = apt.NewPackageManager(*allow_package_autoInstall)
systemWideLogger.PrintAndLog("APT", "Package Manager Initiated", nil)
//Create a System Setting handler
//aka who can access System Setting can see contents about packages
router := prout.NewModuleRouter(prout.RouterOption{
ModuleName: "System Setting",
AdminOnly: false,
UserHandler: userHandler,
DeniedHandler: func(w http.ResponseWriter, r *http.Request) {
utils.SendErrorResponse(w, "Permission Denied")
},
})
//Handle package listing request
router.HandleFunc("/system/apt/list", apt.HandlePackageListRequest)
}