ExDataHoover

This package exposes a simple API to implement event sourcing.

Installation

Update you mix file:


  defp deps do
    [
      {:ex_data_hoover, git: "https://github.com/jobteaser/ex_data_hoover.git"}
    ]
  end

And then execute:

  $ mix deps.get

Configuration

First, you have to start a Nozzle Genserver:


  ExDataHoover.Nozzle.start_link(
    :sign_in, #name
    ExDataHoover.Bag.Simple, #Your Bag
    fn(x) -> x end #traits anonymous function
  )

And you can then send an event by calling the absorb function:

  ExDataHoover.Nozzle.absorb(:sign_in,
    trackee: user,
    event: "sign_in attempt",
    props: %{timestamps: NaiveDateTime.utc_now()}
  )

Some notes about the bag

Please refer to lib/ex_data_hoover/bag/simple.ex for a bag example.

A bag has to omplement 2 functions:

Development

Run mix test to run the tests. Run mix dialyzer to check typespecs.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jobteaser/ex_data_hoover.

License

The gem is available as open source under the terms of the MIT License.

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_data_hoover.