Skip to content

jarnsida/rest-api-example

 
 

Repository files navigation

Github CI/CD Go Report Repository Top Language Scrutinizer Code Quality GitHub go.mod Go version Codacy Grade Github Repository Size Github Open Issues Lines of code License GitHub release (latest by date) GitHub last commit GitHub contributors Simply the best ;)

REST API Server example

Ladies and gentlemen, once upon a time I asked a candidate for Golang Junior Developer position to create a simple Golang REST API server doing something useful (anything useful).

I won't show his code here :) But as a result I realized I don't have my answer to this question :) So, here it is!

This is Golang REST API server example including the following features:

  • based on high performance, extensible, minimalist Go web framework - Echo - https://echo.labstack.com
  • made with Clean Architecture in mind (controller -> service -> repository)
  • has services that work with both PostgreSQL/MySQL database (user/file metadata CRUD) and Google Cloud Storage (file upload/download)
  • includes service & controller go tests based on database mocks auto-generated with go:generate and mockery (https://github.com/vektra/mockery)
  • Postman tests included aswell
  • config based on envconfig (https://github.com/kelseyhightower/envconfig)
  • made relatively fast :) but with ❤️ :)

About

REST API server made with clean architecture.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 88.6%
  • Shell 10.9%
  • Other 0.5%