Chronicle. Provider behaviour
(chronicle v0.1.2)
Copy Markdown
Behaviour implemented by audit storage providers.
write_group/3 must make the group and its events visible atomically whenever
the underlying store supports transactions.
A behaviour rather than a bare module because there are genuinely two implementations with different guarantees: the Ecto provider, which is transactional and signs everything, and the in-memory one, which exists for tests. Only the first is a place to keep an audit trail — the memory provider has no chain, no persistence, and nothing to verify.
Summary
Types
Callbacks
@callback write_event(Chronicle.Event.t(), options()) :: result()
@callback write_group(Chronicle.Group.t(), [Chronicle.Event.t()], options()) :: result()
Functions
@spec write_event( Chronicle.Event.t(), keyword() ) :: result()
@spec write_group(Chronicle.Group.t(), [Chronicle.Event.t()], keyword()) :: result()