func main() { var configFileRepository config.Repository configFileRepository = infrastructure.NewConfigFileRepository( strings.Join([]string{os.Getenv("GOPATH"), "/src/github.com/cleitonmarx/gowebapp/gowebapp.json"}, ""), ) currentConfig := getCurrentConfig(configFileRepository) appServer := server.New(currentConfig) appServer.Init() appServer.Run() }
func getCurrentConfig() (config.EnvironmentConfig, error) { result := config.EnvironmentConfig{} confRepo := infrastructure.NewConfigFileRepository("../gowebapp.json") systemConfig, err := confRepo.GetSystemConfiguration() if err != nil { return result, err } currentConfig, err := systemConfig.GetCurrentEnvironmentConfig() if err != nil { return result, err } return currentConfig, nil }