Elton Minetto f5de9ba767 update readme
2022-05-02 14:34:29 -03:00
2020-09-29 21:54:02 -03:00
2020-10-24 11:36:58 -03:00
2020-06-25 14:29:02 -03:00
2020-10-12 08:16:08 -03:00
2020-10-12 08:02:35 -03:00
2020-06-30 13:37:51 -03:00
2020-09-29 21:53:33 -03:00
2021-08-31 11:33:54 +00:00
2020-06-29 18:23:12 -03:00
2022-04-10 20:19:24 -03:00
2022-04-10 20:19:24 -03:00
2022-05-02 14:34:29 -03:00

Clean Architecture in Go

Build Status

Post: Clean Architecture, 2 years later

Build

make

Run tests

make test

API requests

Add book

curl -X "POST" "http://localhost:8080/v1/book" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -d $'{
  "title": "I Am Ozzy",
  "author": "Ozzy Osbourne",
  "pages": 294,
  "quantity":10
}'

Search book

curl "http://localhost:8080/v1/book?title=ozzy" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json'

Show books

curl "http://localhost:8080/v1/book" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json'

Add user

curl -X "POST" "http://localhost:8080/v1/user" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -d $'{
  "email": "ozzy@metal.net",
  "first_name": "Ozzy",
  "last_name": "Osbourne",
  "password": "bateater666"
}'

Search user

curl "http://localhost:8080/v1/user?name=ozzy" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json'

Show users

curl "http://localhost:8080/v1/user" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json'

Borrow a book

curl "http://localhost:8080/v1/loan/borrow/be8b1757-b043-4dbd-b873-63fa9ecd8bb1/282885d7-5d5e-4205-87eb-edc2b2ac5022" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json'

Return a book

curl "http://localhost:8080/v1/loan/return/be8b1757-b043-4dbd-b873-63fa9ecd8bb1" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json'

CMD

Search for a book

./bin/search ozzy
S
Description
No description provided
Readme 11 MiB
Languages
Go 98.1%
Makefile 1.9%