engine v0.1.2 Engine.Storage.Storage

Proxy API layer to provide a Facade for different data storages. The ideia is to read from the config file what is the choosen storage, and route the call to the specifc implementation. http://elixir-lang.org/docs/stable/elixir/typespecs

Summary

Functions

Save only one event to the stream

Save a list of events to the stream

Save snapshot after checking the frequency config, adding -snapshot to its namespace

Load all events for that stream

Load events, but from a specific position

Load the last snapshot for that stream

If you want to know what storage is configured

Types

event()
event :: struct
events()
events :: [struct]
position()
position :: integer
result()
stream()

Functions

append_event(stream, event)
append_event(stream, event) :: any

Save only one event to the stream.

append_events(stream, events)
append_events(stream, events) :: any

Save a list of events to the stream.

append_snapshot(stream, state, period \\ nil)

Save snapshot after checking the frequency config, adding -snapshot to its namespace

load_all_events(stream)

Load all events for that stream

load_events(stream, position)

Load events, but from a specific position

load_snapshot(stream)

Load the last snapshot for that stream

which_storage?()
which_storage? :: atom

If you want to know what storage is configured