Exemplo n.º 1
0
Arquivo: main.go Projeto: slok/daton
func main() {
	//	go func() {
	//		log.Println(http.ListenAndServe("0.0.0.0:6060", nil))
	//	}()

	log.Info("Starting Daton...")

	// Load configuration
	configuration.LoadSettingsFromFile()

	// Init database
	db, err := data.GetBoltDb()
	defer db.Disconnect()
	if err != nil {
		log.Panic("Couldn't connect to bolt database")
	}

	// Bind routing with handlers
	router := api.BindApiRoutes(nil)

	// serve
	n := negroni.Classic()
	n.UseHandler(router)

	listenAddress := fmt.Sprintf(":%d", viper.GetInt("Port"))
	n.Run(listenAddress)
}
Exemplo n.º 2
0
func (s *DeploymentsApiRoutesTestSuite) SetUpSuite(c *C) {
	s.apiPrefix = fmt.Sprintf("/api/v%d", configuration.ApiVersion)
	s.namespace = "slok/daton"

	// Set configuration
	configuration.LoadSettingsFromFile()
	viper.Set("BoltdbName", "/tmp/datontest.db")
}
Exemplo n.º 3
0
func (s *DatabaseModelDeploymentSuite) SetUpSuite(c *C) {
	configuration.LoadSettingsFromFile()
	viper.Set("BoltdbName", "/tmp/datontest.db")
}
Exemplo n.º 4
0
func (s *BoltDbSuite) SetUpSuite(c *C) {
	configuration.LoadSettingsFromFile()
	viper.Set("BoltdbName", "/tmp/datontest.db")
}