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) }
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") }
func (s *DatabaseModelDeploymentSuite) SetUpSuite(c *C) { configuration.LoadSettingsFromFile() viper.Set("BoltdbName", "/tmp/datontest.db") }
func (s *BoltDbSuite) SetUpSuite(c *C) { configuration.LoadSettingsFromFile() viper.Set("BoltdbName", "/tmp/datontest.db") }