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