Skip to content

Golang api boilerplate with Gorm v2, some S.O.L.I.D principles with service pattern

Notifications You must be signed in to change notification settings

mococa/golang-api-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang API Boilerplate

Golang API boilerplate using:

  • Gorm v2
  • S.O.L.I.D principles
  • Service pattern
  • Gorilla Mux
  • Govalidator
  • Postgres

It's a simple api. The database entities are:

  • User
  • Book
  • Borrowed Book

As one user can borrow many books

Routes

Method Endpoint Body Query Description
GET /user none none Lists all users
POST /user { email:string, password: string, name: string, picture: string } none Creates a user
POST /book { name:string, author: string, release_year: number } none Creates a book
GET /book/{userId}/borrowed none none Lists all books borrowed by user with given ID
POST /book/{bookId}/borrow { user_id: string } none Makes user borrow book

About

Golang api boilerplate with Gorm v2, some S.O.L.I.D principles with service pattern

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published