forked from free5gc/amf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamf.go
46 lines (36 loc) · 844 Bytes
/
amf.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
package main
import (
"fmt"
"os"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/free5gc/amf/logger"
"github.com/free5gc/amf/service"
"github.com/free5gc/version"
)
var AMF = &service.AMF{}
var appLog *logrus.Entry
func init() {
appLog = logger.AppLog
}
func main() {
app := cli.NewApp()
app.Name = "amf"
appLog.Infoln(app.Name)
appLog.Infoln("AMF version: ", version.GetVersion())
app.Usage = "-free5gccfg common configuration file -amfcfg amf configuration file"
app.Action = action
app.Flags = AMF.GetCliCmd()
if err := app.Run(os.Args); err != nil {
appLog.Errorf("AMF Run error: %v", err)
return
}
}
func action(c *cli.Context) error {
if err := AMF.Initialize(c); err != nil {
logger.CfgLog.Errorf("%+v", err)
return fmt.Errorf("Failed to initialize !!")
}
AMF.Start()
return nil
}