forked from omec-project/udr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathudr.go
48 lines (37 loc) · 853 Bytes
/
udr.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
// Copyright 2019 free5GC.org
//
// SPDX-License-Identifier: Apache-2.0
//
package main
import (
"fmt"
"os"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/omec-project/udr/logger"
udr_service "github.com/omec-project/udr/service"
)
var UDR = &udr_service.UDR{}
var appLog *logrus.Entry
func init() {
appLog = logger.AppLog
}
func main() {
app := cli.NewApp()
app.Name = "udr"
appLog.Infoln(app.Name)
app.Usage = "-free5gccfg common configuration file -udrcfg udr configuration file"
app.Action = action
app.Flags = UDR.GetCliCmd()
if err := app.Run(os.Args); err != nil {
appLog.Errorf("UDR Run error: %v", err)
}
}
func action(c *cli.Context) error {
if err := UDR.Initialize(c); err != nil {
logger.CfgLog.Errorf("%+v", err)
return fmt.Errorf("Failed to initialize !!")
}
UDR.Start()
return nil
}