jchen42703 / go_apis

Prototyping different Go API repo structures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Structuring Go APIs

API Requirements

  1. Router
  2. Controllers for both HTTP and GRPC
  3. Request Validators
  4. Auth Middleware
  5. DB
    1. Postgres
  6. CLI
    1. DB Migrations
  7. Client SDK
  8. Promethesus/Grafana Dashboards
  9. Must be easily extendible
    1. Should be able to add databases, caching and change DBs easily
  10. Should be easily tested
    1. Should be able to test business logic separately from DB
  11. Should not overly abstract, but should be abstract enough to be testable
    1. i.e. only abstract what you need to

Resources

Repo Structure

Package Naming

About

Prototyping different Go API repo structures


Languages

Language:Go 87.2%Language:Shell 10.1%Language:Dockerfile 2.7%