Skip to content
프로젝트

khannedy/golang-clean-architecture

GitHub에서 보기

소개

Go 언어 클린 아키텍처.

기타 프로젝트

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
+2
in 1 month
+1

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Golang Clean Architecture Template

Description

This is golang clean architecture template.

Architecture

Clean Architecture

  1. External system perform request (HTTP, gRPC, Messaging, etc)
  2. The Delivery creates various Model from request data
  3. The Delivery calls Use Case, and execute it using Model data
  4. The Use Case create Entity data for the business logic
  5. The Use Case calls Repository, and execute it using Entity data
  6. The Repository use Entity data to perform database operation
  7. The Repository perform database operation to the database
  8. The Use Case create various Model for Gateway or from Entity data
  9. The Use Case calls Gateway, and execute it using Model data
  10. The Gateway using Model data to construct request to external system
  11. The Gateway perform request to external system (HTTP, gRPC, Messaging, etc)

Tech Stack

Framework & Library

Configuration

All configuration is in config.json file.

API Spec

All API Spec is in api folder.

Database Migration

All database migration is in db/migrations folder.

Create Migration

migrate create -ext sql -dir db/migrations create_table_xxx

Run Migration

migrate -database "mysql://root:@tcp(localhost:3306)/golang_clean_architecture?charset=utf8mb4&parseTime=True&loc=Local" -path db/migrations up

Run Application

Run unit test

go test -v ./test/

Run web server

go run cmd/web/main.go

Run worker

go run cmd/worker/main.go

관련 프로젝트 살펴보기

불러오는 중…