go-api-boilerplate

module
v0.0.0-...-78a7415 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT

README

GO API boilerplate

Exemplo de arquitetura de API utilizando a linguagem Go

Arquitetura

  • 3 áreas

    • admin
    • client
    • auth
  • Storage

    • Memory
http
├── api
│   ├── admin
│   │   ├── api.go
│   │   └── user.go
│   ├── auth
│   │   ├── api.go
│   │   └── login.go
│   └── client
│       ├── api.go
│       └── user.go
├── main.go
├── middleware
│   ├── cors.go
│   ├── logger.go
│   ├── max_client.go
└── utils
    └── handler.go

Endpoints

Admin
Description http path
list GET /api/admin/user
get GET /api/admin/user/:id
store POST /api/admin/user
update PUT /api/admin/user/:id
delete DELETE /api/admin/user/:id
Public
Description http path
list GET /api/user
get GET /api/user/:id
Auth
Description http path
admin POST /api/auth/admin/signin
public POST /api/auth/client/signin

Insomnia

Lista de todas requisições para usar com Insomnia, basta importar :) => link

Dependências

Build & Deploy

Standalone
  • Build
make prod
  • Deploy
./bin/go-api-boilerplate
Docker
  • Build
make docker
  • Push
make docker-push
  • Deploy
docker run -it --name go-api-boilerplate \
    -p 3000:3000 \
    douglaszuqueto/go-api-boilerplate:latest

Referências

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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