Sound Recommender Golang

A port of sound-recommender from Python to Golang.

Libraries

TODO

  • How should Gorm errors be handled?

Invoking the API with curl

export BASE_URL=http://localhost:8080

# Admin sounds create - Stairway to Heaven / Led Zeppelin
curl -s -H "Content-Type: application/json" -X POST -d '{"title":"","genres":["rock"],"meta":{"credits":[{"name":"Led Zeppelin","role":"ARTIST"}]},"bpm":82}' $BASE_URL/admin/sounds | jq

# Get sound by ID
curl -s $BASE_URL/sounds/172 | jq

# List sounds
curl -s $BASE_URL/sounds | jq

# Admin sounds update
curl -i -H "Content-Type: application/json" -X PUT -d '{"title":"Stairway to Hell","genres":["death metal"],"credits":[{"name":"Jakob Marklund","role":"ARTIST"}]}' $BASE_URL/admin/sounds/1

# Admin sounds delete
curl -i -X DELETE $BASE_URL/admin/sounds/1

Resources

Learning Go:

Building REST APIs with Go:

Frameworks and libraries: