Skip to content

Commit

Permalink
docs: update README (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerman authored Sep 20, 2020
1 parent 1f2d93d commit c565a7e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ It's not a complete example of The Clean Architecture itself
package `app` embeds "Entities" layer), but it does show the most relevant
part: how to create "API Controller" layer in package `srv/openapi`
between code auto-generated by go-swagger and "Use Cases" layer in package
`app`. Also it includes "DB Gateway" layer in package `dal/memory` (provided
trivial in-memory implementation is "DB" and "Gateway" layers at once).
`app`. Also it includes "DB Gateway" layer in packages `dal/memory` (provided
trivial in-memory implementation is "DB" and "Gateway" layers at once) and
`dal/mysql` (just "Gateway" layer).

### The hexagonal architecture, or ports and adapters architecture

Expand All @@ -59,7 +60,7 @@ adapters":
- "ports" are defined as interfaces in `app/app.go` - they make it
possible to easily test business-logic in `app` without any external
dependencies by mocking all these interfaces.
- "adapters" are implemented in `srv/*` (serve project APIs), `dal`
- "adapters" are implemented in `srv/*` (serve project APIs), `dal/*`
(access DB) and `svc/*` (use external services) packages - they can't be
tested that easy, so they should be as thin and straightforward as
possible and try hard to do nothing than convert ("adapt") data between
Expand All @@ -74,7 +75,7 @@ adapters":
application(s) subcommands and tests
- `internal/app` - define interfaces ("ports") and implements business-logic
- `internal/srv/*` - adapters for served APIs/UI
- `internal/dal` - adapter for data storage
- `internal/dal/*` - adapters for data storage
- `internal/svc/*` - adapters for accessing external services
- `pkg/*` - helper packages, not related to architecture and
business-logic (may be later moved to own modules and/or replaced by
Expand Down

0 comments on commit c565a7e

Please sign in to comment.