A port of sound-recommender from Python to Golang.
- fiber - web framework
- gorm - ORM
- validator - input validation
- gojsonschema - input validation
- air - hot reload
- How should Gorm errors be handled?
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
Learning Go:
Building REST APIs with Go:
- Build a REST API in Go using Fiber + GORM
- Schema Validation in Go using Validator and Fiber
- Build a RESTful CRUD API with Golang (Gorm/Gin/Postgres article + github code)
- Tutorial: Developing a RESTful API with Go and Gin (go.dev)
- Go REST Guide. Gin Framework (JetBrains)
- Build a RESTful CRUD API with Golang Gin and Gorm
- Optimizing GoLang APIs with Gin, New Relic, and Swagger
- Performing CRUD Operations in PostgreSQL with Go (without an ORM)
Frameworks and libraries: