Simple CRUD API wirtten in Go
with firestore db. This project is just a little project to learn few Go skills and to manipulate object in Firestore.
This project use firestore emulator. You need to to set it up according to your env to make it work.
- install
firestore-cli
- change
.env
and.firebaserc
project id value to yours
Then run :
$ go mod tidy
$ go run main.go
This project use swagger
as documentation. You can run this API and find it at http://localhost:8085/swagger/index.html
This API manage Album object based on that go structure
type Album struct {
ID string `json:"id"`
Title string `json:"title"`
Artist string `json:"artist"`
Price float64 `json:"price"`
}
method | path | params | decription |
---|---|---|---|
GET |
health |
None | little health check |
method | path | params | decription |
---|---|---|---|
GET |
/albums |
None | List albums |
GET |
/albums |
:id |
Get album by id |
DELETE |
/albums |
:id |
Delete album by id |
PATCH |
/albums |
:id |
Update album by id |
POST |
/albums |
None | Post album as JSON |