rest-api-example

module
v0.0.0-...-1e80c8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2021 License: MIT

README

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

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 ❤ :)

Directories

Path Synopsis
cmd
api
lib
pg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL