Example #1
0
func main() {

	var port int

	flag.IntVar(&port, "Port", 8080, "Port the server listens to")

	flag.Parse()

	server.Run(uint16(port))

}
Example #2
0
func main() {
	var conf config.Config
	err := conf.ParseDir("config")
	if err != nil {
		log.Fatal(err)
	}
	var dataStore datastore.DataStore
	dataStore.Init()
	go server.Run(&conf, &dataStore)

	select {}
}
Example #3
0
func main() {
	var port int
	var disableAuth bool

	flag.IntVar(&port, "port", 8081, "Port the server listens to")
	flag.BoolVar(&disableAuth, "disableAuth", false, "Disables authentication requirements")

	flag.Parse()

	db.Open()
	defer db.Db.Close()
	server.Run(port, disableAuth)
}
Example #4
0
func main() {
	app := cli.NewApp()
	app.Name = "Skizze"
	app.Usage = "A sketch data store for counting and sketching using probabilistic data-structures"
	app.Version = version

	app.Flags = []cli.Flag{
		cli.StringFlag{
			Name:        "datadir, d",
			Value:       config.DataDir,
			Usage:       "the data directory",
			Destination: &datadir,
			EnvVar:      "SKIZZE_DATA_DIR",
		},
		cli.StringFlag{
			Name:        "host",
			Value:       config.Host,
			Usage:       "the host interface to bind to",
			Destination: &host,
			EnvVar:      "SKIZZE_HOST",
		},
		cli.IntFlag{
			Name:        "port, p",
			Value:       config.Port,
			Usage:       "the port to bind to",
			Destination: &port,
			EnvVar:      "SKIZZE_PORT",
		},
	}

	app.Action = func(*cli.Context) {
		datadir = setupDirectories(datadir)

		logger.Infof("Starting Skizze...")
		logger.Infof("Listening on: %s:%d", host, port)
		logger.Infof("Using data dir: %s", datadir)

		mngr := manager.NewManager()
		server.Run(mngr, host, port, datadir)
	}

	if err := app.Run(os.Args); err != nil {
		logger.Criticalf(err.Error())
	}
}
Example #5
0
File: main.go Project: silky/skizze
func main() {
	var port uint
	flag.UintVar(&port, "p", 3596, "specifies the port for Skizze to run on")
	flag.Parse()

	//TODO: Add arguments for dataDir and infoDir

	err := os.Setenv("SKIZZE_PORT", strconv.Itoa(int(port)))
	utils.PanicOnError(err)

	logger.Infof("Starting Skizze...")
	logger.Infof("Using data dir: %s", config.GetConfig().DataDir)
	//server, err := server.New()
	//utils.PanicOnError(err)
	//server.Run()
	mngr := manager.NewManager()
	if p, err := strconv.Atoi(os.Getenv("SKIZZE_PORT")); err == nil {
		server.Run(mngr, uint(p))
	}
}
func main() {
	go server.Run()
	go locator.Run()
	webui.Start()
}