Embedded configuration

This commit is contained in:
emile 2015-09-07 23:25:07 +02:00
parent 4558270c42
commit 7fcc4761da
3 changed files with 38 additions and 16 deletions

View file

@ -31,15 +31,6 @@ var serviceChan = make(chan *Service)
var providers = []Provider{}
func main() {
configuration := LoadFileConfig()
if(configuration.Docker != nil){
providers = append(providers, configuration.Docker)
}
if(configuration.File != nil){
providers = append(providers, configuration.File)
}
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
@ -65,6 +56,16 @@ func main() {
}
}()
configuration := LoadFileConfig()
log.Println("Configuration loaded", configuration)
if(configuration.Docker != nil){
providers = append(providers, configuration.Docker)
}
if(configuration.File != nil){
providers = append(providers, configuration.File)
}
go func() {
for _, provider := range providers {
provider.Provide(serviceChan)