events
events/model.go
Create our Model helper. Create a Model interface that any type can implement by just providing getters that will be used to build Events produced around that type. Add a PublishModelEvent helper that takes a Publisher, a Model, and an action (as a string) and builds a consistent Event around the Model, then publishes it to the Publisher. This is a helpful wrapper in most of our systems, and will probably handle 99% of our NSQ publishes, because most of our infrastructure is going to be something like "a new profile was created" or "a new login was created" or "a profile was updated" and we just want to disseminate that information across all our services, to push based on it, or trigger actions. This abstracts it out nicely to a standard format and a nice, easy way to send those messages.