Exemplo n.º 1
0
func main() {
	// Load default config
	config.LoadDefaults()
	//Parse the command line parameters
	config.ParseCmdParams(config.DefaultCmdLine{
		HostName:         "localhost",
		NodeId:           "fe1",
		Port:             "8081",
		UseSSL:           false,
		RegistryLocation: "http://localhost:2379",
	})
	// Fetch Configuration from etcd
	config.InitEtcd()
	config.FetchCommonConfig()
	config.FetchServiceSection(config.FrontendService)
	config.FetchServiceSection(config.AuthService)
	// Load plugin ini
	fserv.LoadPluginData(config.Frontend.PluginDir + "/plugins.ini")
	database.InitDb()
	// Set up the core logger
	log.SetOutput(&lumberjack.Logger{
		Filename:   config.Logger.LogFile,
		MaxSize:    config.Logger.MaxSize,
		MaxBackups: config.Logger.MaxBackups,
		MaxAge:     config.Logger.MaxAge,
	})
	registry.Init("Frontend", registry.FrontEndLocation)
	routing.Start()
}
Exemplo n.º 2
0
func main() {
	// Get Command line arguments
	configFile := flag.String("config", "config.ini", "config file to load")
	flag.Parse()
	// Load configuration
	config.LoadConfig(*configFile)
	fserv.LoadPluginData(config.Frontend.PluginDir + "/plugins.ini")
	services.InitDb()
	// Set up the core logger
	log.SetOutput(&lumberjack.Logger{
		Filename:   config.Logger.LogFile,
		MaxSize:    config.Logger.MaxSize,
		MaxBackups: config.Logger.MaxBackups,
		MaxAge:     config.Logger.MaxAge,
	})
	registry.Init("Frontend", registry.FrontEndLocation)
	routing.Start()
}
Exemplo n.º 3
0
func TestFinishIndex(t *testing.T) {
	webAppDir = "../web_app/app"
	fserv.LoadPluginData("../plugins/plugins.ini.example")
	finishIndex("../index.html.template")
	t.Logf("index html: %v", indexHtml)
}
Exemplo n.º 4
0
func TestFinishIndex(t *testing.T) {
	webAppDir = "../web_app/app"
	fserv.LoadPluginData("../plugins/plugins.ini")
	finishIndex()
	t.Logf("index html: %v", indexHtml)
}