Skip to content

A Go API boot using a clean micro service architecture, OAuth2.0 security, Docker and Postgres

License

Notifications You must be signed in to change notification settings

adriendomoison/apigoboot

Repository files navigation

ApiGoBoot - WIP - Looking for inputs & code reviews! 🚀❤️️🚀❤️🚀

Go Report Card Build Status Coverage Status GoDoc License: MIT

This is a playground for a boilerplate API in Go using a micro service oriented architecture. The architecture will be updated depending on what I'll be reading/learning on the web.

Set up

Start

$ docker network create apigoboot_network
$ docker-compose up

Return values

The API return user friendly error message that can be printed directly client-side. The errors are always using the same nomenclature.

{
    "Errors": [
        {
            "param": "last_name",
            "detail": "The field last_name is required",
            "message": "Please complete this field"
        },
        {
            "param": "email",
            "detail": "The field email is required",
            "message": "Please complete this field"
        }
    ]
}

An Errors array is returned composed of objects including the faulty param and a detail human readable sentence to describe each error.

When an error happen during the request process but that the submitted request pass the validation, a more detailed error will be returned:

{
    "Errors": [
        {
            "status_code": 1003,
            "title": "Operation scheduled_date malformed",
            "detail": "The field scheduled_date need to use the 2006-12-31 format",
            "message": "Please use the 2006-12-31 format"
       }
    ]
}

About

A Go API boot using a clean micro service architecture, OAuth2.0 security, Docker and Postgres

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published