Clean code structure for use in other projects.
.
├── README.md
├── cmd
│ ├── httpserver
│ │ └── main.go
│ ├── manager
│ │ ├── all.go
│ │ ├── blueprint
│ │ │ ├── handler
│ │ │ │ ├── handler.tmpl
│ │ │ │ ├── route.tmpl
│ │ │ │ └── sample.tmpl
│ │ │ ├── param
│ │ │ │ └── sample.tmpl
│ │ │ ├── service
│ │ │ │ ├── sample.tmpl
│ │ │ │ └── service.tmpl
│ │ │ └── validator
│ │ │ ├── sample.tmpl
│ │ │ └── validator.tmpl
│ │ ├── creator.go
│ │ ├── handler.go
│ │ ├── main.go
│ │ ├── param.go
│ │ ├── service.go
│ │ └── validator.go
│ └── scheduler
│ └── main.go
├── config
│ ├── config.go
│ ├── default.go
│ └── load.go
├── delivery
│ └── httpserver
│ ├── healthhandler
│ │ ├── check.go
│ │ ├── handler.go
│ │ └── route.go
│ ├── middleware
│ └── server.go
├── logger
│ └── logger.go
├── param
│ ├── baseparam.go
│ └── healthparam
│ └── check.go
├── pkg
│ ├── errmsg
│ │ └── messages.go
│ ├── httpmsg
│ │ └── mapper.go
│ └── richerror
│ └── richerror.go
├── scheduler
│ ├── doNothing.go
│ └── scheduler.go
├── service
│ └── healthservice
│ ├── check.go
│ └── service.go
├── validator
│ └── healthvalidator
│ ├── check.go
│ └── validator.go
├── adapter
├── contract
├── entity
├── repository
├── go.mod
├── go.sum
└── config.yml
This directory contains all binaries we can build from project
This directory contains the main binary of project
The main.go is contain all services, validators and ... . All thing must configure in this file.
This folder provide a dev tools help to create everything easier by command line interface. Use it as mentioned in bellow:
go run ./cmd/manager/
Alle scheduler task and worker must register here.
All configuration must add to the config file if default value is required define it in default.go
This folder contains all delivery layers like httpserver, grpcserver or ...
All http handler goes here every handler in one directory and contain route.go
and handler.go
. Every methods of
handler in separate files like get,store,edite or ... .
This folder contain the logger of project.
This folder contain the struct of all parameters. every handler hase a folder here named handlerparam
.
All packages must write to this folder
All scheduler must write to this folder.
This folder is used for write business logics.
All request validator must write to this folder
All third party services go here.
All contracts used for data transfer protocols like grpc or rabbitmq or ... goes here.
All entities layer must write in this folder
All DB calls must manage in this folder
All configuration must write in this file.