Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename delivery to controller #45

Merged
merged 1 commit into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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