diff --git a/Makefile b/Makefile index c0b0e322..cbff6145 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index a4f15377..073d74ed 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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: @@ -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 diff --git a/internal/app/app.go b/internal/app/app.go index 53c6867a..33df579b 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -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" diff --git a/internal/delivery/amqp_rpc/router.go b/internal/controller/amqp_rpc/router.go similarity index 100% rename from internal/delivery/amqp_rpc/router.go rename to internal/controller/amqp_rpc/router.go diff --git a/internal/delivery/amqp_rpc/translation.go b/internal/controller/amqp_rpc/translation.go similarity index 100% rename from internal/delivery/amqp_rpc/translation.go rename to internal/controller/amqp_rpc/translation.go diff --git a/internal/delivery/http/v1/error.go b/internal/controller/http/v1/error.go similarity index 100% rename from internal/delivery/http/v1/error.go rename to internal/controller/http/v1/error.go diff --git a/internal/delivery/http/v1/router.go b/internal/controller/http/v1/router.go similarity index 100% rename from internal/delivery/http/v1/router.go rename to internal/controller/http/v1/router.go diff --git a/internal/delivery/http/v1/translation.go b/internal/controller/http/v1/translation.go similarity index 100% rename from internal/delivery/http/v1/translation.go rename to internal/controller/http/v1/translation.go