Layout
The following is a high level overview of the layout of this service with corresponding descriptions of each.
├── .gitlab
├── api
│ ├── middleware
│ ├── v1
├── build
├── cmd
│ ├── cli
│ ├── server
├── docs
│ ├── images
├── internal
│ ├── cli
│ ├── config
├── pkg
│ ├── data
│ ├── db
│ ├── entities
│ ├── middleware
│ ├── migrate
│ ├── seed
│ ├── logger
│ ├── featureflag
├── .gitlab-ci.yml
├── docker-compose.yml
├── Dockerfile
├── go.mod
├── mkdocs.yml
Directories
-
.gitlab/
- This directory contains the configuration files included in the top level .gitlab-ci.yml
-
api/
- If your service provides a RESTful API, this directory may contain API routes, controllers, and handlers. The structure inside api/
might follow a pattern like api/router/v1/...
-
build/
- This directory contains build time files and artifacts such as migrations.
-
cmd/
- This directory contains the main applications and entry points for your service. Each subdirectory typically represents a different executable for your service. For instance, you might have cmd/serve
for your API server and cmd/migrate
for running migrations.
-
docs/
- Documentation for your service, which might include API documentation, usage guides, and design decisions. This directory is assumed to be TechDocs with structure defined by the top level mkdocs.yml
file.
-
internal/
- This directory holds packages and modules that are specific to your application. The internal package is used to prevent these modules from being imported by other services or applications. It's a way to encapsulate your service's core logic.
-
pkg/
- General utility packages that can be reused across the application, but aren't specific to any particular domain (unlike those in internal
).
Files
-
.gitlab-ci.yml
- This file contains the stages and jobs to run within GitLab for commits and merge requests`
-
docker-compose.yml
- Contains configuration for running a local Docker enabled development environment for a Postgres database.
-
Dockerfile
- Contains the instructions for packaging this service as a Docker image artifact.
-
go.mod
- Contains direct and indirect dependencies and module declarations.
-
mkdocs.yml
- Defines navigation, plugins and links for TechDocs defined in the /docs
directory.
-
qm.yml
- Manifest used for registering service in QM System Model and catalog.