-
Notifications
You must be signed in to change notification settings - Fork 16
/
pcf.go
53 lines (43 loc) · 1.11 KB
/
pcf.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
// Copyright 2019 free5GC.org
//
// SPDX-License-Identifier: Apache-2.0
//
/*
* Npcf_BDTPolicyControl Service API
*
* The Npcf_BDTPolicyControl Service is used by an NF service consumer to
* retrieve background data transfer policies from the PCF and to update the PCF with
* the background data transfer policy selected by the NF service consumer.
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package main
import (
"fmt"
"os"
"github.com/omec-project/pcf/logger"
"github.com/omec-project/pcf/service"
"github.com/urfave/cli"
)
var PCF = &service.PCF{}
func main() {
app := cli.NewApp()
app.Name = "pcf"
logger.AppLog.Infoln(app.Name)
app.Usage = "Policy Control Function"
app.UsageText = "pcf -cfg <pcf_config_file.conf>"
app.Action = action
app.Flags = PCF.GetCliCmd()
if err := app.Run(os.Args); err != nil {
logger.AppLog.Fatalf("PCF run error: %v", err)
}
}
func action(c *cli.Context) error {
if err := PCF.Initialize(c); err != nil {
logger.CfgLog.Errorf("%+v", err)
return fmt.Errorf("failed to initialize")
}
PCF.Start()
return nil
}