- cmd - this folder contains main entry point of project
- config - contains configurations and global constants
- migrations - contains database
DDL
commands for using withgo-migrate
cli tool - nginx - contains nginx configurations
- scripts - contains docker container entrypoint scripts
- templates - contains static html templates
- pkg
- faker_util - contains fake data generators
- helpers - contains commonly used functions
- logger - logging utility
- mailer - email sender
- response - returns json response with checking errors in response
- router - contains gin router initialisation
- security - contains security functions such as generating hash, jwt token validation
- sentry - contains
sentry
tracer implementation - storage - contains query interfaces to database and database connections
- translator - translates validation errors to human-readable texts
- validator - validates json requests
- internal
- handler - contains versioned http handlers, you can also add another type of handlers there, such as event handlers or callback handlers
- job - contains periodically runnable tasks in background
- middleware - contains checking permissions, logging requests
- models - contains request-response DTO s
- repository - contains database queries, you can implement interfaces to your specific databases there
- server - contains http server initialisation
- services - contains business logic of project and all of your code should be here, services can use each other as dependency
- types - type aliases for using long types
Currently, there are app versioning, authorization, swagger documentation, file uploading and rendering, profiling, user and role handlers.
All packages joined together with
DI
pattern and useduber.fx
for this. Every package are testable and mockable for every type of testing.