- Up docker compose
This will create mysql
container for development with default database, and build docker image for cake-api-service
.
docker-compose up
Before any API is called run init migration first to create required tables
- Init database scheme
go run migrations/init.go migrations/mysql/cake_service/001-init_scheme.sql
GET /api/v1/cakes
get list of cakesGET /api/v1/cakes/:cakeID
get cake item by idPOST /api/v1/cakes
create new cake dataPATCH /api/v1/cakes/:cakeID
update cake, one or all fieldsDELETE /api/v1/cakes/:cakeID
delete cake item by id
config
for accessing external configurationcore
is for main domain entity, business logic or use case and interfaces for repository, this package will be the center of the structure where other package can depends on and implement the interfacehandler
is the starting point for http endpoint, it parses the request, pass to core module to process and then return the responserepository
will implement repository interface declared incore
utils
miscellaneous helper functionsmigrations
contains migration sql file