6 ms·
Packages: types - declares structs and possibly some mutators of these structs, repository - it’s a data storage layer that deals with storing and reading
by karmakaze 8y ago
Packages:
types - declares structs and possibly some mutators of these structs,
repository - it’s a data storage layer that deals with storing and reading structs,
service - would be the implementation of business logic that wraps repositories,
http, websocket, … - the transport layers, which all invoke the service layer
Don't do this. Having layers through which your program logic flows is very much not the Go way. Put the types/service/etc for a logical unit together. You can have lower levels of abstraction in packages and combine them in a higher one but don't group by layer type.