func main() { var err error var aDBHandler *daqDB.DatabaseHandler var bDBHandler *beDB.DatabaseHandler aConf := ReadDbConfig(BE_CONF_FILE) bConf := ReadDbConfig(DAQ_CONF_FILE) daqConf := ReadDaqConfig(DAQ_CONF_FILE) if !daqConf.MockerOn { if aDBHandler, err = daqDB.NewDatabaseHandler(bConf); err != nil { log.Fatal("[database][error] : Could not create database handler for aware db: %s", err) } } if bDBHandler, err = beDB.NewDatabaseHandler(aConf); err != nil { log.Fatal("[database][error] : Could not create database handler for backend db: %s", err) } daq, err := NewDaq(aDBHandler, bDBHandler, daqConf) if err != nil { log.Fatal("%s", err) } daq.Start() }
func startSystem() { var err error var dbHandler *database.DatabaseHandler var aHandler *ApiHandler aConf := ReadApiConfig(BE_CONF_FILE) if dbHandler, err = database.NewDatabaseHandler(dbConf); err != nil { log.Fatal("[database][error] : Could not create database handler: %s", err) } if aHandler, err = NewApiHandler(aConf, dbHandler); err != nil { log.Fatal("[api][error] : Could not create api handler: %s", err) } aHandler.Start() }