diff --git a/README.md b/README.md index ac9e821..9d0a1ca 100644 --- a/README.md +++ b/README.md @@ -59,20 +59,26 @@ myapp │ └── main.go │ ├── api -│ ├── router -│ │ └── router.go +│ ├── resource +│ │ ├── book +│ │ │ ├── handler.go +│ │ │ ├── model.go +│ │ │ ├── repository.go +│ │ │ └── repository_test.go +│ │ ├── common +│ │ │ └── err +│ │ │ └── err.go +│ │ └── health +│ │ └── handler.go │ │ -│ └── resource -│ ├── health -│ │ └── handler.go -│ ├── book -│ │ ├── api.go -│ │ ├── handler.go -│ │ ├── model.go -│ │ └── repository.go -│ └── common -│ └── err -│ └── err.go +│ └── router +│ ├── middleware +│ │ ├── content_type_json.go +│ │ ├── content_type_json_test.go +│ │ └── requestlog +│ │ ├── handler.go +│ │ └── log_entry.go +│ └── router.go │ ├── migrations │ └── 00001_create_books_table.sql diff --git a/api/requestlog/handler.go b/api/router/middleware/requestlog/handler.go similarity index 100% rename from api/requestlog/handler.go rename to api/router/middleware/requestlog/handler.go diff --git a/api/requestlog/log_entry.go b/api/router/middleware/requestlog/log_entry.go similarity index 100% rename from api/requestlog/log_entry.go rename to api/router/middleware/requestlog/log_entry.go diff --git a/api/router/router.go b/api/router/router.go index 6a7a623..57798f7 100644 --- a/api/router/router.go +++ b/api/router/router.go @@ -6,10 +6,10 @@ import ( "github.com/rs/zerolog" "gorm.io/gorm" - "myapp/api/requestlog" "myapp/api/resource/book" "myapp/api/resource/health" "myapp/api/router/middleware" + "myapp/api/router/middleware/requestlog" ) func New(l *zerolog.Logger, v *validator.Validate, db *gorm.DB) *chi.Mux {