-
Notifications
You must be signed in to change notification settings - Fork 0
/
ue.go
40 lines (33 loc) · 964 Bytes
/
ue.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
package main
import (
"github.com/matanbroner/UESimulator/src/ue/logger"
"github.com/matanbroner/UESimulator/src/ue/ue_service"
"github.com/matanbroner/UESimulator/src/ue/version"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"os"
)
var UE = &ue_service.UE{}
var appLog *logrus.Entry
func init() {
appLog = logger.AppLog
}
func main() {
cliApp := cli.NewApp()
cliApp.Name = "ue"
cliApp.Usage = "Usage: --uecfg config yaml file"
cliApp.Action = action
cliApp.Flags = UE.GetCliCmd()
appLog.Infoln(cliApp.Name)
appLog.Infoln("UE version: ", version.GetVersion())
if err := cliApp.Run(os.Args); err != nil {
logger.AppLog.Errorf("UE Run error: %v", err)
}
}
func action(c *cli.Context) {
// TODO: this just initializes loggers based on a Free5GC config file which ships with my5GCore
// We can probably just add our own loggers down the line
// app.AppInitializeWillInitialize(c.String("free5gccfg"))
UE.Initialize(c)
UE.Start()
}