https://github.com/ss49919201/go-functional-layered-architecture
A sample Go project implementing layered architecture with functional programming paradigms.
https://github.com/ss49919201/go-functional-layered-architecture
ddd ddd-example go layered-architecture
Last synced: 5 months ago
JSON representation
A sample Go project implementing layered architecture with functional programming paradigms.
- Host: GitHub
- URL: https://github.com/ss49919201/go-functional-layered-architecture
- Owner: ss49919201
- License: mit
- Created: 2025-08-10T04:44:14.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-08-10T06:37:45.000Z (10 months ago)
- Last Synced: 2025-08-10T07:08:22.134Z (10 months ago)
- Topics: ddd, ddd-example, go, layered-architecture
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Functional Layered Architecture
A sample Go project implementing layered architecture with functional programming paradigms. This project demonstrates clean architecture using dependency injection and functional approaches through a reservation system example.
This project follows the [Go Module Layout](https://go.dev/doc/modules/layout#server-project) guidelines for server projects, keeping all Go packages implementing the server's logic in the `internal` directory.
## Project Overview
This project provides an implementation example of functional layered architecture in Go. Rather than traditional object-oriented approaches, the design emphasizes treating functions as first-class objects, focusing on pure functions and function composition.
- **Functional Approach**: Uses function types instead of interfaces across layers
- **Pure Dependency Injection**: Dependencies passed as function arguments
- **Layer Separation**: Clear separation of responsibilities between Controller, Service, and Infrastructure layers
- **Comprehensive Testing**: Integration tests for behavior verification
## Architecture
```
┌─────────────────┐
│ Controller │ ← HTTP request/response handling
├─────────────────┤
│ Service │ ← Business logic implementation
├─────────────────┤
│ Infra │ ← Data access layer (in-memory implementation)
└─────────────────┘
```