-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
47 lines (34 loc) · 1.18 KB
/
main.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
package main
import (
"embed"
"flag"
"os"
"time"
"github.com/francistor/igor/core"
"github.com/francistor/igor/handler"
"github.com/francistor/igor/router"
)
func main() {
// defer profile.Start(profile.BlockProfile).Stop()
// Get the command line arguments
bootPtr := flag.String("boot", "resources/searchRules.json", "File or http URL with Configuration Search Rules")
instancePtr := flag.String("instance", "", "Name of instance")
logLocationPtr := flag.String("log", "", "location of log files")
flag.Parse()
// Set environment variable with
if *logLocationPtr != "" {
os.Setenv("IGOR_LOG_OUTPUTS", *logLocationPtr)
}
// Initialize the Config Object
core.InitPolicyConfigInstance(*bootPtr, *instancePtr, nil, embed.FS{}, true)
// Get logger
logger := core.GetLogger()
// Start Diameter
_ = router.NewDiameterRouter(*instancePtr, handler.EmptyDiameterHandler).Start()
logger.Info("diameter router started")
// Start Radius
_ = router.NewRadiusRouter(*instancePtr, handler.TestRadiusAttributesHandler).Start()
//_ = router.NewRadiusRouter(*instancePtr, handler.EmptyRadiusHandler).Start()
logger.Info("radius router started")
time.Sleep(1000 * time.Minute)
}