Akira provides a complete go-nats interface with a mock connection for testing.
You can use it like:
fc = akira.NewFakeConnector()
// Create a fake connector
xfc := fc.(*akira.FakeConnector)
// Subscribe to a specific event stream
fc.Subscribe("environment.get", func(m *nats.Msg){ println("Hello world!")})
fc.Publish("environment.get", "{...}")
// You can get a history of events accessing xfc.Events
make lint
make test
Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.
Moreover, if your pull request contains patches or features, you must include relevant unit tests.
For transparency into our release cycle and in striving to maintain backward compatibility, this project is maintained under the Semantic Versioning guidelines.
Code and documentation copyright since 2015 r3labs.io authors.
Code released under the Mozilla Public License Version 2.0.