// Create index used by search func (ms *MusicServer) index(response http.ResponseWriter, request *http.Request) { // Always check addressMask. If no define, mask is 0.0.0.0 and nothing is accepted (except localhost) if !ms.checkRequester(request) { return } if ms.musicFolder != "" { ms.textIndexer = music.IndexArtists(ms.folder) } }
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)") } }