Simple project architectured and designed to put into practice some of the concepts I've been lately studying, such as:
- Clean Architecture
- Go
- Kubernetes
This is not a commercial project, it's for study purposes only
$ go install
$ docker compose up -d
Check this file for more details about the endpoints.
Note: you can install this extension in VSCode to test the endpoints.
Coming soon...
src
├── controller
│ └── redirect
│ └── input
├── database
│ ├── couchbase
│ ├── firestore
│ └── output
│ └── document
├── job
│ └── jobtest
├── model
├── queue
│ └── asynq
├── repository
└── validator
- Infrastructure
- Controller
- Database
- Queue
- Application
- Job
- Repository
- Validator
- Domain
- Model
Based on the princple, an inner layer should never rely on an outer layer so that circular dependencies are avoided as well as let the code more testable.
For instance, the jobs do not mention anything from the database clients.
Interface Adapters are used in order to let the use cases and entities communicate with external services without coupling them.
The clients for each supported database are designed with adapters and they are built based on a common interface called DocumentInterface
.
The following databases are supported:
- Firestore
- Couchbase
In case you want to switch the database used by the application, all you have to do is to call the proper adapter in the main file:
database := couchbase.NewCouchbaseAdapter()
database := firestore.NewFirestoreAdapter()