Directory Structure - payfazz/tango GitHub Wiki
.ci
This directory store files needed for CI/CD integration:
Dockerfile
for building docker imageJenkinsfile
for configure jenkins pipelinebuilder.sh
andproject.yml
for supporting CI/CD integration
cmd
This directory should have 3 sub directories which used to store main.go
files for 3 types of service entry point:
migrate
for running migration code insidedatabase/migration
directory into databasegenerate-sql
for generating sql migration query from migration code insidedatabase/migration
directorytango
later will be changed toproject-name
config
This directory is used for storing configuration files which can be overriden using unix environment variables
database
This directory should have 2 sub directories which used to:
- store migration inside
migration
directory - store seed code inside
seed
directory
internal
This directory should have at least 3 sub directories which used to:
- store global value constants inside
value
directory - domain and core application files should be stored inside
domains
directory - it is recommended to store dashboard related services in separate directory named
dashboard
- (OPTIONAL) if you need to develop an application using event sourcing it is recommended to store all aggregate event struct inside
aggregate
directory
lib
This directory is used to store library code which used for specific helper method(s) or object(s) which interact with third-party partner or used multiple times inside services
test
This directory should have 2 sub directories and 1 file that is used to:
- store testing entry point as shell scripts inside
scripts
directory - migration code for testing inside
migrate
directory - testing methods should be stored into
test.go
transport/container
This directory should store service container, middleware and library initialization inside container
directory
transport/grpc
This directory should store grpc transport files that should have 4 sub directories that is used to:
- required application grpc middleware inside
app
directory - additional custom grpc middleware inside
middleware
directory - grpc routing, middleware and server initialization inside
server
directory - grpc controller files inside
controller
directory
transport/http
This directory should store http transport files that should have 6 sub directories that is used to:
- required application http middleware inside
app
directory - additional custom http middleware and http middleware container inside
middleware
directory - http routing inside
route
directory - http controller files inside
controller
directory - initialize http server inside
server
directory