Exemplo n.º 1
0
func newManager() *ManagerStruct {
	conf = config.GetConfig()
	dataPath = conf.GetDataDir()
	//FIXME: size of cache should be read from config
	cache, err := lru.NewWithEvict(250, onFileEvicted)
	utils.PanicOnError(err)
	return &ManagerStruct{cache}
}
Exemplo n.º 2
0
func main() {
	var port uint
	flag.UintVar(&port, "p", 7596, "specifies the port for Counts to run on")
	flag.Parse()

	//TODO: Add arguments for dataDir and infoDir

	os.Setenv("COUNTS_PORT", strconv.Itoa(int(port)))

	logger.Info.Println("Starting counts...")
	conf := config.GetConfig()
	logger.Info.Println("Using data dir: ", conf.GetDataDir())
	server := server.New()
	server.Run()
}
Exemplo n.º 3
0
/*
Run ...
*/
func (srv *Server) Run() {
	conf := config.GetConfig()
	port := conf.GetPort()
	logger.Info.Println("Server up and running on port: " + strconv.Itoa(port))
	http.ListenAndServe(":"+strconv.Itoa(port), srv)
}