func main() { runtime.GOMAXPROCS(runtime.NumCPU()) args := arguments.ParseArgs() port := args["port"] if resourcesFolder, exist := args["webFolder"]; exist { webFolder = resourcesFolder } createServer(port) }
func main() { runtime.GOMAXPROCS(runtime.NumCPU()) args := arguments.ParseArgs() port := args["port"] if logFolder, ok := args["log"]; ok { logger.InitLogger(filepath.Join(logFolder, "music_"+port+".log"), true) } ms := MusicServer{} ms.create(port, args["folder"], args["musicFolder"], args["addressMask"], args["webfolder"]) }
func main() { args := arguments.ParseArgs() switch args["task"] { case "browse": dico := music.LoadDictionnary(args["workingFolder"]) dico.Browse(args["browse"]) case "index": music.IndexArtists(args["workingFolder"]) default: fmt.Println("No task define. Available tasks (-task) : browse (-workingFolder and -browse required), index (-workingFolder required)") } }