33
GitHub - spy16/droplets: Droplets is a platform for Gophers.
source link: https://github.com/spy16/droplets
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
WIP
droplets
A platform for Gophers similar to the awesome Golang News.
Why ?
Droplets is NOT built because there is no such platform nor is it built to solve problems with existing platforms.
New gophers often struggle with deciding how to structure their applications and also miss certain
important conventions (e.g., Accept Interfaces, Return Structs
).
Droplets is built to showcase:
- A manageable Project Layout
- Application of CodeReviewComments and EffectiveGo
- Usage of Clean Architecture
Organization
Directory Structure
Directory structure is based on Project Layout.
1. internal/
- contains non-reusable parts of the project
- directories inside
internal/
are organized as per Clean Architecturedomain/
contains different core entity definitions and represents the entities layer.usecases/
contains different busniess logic built around entities and represents the usecases layer.delivery/
exposes the usecases as API or web app and represents interface-adapter layer.stores/
provides storage functions for domain entities and is also part of interface-adapter layer.
2. pkg/
- contains re-usable parts of the project
- these packages can be directly imported in other projects without being dependent on logic specific to
droplets
project. - some of the packages included:
logger
- provides logging functions.graceful
- provides a server wrapper with graceful shutdown enabled.middlewares
- provides generic middlewares for use in REST or HTTP handlers
3. web/
- contains web assets such as css, images, templates etc.
License
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK