Skip to content

Commit

Permalink
Rename delivery to controller (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashamelentyev authored Aug 31, 2021
1 parent 35fc6d9 commit 96c6b54
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ compose-down:
.PHONY: compose-down

swag-v1:
swag init -g internal/delivery/http/v1/router.go
swag init -g internal/controller/http/v1/router.go
.PHONY: swag-v1

run: swag-v1
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ For example:
$ go run -tags migrate ./cmd/app
```

### `internal/delivery`
### `internal/controller`
Server handler layer (MVC controllers). The template shows 2 servers:
- RPC (RabbitMQ as transport)
- REST http (Gin framework)
Expand All @@ -96,7 +96,7 @@ Server routers are written in the same style:
- For each group, its own router structure is created, the methods of which process paths
- The structure of the business logic is injected into the router structure, which will be called by the handlers

#### `internal/delivery/http`
#### `internal/controller/http`
Simple REST versioning.
For v2, we will need to add the `http/v2` folder with the same content.
And in the file `internal/app` add the line:
Expand Down Expand Up @@ -247,8 +247,7 @@ These can be repositories `internal/usecase/repo`, external webapi `internal/use
In the template, the _infrastructure_ packages are located inside `internal/usecase`.

You can choose how to call the entry points as you wish. The options are:
- delivery (in our case)
- controllers
- controller (in our case)
- transport
- gateways
- entrypoints
Expand Down
4 changes: 2 additions & 2 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/gin-gonic/gin"

"github.com/evrone/go-clean-template/config"
amqprpc "github.com/evrone/go-clean-template/internal/delivery/amqp_rpc"
v1 "github.com/evrone/go-clean-template/internal/delivery/http/v1"
amqprpc "github.com/evrone/go-clean-template/internal/controller/amqp_rpc"
v1 "github.com/evrone/go-clean-template/internal/controller/http/v1"
"github.com/evrone/go-clean-template/internal/usecase"
"github.com/evrone/go-clean-template/internal/usecase/repo"
"github.com/evrone/go-clean-template/internal/usecase/webapi"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 96c6b54

Please sign in to comment.