-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcore.go
42 lines (35 loc) · 899 Bytes
/
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
package core
import (
"github.com/u-speak/core/api"
"github.com/u-speak/core/config"
"github.com/u-speak/core/diag"
"github.com/u-speak/core/minui"
"github.com/u-speak/core/node"
"github.com/u-speak/core/webserver"
log "github.com/sirupsen/logrus"
)
// Config keeps the global configuration
var Config = config.Configuration{}
// RunAPI starts the API server connected to the specific node
func RunAPI(n *node.Node) {
err := api.New(Config, n).Run()
if err != nil {
log.Error(err)
}
}
// RunDiag starts the diagnostics web interface
func RunDiag(n *node.Node) {
err := diag.Run(Config, n)
if err != nil {
log.Error(err)
}
}
// RunWeb starts a static webserver for the portal
func RunWeb() {
webserver.New(Config).Run()
}
// RunMinUI starts the read-only minimal user interface for use on lower end devices
func RunMinUI(n *node.Node) {
s := minui.New(Config, n)
s.Run()
}