-
Notifications
You must be signed in to change notification settings - Fork 0
/
nwdaf.go
executable file
·52 lines (38 loc) · 991 Bytes
/
nwdaf.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
package main
import (
"fmt"
"os"
"github.com/wsilvad/nwdaf/logger"
nwdaf_service "github.com/wsilvad/nwdaf/service"
"github.com/wsilvad/nwdaf/version"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
var NWDAF = &nwdaf_service.NWDAF{}
var appLog *logrus.Entry
func init() {
appLog = logger.AppLog
}
func main() {
app := cli.NewApp()
app.Name = "nwdaf"
fmt.Print(app.Name, "\n")
appLog.Infoln("NWDAF version: ", version.GetVersion())
app.Usage = "-free5gccfg common configuration file -nwdafcfg nwdaf configuration file"
app.Action = action
app.Flags = NWDAF.GetCliCmd()
if err := app.Run(os.Args); err != nil {
logger.AppLog.Warnf("Error args: %v", err)
}
}
func action(c *cli.Context) error {
//app.AppInitializeWillInitialize(c.String("free5gccfg"))
//NWDAF.Initialize(c)
//NWDAF.Start()
if err := NWDAF.Initialize(c); err != nil {
logger.CfgLog.Errorf("%+v", err)
return fmt.Errorf("Failed to initialize !!")
}
NWDAF.Start()
return nil
}