Example #1
0
func main() {

	var port = flag.Int("port", -1, "Port to listen on")
	var unsecureMode = flag.Bool("unsecure", false, "Boot in unsecure mode")
	flag.Parse()
	if *port == -1 {
		fmt.Println("Must specify a -port argument")
		return
	}

	var coreConfig *roll.CoreConfig

	if *unsecureMode == true {
		fmt.Println(unsecureBanner)
		if dbutil.UseMariaDB() {
			log.Info("Using maria db")
			coreConfig = rollsvcs.MariaDBUnsecureConfig()
		} else {
			log.Info("Using dynamo db")
			coreConfig = rollsvcs.DefaultUnsecureConfig()
		}
	} else {
		if dbutil.UseMariaDB() {
			log.Info("Using maria db")
			coreConfig = rollsvcs.MariaDBSecureConfig()
		} else {
			log.Info("Using dynamo db")
			coreConfig = rollsvcs.DefaultConfig()
		}
	}

	rollsvcs.RunRoll(*port, coreConfig)
}
Example #2
0
func createUnsecureMariaDBConfig() *roll.CoreConfig {
	log.Info(unsecureBanner)
	return rollsvcs.MariaDBUnsecureConfig()
}