mirror of
https://github.com/mariocandela/beelzebub.git
synced 2025-07-01 18:47:26 -04:00
refactoring: Tiny refactoring (#47)
* tiny refactoring name convention, and file name. * added command line arguments files * fix typo comment
This commit is contained in:
22
main.go
22
main.go
@ -3,14 +3,23 @@ package main
|
||||
import (
|
||||
"beelzebub/builder"
|
||||
"beelzebub/parser"
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var quit = make(chan struct{})
|
||||
|
||||
func main() {
|
||||
parser := parser.Init("./configurations/beelzebub.yaml", "./configurations/services/")
|
||||
var configurationsCorePath string
|
||||
var configurationsServicesDirectory string
|
||||
|
||||
flag.StringVar(&configurationsCorePath, "confCore", "./configurations/beelzebub.yaml", "Provide the path of configurations core")
|
||||
flag.StringVar(&configurationsServicesDirectory, "confServices", "./configurations/services/", "Directory config services")
|
||||
flag.Parse()
|
||||
|
||||
parser := parser.Init(configurationsCorePath, configurationsServicesDirectory)
|
||||
|
||||
coreConfigurations, err := parser.ReadConfigurationsCore()
|
||||
failOnError(err, fmt.Sprintf("Error during ReadConfigurationsCore: "))
|
||||
@ -23,14 +32,11 @@ func main() {
|
||||
director := builder.NewDirector(beelzebubBuilder)
|
||||
|
||||
beelzebubBuilder, err = director.BuildBeelzebub(coreConfigurations, beelzebubServicesConfiguration)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
failOnError(err, fmt.Sprintf("Error during BuildBeelzebub: "))
|
||||
|
||||
err = beelzebubBuilder.Run()
|
||||
failOnError(err, fmt.Sprintf("Error during run beelzebub core: "))
|
||||
|
||||
if err := beelzebubBuilder.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
return
|
||||
}
|
||||
defer beelzebubBuilder.Close()
|
||||
|
||||
<-quit
|
||||
|
Reference in New Issue
Block a user