forked from free5gc/nrf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nrf.go
47 lines (37 loc) · 883 Bytes
/
nrf.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
/*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package main
import (
"fmt"
"free5gc/src/app"
"free5gc/src/nrf/logger"
nrf_service "free5gc/src/nrf/service"
"free5gc/src/nrf/version"
"os"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
var NRF = &nrf_service.NRF{}
var appLog *logrus.Entry
func init() {
appLog = logger.AppLog
}
func main() {
app := cli.NewApp()
app.Name = "nrf"
fmt.Print(app.Name, "\n")
appLog.Infoln("NRF version: ", version.GetVersion())
app.Usage = "-free5gccfg common configuration file -nrfcfg nrf configuration file"
app.Action = action
app.Flags = NRF.GetCliCmd()
if err := app.Run(os.Args); err != nil {
fmt.Printf("Run(os.Args error: %v", err)
}
}
func action(c *cli.Context) {
app.AppInitializeWillInitialize(c.String("free5gccfg"))
NRF.Initialize(c)
NRF.Start()
}