Example #1
0
File: main.go Project: 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)
}
Example #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")
}
Example #3
0
func (s *DatabaseModelDeploymentSuite) SetUpSuite(c *C) {
	configuration.LoadSettingsFromFile()
	viper.Set("BoltdbName", "/tmp/datontest.db")
}
Example #4
0
func (s *BoltDbSuite) SetUpSuite(c *C) {
	configuration.LoadSettingsFromFile()
	viper.Set("BoltdbName", "/tmp/datontest.db")
}