ThreeDotsLabs / esja

Event Sourcing library in Go.
MIT License
19 stars 4 forks source link

Idea: Separate `eventstore/${driver.go}` into `eventstore/${driver}` packages #9

Open maclav3 opened 1 year ago

maclav3 commented 1 year ago

If there's more drivers, then perhaps

import "esja/pkg/eventstore/sql"

sql.NewStore[MyAggregate](...)

would be better than

import "esja/pkg/eventstore"

eventstore.NewSQLStore[MyAggregate](...)

Besides, we could have separate go.mods for those drivers, so that the main lib doesn't have to depend on postgres or sqlite

m110 commented 1 year ago

Interesting idea with go.mods 🤔 Although it might also be confusing for users that you need additional go get for a package inside the library.

m110 commented 1 year ago

An interesting side-effect of adding a dedicated go.mod to the example is that now there are no dependencies other than testify in the main package.