-
-
Notifications
You must be signed in to change notification settings - Fork 274
/
core.go
65 lines (51 loc) · 1.15 KB
/
core.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package core
import (
"fmt"
"github.com/safing/portbase/modules"
"github.com/safing/portbase/modules/subsystems"
// module dependencies
_ "github.com/safing/portmaster/netenv"
_ "github.com/safing/portmaster/status"
_ "github.com/safing/portmaster/ui"
_ "github.com/safing/portmaster/updates"
)
var (
module *modules.Module
)
func init() {
module = modules.Register("core", prep, start, nil, "base", "subsystems", "status", "updates", "api", "notifications", "ui", "netenv", "network", "interception")
subsystems.Register(
"core",
"Core",
"Base Structure and System Integration",
module,
"config:core/",
nil,
)
}
func prep() error {
registerEvents()
// init config
logFlagOverrides()
err := registerConfig()
if err != nil {
return err
}
return nil
}
func start() error {
if err := startPlatformSpecific(); err != nil {
return fmt.Errorf("failed to start plattform-specific components: %s", err)
}
if err := registerEventHooks(); err != nil {
return err
}
if err := registerControlDatabase(); err != nil {
return err
}
if err := registerAPIEndpoints(); err != nil {
return err
}
registerLogCleaner()
return nil
}