Skip to content

pendo-io/acme-books

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Acme Books project

  1. Run the datastore emulator locally:
gcloud components install cloud-datastore-emulator
gcloud beta emulators datastore start --project=acme-books --host-port=localhost:3031 --no-store-on-disk
  1. Build the code
go build ./...
  1. Start the server
go run .
  1. See the current book list
http://localhost:3030/books
  1. Check a single book's details using its id/key
http://localhost:3030/books/4

Exercise

  1. Refactor the datastore client usage to avoid duplicate code (see main.go and library.go)
  2. Order the results for the book list by author name
  3. Allow filtering to be applied to the book list (via a query parameter)
  4. Add a new end point to rent or return a book
request:
PUT: http://localhost:3030/:id/borrow
PUT: http://localhost:3030/:id/return

response:
204 if ok
400 if invalid id
400 if already borrowed
400 if not borrowed when returned
  1. Add a new end point to add a book to the library
request:
POST: http://localhost:3030/book
Body: Book in JSON format

response:
200 + Book object including generated key
  1. Raise a PR and have it peer reviewed by a fellow Gohorter

About

Training project to onboard go developers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages