forked from omec-project/smf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smf.go
59 lines (46 loc) · 1.09 KB
/
smf.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
53
54
55
56
57
58
59
// SPDX-FileCopyrightText: 2021 Open Networking Foundation <[email protected]>
// Copyright 2019 free5GC.org
//
// SPDX-License-Identifier: Apache-2.0
/*
* Nsmf_PDUSession
*
* SMF PDU Session Service
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package main
import (
"fmt"
"os"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/omec-project/smf/logger"
"github.com/omec-project/smf/service"
)
var SMF = &service.SMF{}
var appLog *logrus.Entry
func init() {
appLog = logger.AppLog
}
func main() {
app := cli.NewApp()
app.Name = "smf"
fmt.Print(app.Name, "\n")
//appLog.Infoln("SMF version: ", version.GetVersion())
app.Usage = "-cfg common configuration file -smfcfg smf_configuration_file"
app.Action = action
app.Flags = SMF.GetCliCmd()
if err := app.Run(os.Args); err != nil {
appLog.Errorf("SMF Run error: %v", err)
}
}
func action(c *cli.Context) error {
if err := SMF.Initialize(c); err != nil {
logger.CfgLog.Errorf("%+v", err)
return fmt.Errorf("Failed to initialize !!")
}
SMF.Start()
return nil
}