go-boilerplate

module
v0.0.0-...-4f9ff06 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: BSD-2-Clause

README

go-boilerplate

Golang API Service boilerplate using best practices of Clean Architecture.

Responsibility: CRUD and Login Users with JWT.

Dependencies

  • Gin-Gonic
  • Swaggo
  • go-redis
  • GORM (MySQL)
  • Golang-Migrate
  • Snowflake
  • OpenTelemetry
  • JWT-Go
  • Crypto

Documentation & Routes

Swagger http://localhost:8000/auth/swagger/index.html

Print of Swagger

Jaeger UI http://0.0.0.0:16686/search

Print of Jaeger

On Error Print of Jaeger

SQL Print of Jaeger

Compose Stack

  • API REST
  • MySQL
  • Redis
  • Jaeger

Execution / Compilation

Set Env. variables of .env-sample:

Compile with:

make run

Update Swagger Doc:

make doc

Tests

make test

Path's Organization

Clean Arch Clean Representation

  • assets: static files
  • cmd: binaries entrypoint
  • internal: private packages
    • configs: env. variables
    • usecase: business logical/rules
    • delivery: delivery layer -> http, grpc, messaging
    • entity: entities / schemas
    • repository: storage operations, database interface
    • service: external services call's
  • pkg: public packages
  • docs: Swagger Documentation

Directories

Path Synopsis
cmd
api
Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT This file was generated by swaggo/swag
Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT This file was generated by swaggo/swag
internal
pkg

Jump to

Keyboard shortcuts

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