Skip to content
Snippets Groups Projects
nucleus-core.go 660 B
Newer Older
  • Learn to ignore specific revisions
  • package nucleus
    
    import (
    
    	"code.fbi.h-da.de/cocsn/gosdn/database"
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    	log "github.com/sirupsen/logrus"
    
    //StartAndRun is used to start the core of the controller and any auxiliary services.
    
    func StartAndRun(IsRunningChannel chan bool) {
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    	log.Info("This is the network superintendent...")
    	log.Info("Starting my ducks")
    
    	// Initialize the Core
    
    	core := Core{
    		database: database.Database{},
    	}
    
    	core.Initialize(IsRunningChannel)
    
    	// Start the GRCP CLI
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    	go getCLIGoing(&core)
    
    	log.Info("and ready for take off")
    
    	//Just to produce some signs of vitality...
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    		time.Sleep(10 * time.Second)
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    		log.Debug("Still alive...")