go:architecture:clean_arch
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| go:architecture:clean_arch [2026/01/30 01:25] – [Overall Structure (Clean Architecture Only)] phong2018 | go:architecture:clean_arch [2026/01/30 01:33] (current) – [2. Application Layer — Usecase Orchestration] phong2018 | ||
|---|---|---|---|
| Line 46: | Line 46: | ||
| ==== Overall Structure (Clean Architecture Only) ==== | ==== Overall Structure (Clean Architecture Only) ==== | ||
| - | <pre> | + | <code text> |
| internal/ | internal/ | ||
| ├── domain/ | ├── domain/ | ||
| Line 72: | Line 72: | ||
| ├── logger/ | ├── logger/ | ||
| └── database/ | └── database/ | ||
| - | </pre> | + | </code> |
| Line 85: | Line 85: | ||
| ===== V. Processing Flow (Request → Response) ===== | ===== V. Processing Flow (Request → Response) ===== | ||
| - | < | + | < |
| + | Client (gRPC / HTTP Request) | ||
| + | | ||
| + | Interface Layer (Handler) | ||
| + | | ||
| + | | ||
| + | | ||
| + | Application Layer (Usecase) | ||
| + | | ||
| + | | ||
| + | Domain Layer (Repository Interface) | ||
| + | | ||
| + | | ||
| + | Infrastructure Layer (Implementation) | ||
| + | | ||
| + | | ||
| + | Database / External Service | ||
| + | </ | ||
| ===== VI. Detailed Layer Examples ===== | ===== VI. Detailed Layer Examples ===== | ||
| Line 100: | Line 116: | ||
| File location: | File location: | ||
| - | < | + | < |
| internal/ | internal/ | ||
| - | </ | ||
| <code go> type AddPointRepository interface { FetchProcessingOrders( ctx context.Context, | <code go> type AddPointRepository interface { FetchProcessingOrders( ctx context.Context, | ||
| Line 131: | Line 146: | ||
| < | < | ||
| internal/ | internal/ | ||
| + | |||
| </ | </ | ||
| - | <code go> type PointAddUsecase struct { repo domain.AddPointRepository } | + | <code go> |
| + | type PointAddUsecase struct { repo domain.AddPointRepository } | ||
| func (u *PointAddUsecase) Execute(ctx context.Context) error { | func (u *PointAddUsecase) Execute(ctx context.Context) error { | ||
go/architecture/clean_arch.1769736341.txt.gz · Last modified: by phong2018
